id stringlengths 14 15 | text stringlengths 13 2.7k | source stringlengths 60 181 |
|---|---|---|
93ea19934cae-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.AgentOutputParser.html |
93ea19934cae-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.AgentOutputParser.html |
93ea19934cae-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.AgentOutputParser.html |
93ea19934cae-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.AgentOutputParser.html |
93ea19934cae-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.AgentOutputParser.html |
93ea19934cae-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.AgentOutputParser.html |
93ea19934cae-9 | property output_schema: Type[pydantic.main.BaseModel]¶
The type of output this runnable produces specified as a pydantic model.
Examples using AgentOutputParser¶
Plug-and-Plai
Wikibase Agent
SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base
Custom Agent with PlugIn Retrieval
Custom agent with tool re... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentOutputParser.html |
e4e485aa3b51-0 | langchain_experimental.agents.agent_toolkits.csv.base.create_csv_agent¶
langchain_experimental.agents.agent_toolkits.csv.base.create_csv_agent(llm: BaseLanguageModel, path: Union[str, IOBase, List[Union[str, IOBase]]], pandas_kwargs: Optional[dict] = None, **kwargs: Any) → AgentExecutor[source]¶
Create csv agent by loa... | https://api.python.langchain.com/en/latest/agents/langchain_experimental.agents.agent_toolkits.csv.base.create_csv_agent.html |
0098f66def1b-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 |
0098f66def1b-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 |
0098f66def1b-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 |
eb701a2654ae-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 |
eb701a2654ae-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 |
eb701a2654ae-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 |
eb701a2654ae-3 | **kwargs – User inputs.
Returns
Action specifying what tool to use.
return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → AgentFinish[source]¶
Return response when agent has been stopped due to max iterations.
save(file_path: Union[Path, str]) → None¶
Sa... | https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent.html |
7eef12f403ee-0 | langchain.agents.format_scratchpad.openai_functions.format_to_openai_functions¶
langchain.agents.format_scratchpad.openai_functions.format_to_openai_functions(intermediate_steps: Sequence[Tuple[AgentAction, str]]) → List[BaseMessage]¶
Convert (AgentAction, tool output) tuples into FunctionMessages.
Parameters
intermedi... | https://api.python.langchain.com/en/latest/agents/langchain.agents.format_scratchpad.openai_functions.format_to_openai_functions.html |
c4307fdff0c1-0 | langchain.agents.output_parsers.openai_tools.OpenAIToolsAgentOutputParser¶
class langchain.agents.output_parsers.openai_tools.OpenAIToolsAgentOutputParser[source]¶
Bases: MultiActionAgentOutputParser
Parses a message into agent actions/finish.
Is meant to be used with OpenAI models, as it relies on the specific
tool_ca... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_tools.OpenAIToolsAgentOutputParser.html |
c4307fdff0c1-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_tools.OpenAIToolsAgentOutputParser.html |
c4307fdff0c1-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_tools.OpenAIToolsAgentOutputParser.html |
c4307fdff0c1-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_tools.OpenAIToolsAgentOutputParser.html |
c4307fdff0c1-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_tools.OpenAIToolsAgentOutputParser.html |
c4307fdff0c1-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_tools.OpenAIToolsAgentOutputParser.html |
c4307fdff0c1-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[List[AgentAction], AgentFinish][source]¶... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.openai_tools.OpenAIToolsAgentOutputParser.html |
c4307fdff0c1-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_tools.OpenAIToolsAgentOutputParser.html |
c4307fdff0c1-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_tools.OpenAIToolsAgentOutputParser.html |
c4307fdff0c1-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_tools.OpenAIToolsAgentOutputParser.html |
2aeef8378509-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 |
27b834fbcef7-0 | langchain.agents.mrkl.output_parser.MRKLOutputParser¶
class langchain.agents.mrkl.output_parser.MRKLOutputParser[source]¶
Bases: AgentOutputParser
MRKL Output parser for the chat agent.
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = F... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.output_parser.MRKLOutputParser.html |
27b834fbcef7-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.mrkl.output_parser.MRKLOutputParser.html |
27b834fbcef7-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.mrkl.output_parser.MRKLOutputParser.html |
27b834fbcef7-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.mrkl.output_parser.MRKLOutputParser.html |
27b834fbcef7-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.mrkl.output_parser.MRKLOutputParser.html |
27b834fbcef7-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.mrkl.output_parser.MRKLOutputParser.html |
27b834fbcef7-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.mrkl.output_parser.MRKLOutputParser.html |
27b834fbcef7-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.mrkl.output_parser.MRKLOutputParser.html |
27b834fbcef7-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.mrkl.output_parser.MRKLOutputParser.html |
27b834fbcef7-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.mrkl.output_parser.MRKLOutputParser.html |
b45df70c109a-0 | langchain.agents.conversational.base.ConversationalAgent¶
class langchain.agents.conversational.base.ConversationalAgent[source]¶
Bases: Agent
An agent that holds a conversation in addition to using tools.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the inpu... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
b45df70c109a-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.conversational.base.ConversationalAgent.html |
b45df70c109a-2 | classmethod create_prompt(tools: Sequence[BaseTool], prefix: str = 'Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
b45df70c109a-3 | say to the Human, or if you do not need to use a tool, you MUST use the format:\n\n```\nThought: Do I need to use a tool? No\n{ai_prefix}: [your response here]\n```', ai_prefix: str = 'AI', human_prefix: str = 'Human', input_variables: Optional[List[str]] = None) → PromptTemplate[source]¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
b45df70c109a-4 | Create prompt in the style of the zero-shot agent.
Parameters
tools – List of tools the agent will have access to, used to format the
prompt.
prefix – String to put before the list of tools.
suffix – String to put after the list of tools.
ai_prefix – String to use before AI output.
human_prefix – String to use before h... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
b45df70c109a-5 | classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, prefix: str = 'Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide ran... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
b45df70c109a-6 | Input: the input to the action\nObservation: the result of the action\n```\n\nWhen you have a response to say to the Human, or if you do not need to use a tool, you MUST use the format:\n\n```\nThought: Do I need to use a tool? No\n{ai_prefix}: [your response here]\n```', ai_prefix: str = 'AI', human_prefix: str = 'Hum... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
b45df70c109a-7 | Construct an agent from an LLM and tools.
classmethod from_orm(obj: Any) → Model¶
get_allowed_tools() → Optional[List[str]]¶
get_full_inputs(intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → Dict[str, Any]¶
Create the full inputs for the LLMChain from intermediate steps.
json(*, include: Optional[Unio... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
b45df70c109a-8 | Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use.
return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → AgentFinish¶
... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
7d25a0cd0748-0 | langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser¶
class langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser[source]¶
Bases: AgentOutputParser
Parses ReAct-style LLM calls that have a single tool input in json format.
Expects output to be in on... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser.html |
7d25a0cd0748-1 | Default implementation of ainvoke, calls invoke from a thread.
The default implementation allows usage of async code even if
the runnable did not implement a native async version of invoke.
Subclasses should override this method if they can run asynchronously.
async aparse(text: str) → T¶
Parse a single string model ou... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser.html |
7d25a0cd0748-2 | 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.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser.html |
7d25a0cd0748-3 | 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.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser.html |
7d25a0cd0748-4 | 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.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser.html |
7d25a0cd0748-5 | Parameters
config – A config to use when generating the schema.
Returns
A pydantic model that can be used to validate output.
invoke(input: Union[str, BaseMessage], config: Optional[RunnableConfig] = None) → T¶
Transform a single input into an output. Override to implement.
Parameters
input – The input to the runnable.... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser.html |
7d25a0cd0748-6 | by calling invoke() with each input.
parse(text: str) → Union[AgentAction, AgentFinish][source]¶
Parse text into agent action/finish.
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser.html |
7d25a0cd0748-7 | stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶
Default implementation of stream, which calls invoke.
Subclasses should override this method if they support streaming output.
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implem... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser.html |
7d25a0cd0748-8 | Bind lifecycle listeners to a Runnable, returning a new Runnable.
on_start: Called before the runnable starts running, with the Run object.
on_end: Called after the runnable finishes running, with the Run object.
on_error: Called if the runnable throws an error, with the Run object.
The Run object contains information ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser.html |
7d25a0cd0748-9 | The type of input this runnable accepts specified as a pydantic model.
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... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser.html |
b5f8b5c8eb0f-0 | langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent¶
class langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent[source]¶
Bases: BaseMultiActionAgent
An Agent driven by OpenAIs function powered API.
Parameters
llm – This should be an instance of ChatOpenAI, specifically a... | https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent.html |
b5f8b5c8eb0f-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_multi_agent.base.OpenAIMultiFunctionsAgent.html |
b5f8b5c8eb0f-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_multi_agent.base.OpenAIMultiFunctionsAgent.html |
b5f8b5c8eb0f-3 | **kwargs – User inputs.
Returns
Action specifying what tool to use.
return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → AgentFinish¶
Return response when agent has been stopped due to max iterations.
save(file_path: Union[Path, str]) → None¶
Save the a... | https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent.html |
a9981cf5d814-0 | langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser¶
class langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser[source]¶
Bases: AgentOutputParser
Parses ReAct-style LLM calls that have a single tool input.
Expects output to be in one of two formats.
If the output s... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser.html |
a9981cf5d814-1 | 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 list of candidate model Generations into a specific format.
The return value is parsed from only th... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser.html |
a9981cf5d814-2 | 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 current state.
with_streamed_output_list – Whether to yield the streamed_output list.
include_names – Only incl... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser.html |
a9981cf5d814-3 | 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_alternatives(which: ConfigurableField, *, default_key: str = 'default', prefix_keys: bool = False, **kwargs: Union[Runnable[Input, Outp... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser.html |
a9981cf5d814-4 | Return dictionary representation of output parser.
classmethod from_orm(obj: Any) → Model¶
get_format_instructions() → str[source]¶
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... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser.html |
a9981cf5d814-5 | config – A config to use when invoking the runnable.
The config supports standard keys like ‘tags’, ‘metadata’ for tracing
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_... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser.html |
a9981cf5d814-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) → T¶
Parse a list of candidate model Generations... | https://api.python.langchain.com/en/latest/agents/langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser.html |
a9981cf5d814-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.react_single_input.ReActSingleInputOutputParser.html |
a9981cf5d814-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.react_single_input.ReActSingleInputOutputParser.html |
a9981cf5d814-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.react_single_input.ReActSingleInputOutputParser.html |
842ebd4061fe-0 | langchain.agents.conversational.output_parser.ConvoOutputParser¶
class langchain.agents.conversational.output_parser.ConvoOutputParser[source]¶
Bases: AgentOutputParser
Output parser for the conversational agent.
param ai_prefix: str = 'AI'¶
Prefix to use before AI output.
async abatch(inputs: List[Input], config: Opti... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
842ebd4061fe-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.conversational.output_parser.ConvoOutputParser.html |
842ebd4061fe-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.conversational.output_parser.ConvoOutputParser.html |
842ebd4061fe-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.conversational.output_parser.ConvoOutputParser.html |
842ebd4061fe-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.conversational.output_parser.ConvoOutputParser.html |
842ebd4061fe-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.conversational.output_parser.ConvoOutputParser.html |
842ebd4061fe-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.conversational.output_parser.ConvoOutputParser.html |
842ebd4061fe-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.conversational.output_parser.ConvoOutputParser.html |
842ebd4061fe-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.conversational.output_parser.ConvoOutputParser.html |
842ebd4061fe-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.conversational.output_parser.ConvoOutputParser.html |
094daca590eb-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 |
094daca590eb-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 |
094daca590eb-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 |
30e18178dc3b-0 | langchain.agents.mrkl.base.MRKLChain¶
class langchain.agents.mrkl.base.MRKLChain[source]¶
Bases: AgentExecutor
[Deprecated] Chain that implements the MRKL system.
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 mod... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
30e18178dc3b-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.mrkl.base.MRKLChain.html |
30e18178dc3b-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 the global... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
30e18178dc3b-3 | 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 abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwar... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
30e18178dc3b-4 | 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.
metadata – Optional metadata associated with the chain. Defaults to None
include_run_info – Whether to include run ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
30e18178dc3b-5 | addition to callbacks passed to the chain during construction, but only
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 c... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
30e18178dc3b-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.mrkl.base.MRKLChain.html |
30e18178dc3b-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.mrkl.base.MRKLChain.html |
30e18178dc3b-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.mrkl.base.MRKLChain.html |
30e18178dc3b-9 | Runnables that leverage the configurable_fields and configurable_alternatives
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.... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
30e18178dc3b-10 | classmethod is_lc_serializable() → bool¶
Is this class serializable?
iter(inputs: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, include_run_info: bool = False, async_: bool = False) → AgentExecutorIterator¶
Enables iteration over steps taken to reach final output.
json(*, in... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
30e18178dc3b-11 | 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¶
prep_inputs(inputs: Union[Dict[str, Any], Any]) → Dict[str, str]¶
Validate and prepare chain inputs, including ad... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
30e18178dc3b-12 | sole positional argument.
callbacks – Callbacks to use for this chain run. These will be called in
addition to callbacks passed to the chain during construction, but only
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
additi... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
30e18178dc3b-13 | Enables streaming over steps taken to reach final output.
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
transform(input: Iterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶
Default implementati... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
30e18178dc3b-14 | on_end: Called after the runnable finishes running, with the Run object.
on_error: Called if the runnable throws an error, with the Run object.
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(*, ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
30e18178dc3b-15 | 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”}
property output_schema: T... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
6f9f94112dd2-0 | langchain.agents.agent.LLMSingleActionAgent¶
class langchain.agents.agent.LLMSingleActionAgent[source]¶
Bases: BaseSingleActionAgent
Base class for single action agents.
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 va... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.LLMSingleActionAgent.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.