The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community[patch]: Allow override of 'fetch_schema_from_transport' in the GraphQL tool (#17649)
Zachary Toliver29ee0496b6aa
diff --git a/libs/community/langchain_community/utilities/graphql.py b/libs/community/langchain_community/utilities/graphql.pyindex a576419e5b..0478aef78e 100644--- a/libs/community/langchain_community/utilities/graphql.py+++ b/libs/community/langchain_community/utilities/graphql.py@@ -12,6 +12,7 @@ class GraphQLAPIWrapper(BaseModel):"""custom_headers: Optional[Dict[str, str]] = None+ fetch_schema_from_transport: Optional[bool] = Nonegraphql_endpoint: strgql_client: Any #: :meta private:gql_function: Callable[[str], Any] #: :meta private:diff --git a/libs/community/tests/unit_tests/utilities/test_graphql.py b/libs/community/tests/unit_tests/utilities/test_graphql.pyindex 2ef9be654b..82c75e21c0 100644--- a/libs/community/tests/unit_tests/utilities/test_graphql.py+++ b/libs/community/tests/unit_tests/utilities/test_graphql.py@@ -85,6 +85,7 @@ def test_run() -> None:graphql_wrapper = GraphQLAPIWrapper(graphql_endpoint=TEST_ENDPOINT,custom_headers={"Authorization": "Bearer testtoken"},+ fetch_schema_from_transport=True,)result = graphql_wrapper.run(query)diff --git a/libs/langchain/langchain/agents/load_tools.py b/libs/langchain/langchain/agents/load_tools.pyindex 24adaf867d..ab49c39a4a 100644--- a/libs/langchain/langchain/agents/load_tools.py+++ b/libs/langchain/langchain/agents/load_tools.py@@ -453,7 +453,10 @@ _EXTRA_OPTIONAL_TOOLS: Dict[str, Tuple[Callable[[KwArg(Any)], BaseTool], List[st),"stackexchange": (_get_stackexchange, []),"sceneXplain": (_get_scenexplain, []),- "graphql": (_get_graphql_tool, ["graphql_endpoint", "custom_headers"]),+ "graphql": (+ _get_graphql_tool,+ ["graphql_endpoint", "custom_headers", "fetch_schema_from_transport"],+ ),"openweathermap-api": (_get_openweathermap, ["openweathermap_api_key"]),"dataforseo-api-search": (_get_dataforseo_api_search,