id
stringlengths
14
15
text
stringlengths
13
2.7k
source
stringlengths
60
181
6f9f94112dd2-1
Duplicate a model, optionally choose which fields to include, exclude and change. 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 creat...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.LLMSingleActionAgent.html
6f9f94112dd2-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¶ plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], Base...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.LLMSingleActionAgent.html
6f9f94112dd2-3
property input_keys: List[str]¶ Return the input keys. Returns List of input keys. property return_values: List[str]¶ Return values of the agent. Examples using LLMSingleActionAgent¶ Plug-and-Plai Wikibase Agent SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base Custom Agent with PlugIn Retrieval Cust...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.LLMSingleActionAgent.html
72d69aa1ff81-0
langchain.agents.mrkl.base.ChainConfig¶ class langchain.agents.mrkl.base.ChainConfig(action_name: str, action: Callable, action_description: str)[source]¶ Configuration for chain to use in MRKL system. Parameters action_name – Name of the action. action – Action function to call. action_description – Description of the...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ChainConfig.html
704a3206be7d-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
704a3206be7d-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
704a3206be7d-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
704a3206be7d-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
2b4d661e64a8-0
langchain.agents.xml.base.XMLAgent¶ class langchain.agents.xml.base.XMLAgent[source]¶ Bases: BaseSingleActionAgent Agent that uses XML tags. Parameters tools – list of tools the agent can choose from llm_chain – The LLMChain to call to predict the next action Examples from langchain.agents import XMLAgent from langchai...
https://api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgent.html
2b4d661e64a8-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.xml.base.XMLAgent.html
2b4d661e64a8-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.xml.base.XMLAgent.html
2b4d661e64a8-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.xml.base.XMLAgent.html
51c6b7e43220-0
langchain.agents.openai_functions_agent.agent_token_buffer_memory.AgentTokenBufferMemory¶ class langchain.agents.openai_functions_agent.agent_token_buffer_memory.AgentTokenBufferMemory[source]¶ Bases: BaseChatMemory Memory used to save agent output AND intermediate steps. Create a new model by parsing and validating in...
https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.agent_token_buffer_memory.AgentTokenBufferMemory.html
51c6b7e43220-1
Duplicate a model, optionally choose which fields to include, exclude and change. 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 creat...
https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.agent_token_buffer_memory.AgentTokenBufferMemory.html
51c6b7e43220-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 lc_id() → List[str]¶ A unique identifier for this class for serialization purposes. The unique identifier is a ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.agent_token_buffer_memory.AgentTokenBufferMemory.html
51c6b7e43220-3
String buffer of memory. property lc_attributes: Dict¶ List of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_secrets: Dict[str, str]¶ A map of constructor argument names to secret ids. For example,{“openai_api_key”: “OPENAI_API_KEY”} ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.agent_token_buffer_memory.AgentTokenBufferMemory.html
e1a52410ef62-0
langchain.agents.initialize.initialize_agent¶ langchain.agents.initialize.initialize_agent(tools: Sequence[BaseTool], llm: BaseLanguageModel, agent: Optional[AgentType] = None, callback_manager: Optional[BaseCallbackManager] = None, agent_path: Optional[str] = None, agent_kwargs: Optional[dict] = None, *, tags: Optiona...
https://api.python.langchain.com/en/latest/agents/langchain.agents.initialize.initialize_agent.html
e1a52410ef62-1
Portkey Jira Document Comparison Azure Cognitive Services Natural Language APIs Gmail Github Google Drive tool AINetwork PlayWright Browser Office365 MultiOn Amadeus Gitlab Bittensor Amazon API Gateway Debugging LangSmith Walkthrough Hugging Face Prompt Injection Identification Comparing Chain Outputs Agent Trajectory ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.initialize.initialize_agent.html
d6645ebefcdd-0
langchain.agents.agent.MultiActionAgentOutputParser¶ class langchain.agents.agent.MultiActionAgentOutputParser[source]¶ Bases: BaseOutputParser[Union[List[AgentAction], AgentFinish]] Base class for parsing agent output into agent actions/finish. async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, L...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.MultiActionAgentOutputParser.html
d6645ebefcdd-1
to be different candidate outputs for a single model input. Returns Structured output. async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support str...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.MultiActionAgentOutputParser.html
d6645ebefcdd-2
exclude_names – Exclude logs with these names. exclude_types – Exclude logs with these types. exclude_tags – Exclude logs with these tags. async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of atransform, which ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.MultiActionAgentOutputParser.html
d6645ebefcdd-3
configurable_fields(**kwargs: Union[ConfigurableField, ConfigurableFieldSingleOption, ConfigurableFieldMultiOption]) → RunnableSerializable[Input, Output]¶ classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ from trusted or pre-vali...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.MultiActionAgentOutputParser.html
d6645ebefcdd-4
methods will have a dynamic input schema that depends on which configuration the runnable is invoked with. This method allows to get an input schema for a specific configuration. Parameters config – A config to use when generating the schema. Returns A pydantic model that can be used to validate input. classmethod get_...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.MultiActionAgentOutputParser.html
d6645ebefcdd-5
classmethod is_lc_serializable() → bool¶ Is this class serializable? 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_defa...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.MultiActionAgentOutputParser.html
d6645ebefcdd-6
parse_result(result: List[Generation], *, partial: bool = False) → T¶ Parse a list of candidate model Generations into a specific format. The return value is parsed from only the first Generation in the result, whichis assumed to be the highest-likelihood Generation. Parameters result – A list of Generations to be pars...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.MultiActionAgentOutputParser.html
d6645ebefcdd-7
input is still being generated. 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_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶ Bind config to a...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.MultiActionAgentOutputParser.html
d6645ebefcdd-8
added to the run. with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_after_attempt: int = 3) → Runnable[Input, Output]¶ Create a new Runnable that retries the original runnable on exceptions. Parameters retry_if_exc...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.MultiActionAgentOutputParser.html
d6645ebefcdd-9
property output_schema: Type[pydantic.main.BaseModel]¶ The type of output this runnable produces specified as a pydantic model.
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.MultiActionAgentOutputParser.html
6d8405b7c42b-0
langchain.agents.openai_assistant.base.OpenAIAssistantFinish¶ class langchain.agents.openai_assistant.base.OpenAIAssistantFinish[source]¶ Bases: AgentFinish AgentFinish with run and thread metadata. Override init to support instantiation by position for backward compat. param log: str [Required]¶ Additional information...
https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantFinish.html
6d8405b7c42b-1
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 copy of the model Returns new model instance dict(*, i...
https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantFinish.html
6d8405b7c42b-2
A unique identifier for this class for serialization purposes. The unique identifier is a list of strings that describes the path to the object. classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classm...
https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantFinish.html
3db2fa868f73-0
langchain.agents.mrkl.base.ZeroShotAgent¶ class langchain.agents.mrkl.base.ZeroShotAgent[source]¶ Bases: Agent Agent for the MRKL 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 allowed_tools: O...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html
3db2fa868f73-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.mrkl.base.ZeroShotAgent.html
3db2fa868f73-2
dict(**kwargs: Any) → Dict¶ Return dictionary representation of agent. classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, prefix: str = 'Answer the following questions as best you ca...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html
3db2fa868f73-3
Create the full inputs for the LLMChain from intermediate steps. 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...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html
3db2fa868f73-4
Return response when agent has been stopped due to max iterations. save(file_path: Union[Path, str]) → None¶ Save the agent. Parameters file_path – Path to file to save the agent to. Example: .. code-block:: python # If working with agent executor agent.agent.save(file_path=”path/agent.yaml”) classmethod schema(by_alia...
https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html
c74f2dd4eade-0
langchain.agents.format_scratchpad.log_to_messages.format_log_to_messages¶ langchain.agents.format_scratchpad.log_to_messages.format_log_to_messages(intermediate_steps: List[Tuple[AgentAction, str]], template_tool_response: str = '{observation}') → List[BaseMessage][source]¶ Construct the scratchpad that lets the agent...
https://api.python.langchain.com/en/latest/agents/langchain.agents.format_scratchpad.log_to_messages.format_log_to_messages.html
fb77fae3a989-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
fb77fae3a989-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
fb77fae3a989-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
fb77fae3a989-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
b22f20d9018e-0
langchain_experimental.agents.agent_toolkits.xorbits.base.create_xorbits_agent¶ langchain_experimental.agents.agent_toolkits.xorbits.base.create_xorbits_agent(llm: BaseLLM, data: Any, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = '', suffix: str = '', input_variables: Optional[List[str]] = None,...
https://api.python.langchain.com/en/latest/agents/langchain_experimental.agents.agent_toolkits.xorbits.base.create_xorbits_agent.html
ebfde1e1e421-0
langchain.agents.react.base.ReActChain¶ class langchain.agents.react.base.ReActChain[source]¶ Bases: AgentExecutor [Deprecated] Chain that implements the ReAct paper. Initialize with the LLM and a docstore. param agent: Union[BaseSingleActionAgent, BaseMultiActionAgent] [Required]¶ The agent to run for creating a plan ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-1
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] = 15¶ The maximum number of steps to take before ending the execution loop. Setting to ‘None’ could lead to an infinite loop. param memory: Optional[BaseMemory] = N...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-2
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 the global verbose value, accessible via langchain.globals.get_verbose(). __call__(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Opt...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-3
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, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶ Default implementation runs ainvoke in parallel ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-4
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.react.base.ReActChain.html
ebfde1e1e421-5
these runtime callbacks will propagate to calls to other objects. tags – List of string tags to pass to all callbacks. These will be passed in addition to tags passed to the chain during construction, but only these runtime tags will propagate to calls to other objects. **kwargs – If the chain expects multiple inputs, ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-6
Stream all output from a runnable, as reported to the callback system. This includes all inner runs of LLMs, Retrievers, Tools, etc. Output is streamed as Log objects, which include a list of jsonpatch ops that describe how the state of the run has changed in each step, and the final state of the run. The jsonpatch ops...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-7
bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. config_schema(*, include: Optional[Sequence[str]] = None) → Type[BaseModel]¶ The type of config this runnable accepts specified as a pydantic model. To mark a field as configurable, see the configurable_fields and con...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-8
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 copy of the model Returns new model instance dict(**kw...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-9
For example, if the class is langchain.llms.openai.OpenAI, then the namespace is [“langchain”, “llms”, “openai”] get_output_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶ Get a pydantic model that can be used to validate output to the runnable. Runnables that leverage the configurable_fields and con...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-10
Enables iteration over steps taken to reach final output. 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 ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-11
Validate and prepare chain inputs, including adding inputs from memory. Parameters inputs – Dictionary of raw inputs, or single input if chain expects only one param. Should contain all inputs specified in Chain.input_keys except for inputs that will be set by the chain’s memory. Returns A dictionary of all inputs, inc...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-12
addition to tags passed to the chain during construction, but only these runtime tags will propagate to calls to other objects. **kwargs – If the chain expects multiple inputs, they can be passed in directly as keyword arguments. Returns The chain output. Example # Suppose we have a single-input chain that takes a 'que...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-13
Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing output while input is still being generated. classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and lo...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-14
added to the run. with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_after_attempt: int = 3) → Runnable[Input, Output]¶ Create a new Runnable that retries the original runnable on exceptions. Parameters retry_if_exc...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
ebfde1e1e421-15
property output_schema: Type[pydantic.main.BaseModel]¶ The type of output this runnable produces specified as a pydantic model.
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html
8a70bd68d5c1-0
langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit¶ class langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit[source]¶ Bases: BaseToolkit Toolkit for interacting with a Vector Store. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationE...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit.html
8a70bd68d5c1-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.VectorStoreToolkit.html
8a70bd68d5c1-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.vectorstore.toolkit.VectorStoreToolkit.html
fdac36273b30-0
langchain.agents.agent_toolkits.conversational_retrieval.openai_functions.create_conversational_retrieval_agent¶ langchain.agents.agent_toolkits.conversational_retrieval.openai_functions.create_conversational_retrieval_agent(llm: BaseLanguageModel, tools: List[BaseTool], remember_intermediate_steps: bool = True, memory...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.conversational_retrieval.openai_functions.create_conversational_retrieval_agent.html
1b72d2b96823-0
langchain.agents.tools.InvalidTool¶ class langchain.agents.tools.InvalidTool[source]¶ Bases: BaseTool Tool that is run when invalid tool name is encountered by agent. 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...
https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html
1b72d2b96823-1
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’s progress. __call__(tool_input: str, callbacks: Optional[Union[...
https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html
1b72d2b96823-2
Run the tool asynchronously. async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optio...
https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html
1b72d2b96823-3
exclude_types – Exclude logs with these types. exclude_tags – Exclude logs with these tags. async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of atransform, which buffers input and calls astream. Subclasses sho...
https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html
1b72d2b96823-4
configurable_fields(**kwargs: Union[ConfigurableField, ConfigurableFieldSingleOption, ConfigurableFieldMultiOption]) → RunnableSerializable[Input, Output]¶ classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ from trusted or pre-vali...
https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html
1b72d2b96823-5
classmethod from_orm(obj: Any) → Model¶ get_input_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶ The tool’s input schema. classmethod get_lc_namespace() → List[str]¶ Get the namespace of the langchain object. For example, if the class is langchain.llms.openai.OpenAI, then the namespace is [“langchai...
https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html
1b72d2b96823-6
classmethod is_lc_serializable() → bool¶ Is this class serializable? 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_defa...
https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html
1b72d2b96823-7
run(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, run_name: Optional[st...
https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html
1b72d2b96823-8
Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: Sequence[Runnable[Input, Output]], *, exceptions_to_handle: Tuple[Type[BaseException], ...] = (<class 'Exception'>,)) → RunnableWithFallbacksT[Input, Output]¶ Add fallbacks to a runnable, returning a new Runnable. Parameters fallbacks – A se...
https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html
1b72d2b96823-9
between retries stop_after_attempt – The maximum number of attempts to make before giving up Returns A new Runnable that retries the original runnable on exceptions. with_types(*, input_type: Optional[Type[Input]] = None, output_type: Optional[Type[Output]] = None) → Runnable[Input, Output]¶ Bind input and output types...
https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html
0c06f099e465-0
langchain.agents.chat.output_parser.ChatOutputParser¶ class langchain.agents.chat.output_parser.ChatOutputParser[source]¶ Bases: AgentOutputParser Output parser for the chat agent. param pattern = re.compile('^.*?`{3}(?:json)?\\n(.*?)`{3}.*?$', re.DOTALL)¶ Regex pattern to parse the output. async abatch(inputs: List[In...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
0c06f099e465-1
Parameters result – A list of Generations to be parsed. The Generations are assumed to be different candidate outputs for a single model input. Returns Structured output. async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astr...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
0c06f099e465-2
include_tags – Only include logs with these tags. exclude_names – Exclude logs with these names. exclude_types – Exclude logs with these types. exclude_tags – Exclude logs with these tags. async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Out...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
0c06f099e465-3
configurable_fields(**kwargs: Union[ConfigurableField, ConfigurableFieldSingleOption, ConfigurableFieldMultiOption]) → RunnableSerializable[Input, Output]¶ classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ from trusted or pre-vali...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
0c06f099e465-4
methods will have a dynamic input schema that depends on which configuration the runnable is invoked with. This method allows to get an input schema for a specific configuration. Parameters config – A config to use when generating the schema. Returns A pydantic model that can be used to validate input. classmethod get_...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
0c06f099e465-5
classmethod is_lc_serializable() → bool¶ Is this class serializable? 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_defa...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
0c06f099e465-6
parse_result(result: List[Generation], *, partial: bool = False) → T¶ Parse a list of candidate model Generations into a specific format. The return value is parsed from only the first Generation in the result, whichis assumed to be the highest-likelihood Generation. Parameters result – A list of Generations to be pars...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
0c06f099e465-7
input is still being generated. 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_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶ Bind config to a...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
0c06f099e465-8
added to the run. with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_after_attempt: int = 3) → Runnable[Input, Output]¶ Create a new Runnable that retries the original runnable on exceptions. Parameters retry_if_exc...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
0c06f099e465-9
property output_schema: Type[pydantic.main.BaseModel]¶ The type of output this runnable produces specified as a pydantic model.
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
ca18d8c6a606-0
langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit¶ class langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit[source]¶ Bases: BaseToolkit Toolkit for routing between Vector Stores. Create a new model by parsing and validating input data from keyword arguments. Raises V...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit.html
ca18d8c6a606-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.VectorStoreRouterToolkit.html
ca18d8c6a606-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.vectorstore.toolkit.VectorStoreRouterToolkit.html
22a2cbe94c00-0
langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser¶ class langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser[source]¶ Bases: AgentOutputParser Parses a message into agent action/finish. Is meant to be used with OpenAI models, as it relies on the specific fun...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser.html
22a2cbe94c00-1
Parse a list of candidate model Generations into a specific format. The return value is parsed from only the first Generation in the result, whichis assumed to be the highest-likelihood Generation. Parameters result – A list of Generations to be parsed. The Generations are assumed to be different candidate outputs for ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser.html
22a2cbe94c00-2
with_streamed_output_list – Whether to yield the streamed_output list. include_names – Only include logs with these names. include_types – Only include logs with these types. include_tags – Only include logs with these tags. exclude_names – Exclude logs with these names. exclude_types – Exclude logs with these types. e...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser.html
22a2cbe94c00-3
Returns A pydantic model that can be used to validate config. configurable_alternatives(which: ConfigurableField, *, default_key: str = 'default', prefix_keys: bool = False, **kwargs: Union[Runnable[Input, Output], Callable[[], Runnable[Input, Output]]]) → RunnableSerializable[Input, Output]¶ configurable_fields(**kwar...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser.html
22a2cbe94c00-4
get_format_instructions() → str¶ Instructions on how the LLM output should be formatted. get_input_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶ Get a pydantic model that can be used to validate input to the runnable. Runnables that leverage the configurable_fields and configurable_alternatives met...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser.html
22a2cbe94c00-5
purposes, ‘max_concurrency’ for controlling how much work to do in parallel, and other keys. Please refer to the RunnableConfig for more details. Returns The output of the runnable. classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]]...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser.html
22a2cbe94c00-6
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¶ parse_result(result: List[Generation], *, partial: bool = False) → Union[AgentAction, AgentFinish][source]¶ Parse...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser.html
22a2cbe94c00-7
to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser.html
22a2cbe94c00-8
The Run object contains information about the run, including its id, type, input, output, error, start_time, end_time, and any tags or metadata added to the run. with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_af...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser.html
22a2cbe94c00-9
A map of constructor argument names to secret ids. For example,{“openai_api_key”: “OPENAI_API_KEY”} property output_schema: Type[pydantic.main.BaseModel]¶ The type of output this runnable produces specified as a pydantic model.
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser.html
303940dad92a-0
langchain.agents.output_parsers.self_ask.SelfAskOutputParser¶ class langchain.agents.output_parsers.self_ask.SelfAskOutputParser[source]¶ Bases: AgentOutputParser Parses self-ask style LLM calls. Expects output to be in one of two formats. If the output signals that an action should be taken, should be in the below for...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.self_ask.SelfAskOutputParser.html
303940dad92a-1
Subclasses should override this method if they can run asynchronously. async aparse(text: str) → T¶ Parse a single string model output into some structure. Parameters text – String output of a language model. Returns Structured output. async aparse_result(result: List[Generation], *, partial: bool = False) → T¶ Parse a...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.self_ask.SelfAskOutputParser.html
303940dad92a-2
jsonpatch ops that describe how the state of the run has changed in each step, and the final state of the run. The jsonpatch ops can be applied in order to construct state. Parameters input – The input to the runnable. config – The config to use for the runnable. diff – Whether to yield diffs between each step, or the ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.self_ask.SelfAskOutputParser.html
303940dad92a-3
The type of config this runnable accepts specified as a pydantic model. To mark a field as configurable, see the configurable_fields and configurable_alternatives methods. Parameters include – A list of fields to include in the config schema. Returns A pydantic model that can be used to validate config. configurable_al...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.self_ask.SelfAskOutputParser.html
303940dad92a-4
deep – set to True to make a deep copy of the model Returns new model instance dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. classmethod from_orm(obj: Any) → Model¶ get_format_instructions() → str¶ Instructions on how the LLM output should be formatted. get_input_schema(config: Optional...
https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.self_ask.SelfAskOutputParser.html