You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched the LangGraph/LangChain documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
I am sure that this is a bug in LangGraph/LangChain rather than my code.
I am sure this is better as an issue rather than a GitHub discussion, since this is a LangGraph bug and not a design question.
Example Code
classGooglePlacesTool(BaseTool):
"""Tool that queries the Google places API."""name: str="google_places"description: str= (
"A tool that queries the Google Places API. ""Useful for finding places based on a search query. ""This tool can help validate addresses or discover locations ""from ambiguous text inputs. ""Input should be a search query string."
)
api_wrapper: GooglePlacesAPIWrapper=Field(default_factory=GooglePlacesAPIWrapper) # type: ignore[arg-type]args_schema: Type[BaseModel] =GooglePlacesSchemadef_run(
self,
query: str,
run_manager: Optional[CallbackManagerForToolRun] =None,
) ->str:
logger.debug(f"RunManager has state?: {hasattr(run_manager, 'state')}")
# Run the original tool logicresult=self.api_wrapper.run(query)
returnresult
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
RunManager has state?: False
Description
How can I access state in a custom tool using the "Subclass Basetool" approach?
System Info
$ pip freeze | grep langchain langchain==0.3.0 langchain-anthropic==0.1.23 langchain-cohere==0.2.4 langchain-community==0.3.0 langchain-core==0.3.0 langchain-experimental==0.0.65 langchain-google-community==2.0.0 langchain-openai==0.2.0 langchain-text-splitters==0.3.0 langchainhub==0.1.21
The text was updated successfully, but these errors were encountered: