id
stringlengths
14
15
text
stringlengths
49
2.47k
source
stringlengths
61
166
f830f5a4f196-1
bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no othe...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
f830f5a4f196-2
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
f830f5a4f196-3
Parse the output of an LLM call with the input prompt for context. The prompt is largely provided in the event the OutputParser wants to retry or fix the output in some way, and needs information from the prompt to do so. Parameters completion – String output of a language model. prompt – Input PromptValue. Returns Str...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
f830f5a4f196-4
Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable.
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
aaffe75b85e9-0
langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo¶ class langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo[source]¶ Bases: BaseModel Information about a VectorStore. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input da...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo.html
aaffe75b85e9-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo.html
aaffe75b85e9-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo.html
670cb5e79471-0
langchain.agents.agent_toolkits.json.toolkit.JsonToolkit¶ class langchain.agents.agent_toolkits.json.toolkit.JsonToolkit[source]¶ Bases: BaseToolkit Toolkit for interacting with a JSON spec. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot b...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.json.toolkit.JsonToolkit.html
670cb5e79471-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.json.toolkit.JsonToolkit.html
670cb5e79471-2
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmet...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.json.toolkit.JsonToolkit.html
a7e636655b54-0
langchain.agents.mrkl.base.MRKLChain¶ class langchain.agents.mrkl.base.MRKLChain[source]¶ Bases: AgentExecutor Chain that implements the MRKL system. Example from langchain import OpenAI, MRKLChain from langchain.chains.mrkl.base import ChainConfig llm = OpenAI(temperature=0) prompt = PromptTemplate(...) chains = [...]...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html
a7e636655b54-1
How to handle errors raised by the agent’s output parser.Defaults to False, which raises the error. sIf true, the error will be sent back to the LLM as an observation. If a string, the string itself will be sent to the LLM as an observation. If a callable function, the function will be called with the exception as an a...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html
a7e636655b54-2
These tags will be associated with each call to this chain, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a chain with its use case. param tools: Sequence[BaseTool] [Required]¶ The valid tools the agent can call. param trim_intermediate_steps: Unio...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html
a7e636655b54-3
addition to tags passed to the chain during construction, but only these runtime tags will propagate to calls to other objects. metadata – Optional metadata associated with the chain. Defaults to None include_run_info – Whether to include run info in the response. Defaults to False. Returns A dict of named outputs. Sho...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html
a7e636655b54-4
these runtime tags will propagate to calls to other objects. metadata – Optional metadata associated with the chain. Defaults to None include_run_info – Whether to include run info in the response. Defaults to False. Returns A dict of named outputs. Should contain all outputs specified inChain.output_keys. async ainvok...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html
a7e636655b54-5
directly as keyword arguments. Returns The chain output. Example # Suppose we have a single-input chain that takes a 'question' string: await chain.arun("What's the temperature in Boise, Idaho?") # -> "The temperature in Boise is..." # Suppose we have a multi-input chain that takes a 'question' string # and 'context' s...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html
a7e636655b54-6
Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep co...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html
a7e636655b54-7
llm = OpenAI(temperature=0) search = SerpAPIWrapper() llm_math_chain = LLMMathChain(llm=llm) chains = [ ChainConfig( action_name = "Search", action=search.search, action_description="useful for searching" ), ChainConfig( action_name="Calculator", action=llm_math_chain...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html
a7e636655b54-8
lookup_tool(name: str) → BaseTool¶ Lookup tool by name. classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html
a7e636655b54-9
Convenience method for executing chain. The main difference between this method and Chain.__call__ is that this method expects inputs to be passed directly in as positional arguments or keyword arguments, whereas Chain.__call__ expects a single input dictionary with all the inputs Parameters *args – If the chain expect...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html
a7e636655b54-10
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ stream(input: Input, config: Optional[RunnableConfig] = None) → Iterator[Output]¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedN...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html
1f9db276b5a3-0
langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent¶
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html
1f9db276b5a3-1
langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent(llm: BaseChatModel, toolkit: Optional[PowerBIToolkit] = None, powerbi: Optional[PowerBIDataset] = None, callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, prefix: str = 'Assistant is a large l...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html
1f9db276b5a3-2
blob with a single action, and NOTHING else):\n\n{{{{input}}}}\n", examples: Optional[str] = None, input_variables: Optional[List[str]] = None, memory: Optional[BaseChatMemory] = None, top_k: int = 10, verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → AgentExecut...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html
1f9db276b5a3-3
Construct a Power BI agent from a Chat LLM and tools. If you supply only a toolkit and no Power BI dataset, the same LLM is used for both.
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html
3b7233c82a58-0
langchain.agents.agent_toolkits.openapi.base.create_openapi_agent¶
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html
3b7233c82a58-1
langchain.agents.agent_toolkits.openapi.base.create_openapi_agent(llm: BaseLanguageModel, toolkit: OpenAPIToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = "You are an agent designed to answer questions by making web requests to an API given the openapi spec.\n\nIf the question does not see...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html
3b7233c82a58-2
Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question', input_variables: Optional[List[str]] = None, max_iterations: Optional[int] =...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html
3b7233c82a58-3
Construct an OpenAPI agent from an LLM and tools. Examples using create_openapi_agent¶ OpenAPI agents
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html
fe093dad4744-0
langchain.agents.agent.BaseMultiActionAgent¶ class langchain.agents.agent.BaseMultiActionAgent[source]¶ Bases: BaseModel Base Multi Action Agent class. 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. abstrac...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseMultiActionAgent.html
fe093dad4744-1
the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(**kwargs: Any) → Dict[source]¶ Return dictionary representation of agent. classmethod from_orm(obj: Any) → Model¶ get_allowed_tools() → Optional[List[str]][source]¶ json(*, include: Optional[Uni...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseMultiActionAgent.html
fe093dad4744-2
Parameters intermediate_steps – Steps the LLM has taken to date, along with the observations. callbacks – Callbacks to run. **kwargs – User inputs. Returns Actions specifying what tool to use. return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → AgentFi...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseMultiActionAgent.html
2d7ca93ef278-0
langchain.agents.agent_toolkits.conversational_retrieval.tool.create_retriever_tool¶ langchain.agents.agent_toolkits.conversational_retrieval.tool.create_retriever_tool(retriever: BaseRetriever, name: str, description: str) → Tool[source]¶ Create a tool to do retrieval of documents. Parameters retriever – The retriever...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.conversational_retrieval.tool.create_retriever_tool.html
4f48a8ea2f2c-0
langchain.agents.agent_toolkits.file_management.toolkit.FileManagementToolkit¶ class langchain.agents.agent_toolkits.file_management.toolkit.FileManagementToolkit[source]¶ Bases: BaseToolkit Toolkit for interacting with a Local Files. Create a new model by parsing and validating input data from keyword arguments. Raise...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.file_management.toolkit.FileManagementToolkit.html
4f48a8ea2f2c-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.file_management.toolkit.FileManagementToolkit.html
4f48a8ea2f2c-2
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmet...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.file_management.toolkit.FileManagementToolkit.html
60db1480680f-0
langchain.agents.load_tools.load_tools¶ langchain.agents.load_tools.load_tools(tool_names: List[str], llm: Optional[BaseLanguageModel] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → List[BaseTool][source]¶ Load tools based on their name. Parameters tool_names...
https://api.python.langchain.com/en/latest/agents/langchain.agents.load_tools.load_tools.html
f578275289da-0
langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent¶ langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent(llm: BaseLanguageModel, toolkit: VectorStoreToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to answer questions a...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent.html
56a98a92c723-0
langchain.agents.agent_iterator.AgentExecutorIterator¶ class langchain.agents.agent_iterator.AgentExecutorIterator(agent_executor: AgentExecutor, inputs: Any, callbacks: Callbacks = None, *, tags: Optional[list[str]] = None, include_run_info: bool = False, async_: bool = False)[source]¶ Iterator for AgentExecutor. Init...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_iterator.AgentExecutorIterator.html
56a98a92c723-1
raise_stopiteration(output: Any) → NoReturn[source]¶ Raise a StopIteration exception with the given output. reset() → None[source]¶ Reset the iterator to its initial state, clearing intermediate steps, iterations, and time elapsed. update_iterations() → None[source]¶ Increment the number of iterations and update the ti...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_iterator.AgentExecutorIterator.html
4be0203aa506-0
langchain.agents.load_tools.load_huggingface_tool¶ langchain.agents.load_tools.load_huggingface_tool(task_or_repo_id: str, model_repo_id: Optional[str] = None, token: Optional[str] = None, remote: bool = False, **kwargs: Any) → BaseTool[source]¶ Loads a tool from the HuggingFace Hub. Parameters task_or_repo_id – Task o...
https://api.python.langchain.com/en/latest/agents/langchain.agents.load_tools.load_huggingface_tool.html
04d6bf0034c4-0
langchain.agents.mrkl.output_parser.MRKLOutputParser¶ class langchain.agents.mrkl.output_parser.MRKLOutputParser[source]¶ Bases: AgentOutputParser MRKL Output parser for the chat agent. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be par...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.output_parser.MRKLOutputParser.html
04d6bf0034c4-1
Bind arguments to a Runnable, returning a new Runnable. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.output_parser.MRKLOutputParser.html
04d6bf0034c4-2
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.output_parser.MRKLOutputParser.html
04d6bf0034c4-3
Parse the output of an LLM call with the input prompt for context. The prompt is largely provided in the event the OutputParser wants to retry or fix the output in some way, and needs information from the prompt to do so. Parameters completion – String output of a language model. prompt – Input PromptValue. Returns Str...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.output_parser.MRKLOutputParser.html
04d6bf0034c4-4
Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable.
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.output_parser.MRKLOutputParser.html
7acb785033ff-0
langchain.agents.agent_toolkits.openapi.spec.dereference_refs¶ langchain.agents.agent_toolkits.openapi.spec.dereference_refs(spec_obj: dict, full_spec: dict) → Union[dict, list][source]¶ Try to substitute $refs. The goal is to get the complete docs for each endpoint in context for now. In the few OpenAPI specs I studie...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.spec.dereference_refs.html
175734bb9d60-0
langchain.agents.xml.base.XMLAgentOutputParser¶ class langchain.agents.xml.base.XMLAgentOutputParser[source]¶ Bases: AgentOutputParser 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. async abatch(inputs: Lis...
https://api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgentOutputParser.html
175734bb9d60-1
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclu...
https://api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgentOutputParser.html
175734bb9d60-2
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal...
https://api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgentOutputParser.html
175734bb9d60-3
Parse the output of an LLM call with the input prompt for context. The prompt is largely provided in the event the OutputParser wants to retry or fix the output in some way, and needs information from the prompt to do so. Parameters completion – String output of a language model. prompt – Input PromptValue. Returns Str...
https://api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgentOutputParser.html
175734bb9d60-4
Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable.
https://api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgentOutputParser.html
d2fff81355ae-0
langchain.agents.agent_toolkits.multion.toolkit.MultionToolkit¶ class langchain.agents.agent_toolkits.multion.toolkit.MultionToolkit[source]¶ Bases: BaseToolkit Toolkit for interacting with the Browser Agent Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the in...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.multion.toolkit.MultionToolkit.html
d2fff81355ae-1
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ get_tools() → List[BaseTool][source]¶ Get the tools in the toolkit. json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[A...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.multion.toolkit.MultionToolkit.html
3d434d19fbdf-0
langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing¶ class langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing[source]¶ Bases: BaseRequestsTool, BaseTool Requests POST tool with LLM-instructed extraction of truncated responses. Create a new model by parsing and validating...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing.html
3d434d19fbdf-1
This metadata will be associated with each call to this tool, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a tool with its use case. param name: str = 'requests_post'¶ Tool name. param requests_wrapper: TextRequestsWrapper [Required]¶ param respon...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing.html
3d434d19fbdf-2
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any)...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing.html
3d434d19fbdf-3
the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[boo...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing.html
3d434d19fbdf-4
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ run(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Op...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing.html
ed53b2acb4f9-0
langchain.agents.react.base.ReActDocstoreAgent¶ class langchain.agents.react.base.ReActDocstoreAgent[source]¶ Bases: Agent Agent for the ReAct chain. 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 all...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActDocstoreAgent.html
ed53b2acb4f9-1
Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep co...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActDocstoreAgent.html
ed53b2acb4f9-2
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActDocstoreAgent.html
ed53b2acb4f9-3
classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ property llm_prefix: str¶ Prefix to append the LLM call with. property observation_prefix: str¶ Prefix to append the observation with. property...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActDocstoreAgent.html
25cecfb6b0c3-0
langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent¶ class langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent[source]¶ Bases: Agent Agent for the self-ask-with-search paper. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input d...
https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent.html
25cecfb6b0c3-1
Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep co...
https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent.html
25cecfb6b0c3-2
Generate a JSON representation of the model, include and exclude arguments as per dict(). encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps(). classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol...
https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent.html
25cecfb6b0c3-3
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ tool_run_logging_kwargs() → Dict¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate...
https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent.html
2a061b3031ee-0
langchain.agents.agent.ExceptionTool¶ class langchain.agents.agent.ExceptionTool[source]¶ Bases: BaseTool Tool that just returns the query. 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: ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.ExceptionTool.html
2a061b3031ee-1
param verbose: bool = False¶ Whether to log the tool’s progress. __call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str¶ Make tool callable. async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, max_concurre...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.ExceptionTool.html
2a061b3031ee-2
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.ExceptionTool.html
2a061b3031ee-3
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.ExceptionTool.html
2a061b3031ee-4
stream(input: Input, config: Optional[RunnableConfig] = None) → Iterator[Output]¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema....
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.ExceptionTool.html
867b299c70f2-0
langchain.agents.conversational.output_parser.ConvoOutputParser¶ class langchain.agents.conversational.output_parser.ConvoOutputParser[source]¶ Bases: AgentOutputParser Output parser for the conversational agent. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if t...
https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html
867b299c70f2-1
bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no othe...
https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html
867b299c70f2-2
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal...
https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html
867b299c70f2-3
Parse the output of an LLM call with the input prompt for context. The prompt is largely provided in the event the OutputParser wants to retry or fix the output in some way, and needs information from the prompt to do so. Parameters completion – String output of a language model. prompt – Input PromptValue. Returns Str...
https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html
867b299c70f2-4
Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable.
https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html
46dbdc0d5bad-0
langchain.agents.utils.validate_tools_single_input¶ langchain.agents.utils.validate_tools_single_input(class_name: str, tools: Sequence[BaseTool]) → None[source]¶ Validate tools for single input.
https://api.python.langchain.com/en/latest/agents/langchain.agents.utils.validate_tools_single_input.html
b4be35bfa727-0
langchain.agents.agent_toolkits.nla.tool.NLATool¶ class langchain.agents.agent_toolkits.nla.tool.NLATool[source]¶ Bases: Tool Natural Language API Tool. Initialize tool. param args_schema: Optional[Type[BaseModel]] = None¶ Pydantic model class to validate and parse the tool’s input arguments. param callback_manager: Op...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
b4be35bfa727-1
Optional list of tags associated with the tool. Defaults to None These tags will be associated with each call to this tool, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a tool with its use case. param verbose: bool = False¶ Whether to log the tool...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
b4be35bfa727-2
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclu...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
b4be35bfa727-3
Initialize tool from a function. classmethod from_llm_and_method(llm: BaseLanguageModel, path: str, method: str, spec: OpenAPISpec, requests: Optional[Requests] = None, verbose: bool = False, return_intermediate_steps: bool = False, **kwargs: Any) → NLATool[source]¶ Instantiate the tool from the specified path and meth...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
b4be35bfa727-4
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ run(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Op...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
3dd513730c06-0
langchain.agents.agent.AgentExecutor¶ class langchain.agents.agent.AgentExecutor[source]¶ Bases: Chain Agent that is using tools. 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 agent: Union[BaseSingle...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html
3dd513730c06-1
If a callable function, the function will be called with the exception as an argument, and the result of that function will be passed to the agentas an observation. param max_execution_time: Optional[float] = None¶ The maximum amount of wall clock time to spend in the execution loop. param max_iterations: Optional[int]...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html
3dd513730c06-2
The valid tools the agent can call. param trim_intermediate_steps: Union[int, Callable[[List[Tuple[AgentAction, str]]], List[Tuple[AgentAction, str]]]] = -1¶ param verbose: bool [Optional]¶ Whether or not run in verbose mode. In verbose mode, some intermediate logs will be printed to the console. Defaults to langchain....
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html
3dd513730c06-3
to False. Returns A dict of named outputs. Should contain all outputs specified inChain.output_keys. async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, max_concurrency: Optional[int] = None) → List[Output]¶ async acall(inputs: Union[Dict[str, Any], Any], return_on...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html
3dd513730c06-4
Returns A dict of named outputs. Should contain all outputs specified inChain.output_keys. async ainvoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None) → Dict[str, Any]¶ apply(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → List[Dic...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html
3dd513730c06-5
# -> "The temperature in Boise is..." # Suppose we have a multi-input chain that takes a 'question' string # and 'context' string: question = "What's the temperature in Boise, Idaho?" context = "Weather report for Boise, Idaho on 07/03/23..." await chain.arun(question=question, context=context) # -> "The temperature in...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html
3dd513730c06-6
the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(**kwargs: Any) → Dict¶ Dictionary representation of chain. Expects Chain._chain_type property to be implemented and for memory to benull. Parameters **kwargs – Keyword arguments passed to defaul...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html
3dd513730c06-7
Generate a JSON representation of the model, include and exclude arguments as per dict(). encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps(). lookup_tool(name: str) → BaseTool[source]¶ Lookup tool by name. classmethod parse_file(path: Union[str, Path], *, content_t...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html
3dd513730c06-8
Returns A dict of the final chain outputs. run(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any¶ Convenience method for executing chain. The main difference between this method...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html
3dd513730c06-9
save(file_path: Union[Path, str]) → None[source]¶ Raise error - saving not supported for Agent Executors. save_agent(file_path: Union[Path, str]) → None[source]¶ Save the underlying agent. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*,...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html
3dd513730c06-10
property lc_serializable: bool¶ Return whether or not the class is serializable. Examples using AgentExecutor¶ Jina PowerBI Dataset Agent SQL Database Agent JSON Agent BabyAGI with Tools Plug-and-Plai Wikibase Agent SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base Custom Agent with PlugIn Retrieval ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html
74b2c646f85f-0
langchain.agents.agent.BaseSingleActionAgent¶ class langchain.agents.agent.BaseSingleActionAgent[source]¶ Bases: BaseModel Base Single Action Agent class. 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. abst...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseSingleActionAgent.html
74b2c646f85f-1
the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(**kwargs: Any) → Dict[source]¶ Return dictionary representation of agent. classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbac...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseSingleActionAgent.html
74b2c646f85f-2
abstract plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish][source]¶ Given input, decided what to do. Parameters intermediate_steps – Steps the LLM has taken to date, along with obser...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseSingleActionAgent.html
9c01371aed57-0
langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent¶ class langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent[source]¶ Bases: BaseSingleActionAgent An Agent driven by OpenAIs function powered API. Parameters llm – This should be an instance of ChatOpenAI, specifically a model that supports ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent.html
9c01371aed57-1
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent.html
9c01371aed57-2
Construct an agent from an LLM and tools. classmethod from_orm(obj: Any) → Model¶ get_allowed_tools() → List[str][source]¶ Get allowed tools. json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_d...
https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent.html