langchain.tools.graphql.tool.BaseGraphQLTool¶
class langchain.tools.graphql.tool.BaseGraphQLTool[source]¶
Bases: BaseTool
Base tool for querying a GraphQL API.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param args_schema: Optional[Type[BaseModel]] = None¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = "    Input to this tool is a detailed and correct GraphQL query, output is a result from the API.\n    If the query is not correct, an error message will be returned.\n    If an error is returned with 'Bad request' in it, rewrite the query and try again.\n    If an error is returned with 'Unauthorized' in it, do not try again, but tell the user to change their authentication.\n\n    Example Input: query {{ allUsers {{ id, name, email }} }}    "¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param graphql_wrapper: langchain.utilities.graphql.GraphQLAPIWrapper [Required]¶
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param metadata: Optional[Dict[str, Any]] = None¶
Optional metadata associated with the tool. Defaults to None
This metadata will be associated with each call to this tool,
and passed as arguments to the handlers defined in callbacks.