id stringlengths 14 16 | text stringlengths 13 2.7k | source stringlengths 57 178 |
|---|---|---|
183b16db1561-14 | Bind input and output types to a Runnable, returning a new Runnable.
property InputType: Type[langchain.schema.runnable.utils.Input]¶
The type of input this runnable accepts specified as a type annotation.
property OutputType: Type[langchain.schema.runnable.utils.Output]¶
The type of output this runnable produces speci... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
303eb7adb75c-0 | langchain.agents.agent_types.AgentType¶
class langchain.agents.agent_types.AgentType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
An enum for agent types.
See documentation: https://python.langchain.com/docs/modules/agents/agent_types/
ZERO_SHOT_REACT_DESCRIPTION = 'zero... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
303eb7adb75c-1 | AWS Lambda
Google Drive
OpenWeatherMap
Search Tools
Eleven Labs Text2Speech
Zapier Natural Language Actions
ArXiv
Metaphor Search
GraphQL
Eden AI
Shell (bash)
Zep Memory
Xata chat memory
Dynamodb Chat Message History
LLMonitor
Argilla
Streamlit
Aim
Weights & Biases
MLflow
Flyte
WandB Tracing
ClearML
Log, Trace, and Mon... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
592ae25edead-0 | langchain.agents.openai_assistant.base.OpenAIAssistantRunnable¶
class langchain.agents.openai_assistant.base.OpenAIAssistantRunnable[source]¶
Bases: RunnableSerializable[Dict, Union[List[OpenAIAssistantAction], OpenAIAssistantFinish, List[ThreadMessage], List[RequiredActionFunctionToolCall]]]
Run an OpenAI Assistant.
E... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html |
592ae25edead-1 | from langchain.agents import AgentExecutor
from langchain.schema.agent import AgentFinish
from langchain.tools import E2BDataAnalysisTool
tools = [E2BDataAnalysisTool(api_key="...")]
agent = OpenAIAssistantRunnable.create_assistant(
name="langchain assistant e2b tool",
instructions="You are a personal math tuto... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html |
592ae25edead-2 | OpenAI assistant id.
param check_every_ms: float = 1000.0¶
Frequency with which to check run progress in ms.
param client: openai.OpenAI [Optional]¶
OpenAI client.
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Option... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html |
592ae25edead-3 | Subclasses should override this method if they support streaming output.
async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names:... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html |
592ae25edead-4 | e.g., if the underlying runnable uses an API which supports a batch mode.
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 m... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html |
592ae25edead-5 | 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
classmeth... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html |
592ae25edead-6 | 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_... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html |
592ae25edead-7 | model: Override Assistant model for this run.
tools: Override Assistant tools for this run.
run_metadata: Metadata to associate with new run.
config – Runnable config:
Returns
If self.as_agent, will returnUnion[List[OpenAIAssistantAction], OpenAIAssistantFinish]. Otherwise
will return OpenAI types
Union[List[ThreadMess... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html |
592ae25edead-8 | 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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html |
592ae25edead-9 | Add fallbacks to a runnable, returning a new Runnable.
Parameters
fallbacks – A sequence of runnables to try if the original runnable fails.
exceptions_to_handle – A tuple of exception types to handle.
Returns
A new Runnable that will try the original runnable, and then each
fallback in order, upon failures.
with_liste... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html |
592ae25edead-10 | Bind input and output types to a Runnable, returning a new Runnable.
property InputType: Type[langchain.schema.runnable.utils.Input]¶
The type of input this runnable accepts specified as a type annotation.
property OutputType: Type[langchain.schema.runnable.utils.Output]¶
The type of output this runnable produces speci... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html |
9dbdf0dc6bd0-0 | langchain.agents.agent_toolkits.ainetwork.toolkit.AINetworkToolkit¶
class langchain.agents.agent_toolkits.ainetwork.toolkit.AINetworkToolkit[source]¶
Bases: BaseToolkit
Toolkit for interacting with AINetwork Blockchain.
Security Note: This toolkit contains tools that can read and modifythe state of a service; e.g., by ... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.ainetwork.toolkit.AINetworkToolkit.html |
9dbdf0dc6bd0-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.ainetwork.toolkit.AINetworkToolkit.html |
9dbdf0dc6bd0-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.ainetwork.toolkit.AINetworkToolkit.html |
c1dd3547de99-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantFinish.html |
c1dd3547de99-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantFinish.html |
c1dd3547de99-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 ... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.openai_assistant.base.OpenAIAssistantFinish.html |
5f92459652ad-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgent.html |
5f92459652ad-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgent.html |
5f92459652ad-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgent.html |
5f92459652ad-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgent.html |
ddc4169270eb-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseMultiActionAgent.html |
ddc4169270eb-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseMultiActionAgent.html |
ddc4169270eb-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseMultiActionAgent.html |
89cc679a7702-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
89cc679a7702-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
89cc679a7702-2 | Default implementation runs invoke in parallel using a thread pool executor.
The default implementation of batch works well for IO bound runnables.
Subclasses should override this method if they can batch more efficiently;
e.g., if the underlying runnable uses an API which supports a batch mode.
bind(**kwargs: Any) → R... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
89cc679a7702-3 | 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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
89cc679a7702-4 | methods will have a dynamic output schema that depends on which
configuration the runnable is invoked with.
This method allows to get an output 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 output.
invoke(input:... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
89cc679a7702-5 | The unique identifier is a list of strings that describes the path
to the object.
map() → Runnable[List[Input], List[Output]]¶
Return a new Runnable that maps a list of inputs to a list of outputs,
by calling invoke() with each input.
parse(text: str) → Union[AgentAction, AgentFinish][source]¶
Parse text into agent act... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
89cc679a7702-6 | classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶
stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶
Default implementation of stream, which calls invoke.
Subclasses should override t... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
89cc679a7702-7 | fallback in order, upon failures.
with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶
Bind lifecycle listeners to a Runnable, returning a new Runnable.
on_start: Called before the runnable starts running, with the Run ... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
89cc679a7702-8 | The type of output this runnable produces specified as a type annotation.
property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶
List configurable fields for this runnable.
property input_schema: Type[pydantic.main.BaseModel]¶
The type of input this runnable accepts specified as a pydantic ... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
c84a43a57d39-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.conversational_retrieval.openai_functions.create_conversational_retrieval_agent.html |
9a3784cef60d-0 | langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing¶
class langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing[source]¶
Bases: BaseRequestsTool, BaseTool
Requests GET tool with LLM-instructed extraction of truncated responses.
Create a new model by parsing and validating in... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
9a3784cef60d-1 | Optional metadata associated with the tool. Defaults to None
This metadata will be associated with each call to this tool,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a tool with its use case.
param name: str = 'requests_get'¶
Tool name.
param re... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
9a3784cef60d-2 | 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 arun(tool_input: Union[str, Dict], verbose: Optional[... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
9a3784cef60d-3 | step, and the final state of the run.
The jsonpatch ops can be applied in order to construct state.
async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of atransform, which buffers input and calls astream.
Subcla... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
9a3784cef60d-4 | 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.extra = ‘allow’ was set since it adds all passed values... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
9a3784cef60d-5 | Get the namespace of the langchain object.
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 th... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
9a3784cef60d-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
9a3784cef60d-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
9a3784cef60d-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
9a3784cef60d-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
5a50fe8d6d83-0 | langchain.agents.react.base.ReActTextWorldAgent¶
class langchain.agents.react.base.ReActTextWorldAgent[source]¶
Bases: ReActDocstoreAgent
Agent for the ReAct TextWorld 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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActTextWorldAgent.html |
5a50fe8d6d83-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActTextWorldAgent.html |
5a50fe8d6d83-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActTextWorldAgent.html |
5a50fe8d6d83-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActTextWorldAgent.html |
27795fab3713-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-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]... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-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 ... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-7 | Returns
A pydantic model that can be used to validate config.
configurable_alternatives(which: ConfigurableField, default_key: str = 'default', **kwargs: Union[Runnable[Input, Output], Callable[[], Runnable[Input, Output]]]) → RunnableSerializable[Input, Output]¶
configurable_fields(**kwargs: Union[ConfigurableField, C... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-8 | method.
Returns
A dictionary representation of the chain.
Example
chain.dict(exclude_unset=True)
# -> {"_type": "foo", "verbose": False, ...}
classmethod from_agent_and_tools(agent: Union[BaseSingleActionAgent, BaseMultiActionAgent], tools: Sequence[BaseTool], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCa... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-9 | 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 configurable_alternatives
methods will have a dynamic output schema tha... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-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 ... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27795fab3713-15 | property output_schema: Type[pydantic.main.BaseModel]¶
The type of output this runnable produces specified as a pydantic model. | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
27a131c2555a-0 | langchain.agents.react.output_parser.ReActOutputParser¶
class langchain.agents.react.output_parser.ReActOutputParser[source]¶
Bases: AgentOutputParser
Output parser for the ReAct agent.
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = F... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
27a131c2555a-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
27a131c2555a-2 | Default implementation runs invoke in parallel using a thread pool executor.
The default implementation of batch works well for IO bound runnables.
Subclasses should override this method if they can batch more efficiently;
e.g., if the underlying runnable uses an API which supports a batch mode.
bind(**kwargs: Any) → R... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
27a131c2555a-3 | 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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
27a131c2555a-4 | methods will have a dynamic output schema that depends on which
configuration the runnable is invoked with.
This method allows to get an output 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 output.
invoke(input:... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
27a131c2555a-5 | The unique identifier is a list of strings that describes the path
to the object.
map() → Runnable[List[Input], List[Output]]¶
Return a new Runnable that maps a list of inputs to a list of outputs,
by calling invoke() with each input.
parse(text: str) → Union[AgentAction, AgentFinish][source]¶
Parse text into agent act... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
27a131c2555a-6 | classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶
stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶
Default implementation of stream, which calls invoke.
Subclasses should override t... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
27a131c2555a-7 | fallback in order, upon failures.
with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶
Bind lifecycle listeners to a Runnable, returning a new Runnable.
on_start: Called before the runnable starts running, with the Run ... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
27a131c2555a-8 | The type of output this runnable produces specified as a type annotation.
property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶
List configurable fields for this runnable.
property input_schema: Type[pydantic.main.BaseModel]¶
The type of input this runnable accepts specified as a pydantic ... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
58bcab795734-0 | langchain.agents.agent_toolkits.clickup.toolkit.ClickupToolkit¶
class langchain.agents.agent_toolkits.clickup.toolkit.ClickupToolkit[source]¶
Bases: BaseToolkit
Clickup Toolkit.
Security Note: This toolkit contains tools that can read and modifythe state of a service; e.g., by reading, creating, updating, deleting
data... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.clickup.toolkit.ClickupToolkit.html |
58bcab795734-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.clickup.toolkit.ClickupToolkit.html |
58bcab795734-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.clickup.toolkit.ClickupToolkit.html |
3832cfae0661-0 | langchain.agents.agent_toolkits.zapier.toolkit.ZapierToolkit¶
class langchain.agents.agent_toolkits.zapier.toolkit.ZapierToolkit[source]¶
Bases: BaseToolkit
Zapier Toolkit.
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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.zapier.toolkit.ZapierToolkit.html |
3832cfae0661-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.zapier.toolkit.ZapierToolkit.html |
3832cfae0661-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.zapier.toolkit.ZapierToolkit.html |
970a58409bd9-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html |
970a58409bd9-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html |
970a58409bd9-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html |
970a58409bd9-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html |
970a58409bd9-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html |
8c4ca9b89211-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
8c4ca9b89211-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
8c4ca9b89211-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
8c4ca9b89211-3 | Default implementation runs invoke in parallel using a thread pool executor.
The default implementation of batch works well for IO bound runnables.
Subclasses should override this method if they can batch more efficiently;
e.g., if the underlying runnable uses an API which supports a batch mode.
bind(**kwargs: Any) → R... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
8c4ca9b89211-4 | 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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
8c4ca9b89211-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
8c4ca9b89211-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
8c4ca9b89211-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
8c4ca9b89211-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
8c4ca9b89211-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... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
1abb79735288-0 | langchain.agents.load_tools.get_all_tool_names¶
langchain.agents.load_tools.get_all_tool_names() → List[str][source]¶
Get a list of all possible tool names. | lang/api.python.langchain.com/en/latest/agents/langchain.agents.load_tools.get_all_tool_names.html |
9306121ac79a-0 | langchain.agents.format_scratchpad.xml.format_xml¶
langchain.agents.format_scratchpad.xml.format_xml(intermediate_steps: List[Tuple[AgentAction, str]]) → str[source]¶
Format the intermediate steps as XML.
Parameters
intermediate_steps – The intermediate steps.
Returns
The intermediate steps as XML. | lang/api.python.langchain.com/en/latest/agents/langchain.agents.format_scratchpad.xml.format_xml.html |
440f8907fa90-0 | langchain.agents.agent_toolkits.openapi.planner.create_openapi_agent¶
langchain.agents.agent_toolkits.openapi.planner.create_openapi_agent(api_spec: ReducedOpenAPISpec, requests_wrapper: TextRequestsWrapper, llm: BaseLanguageModel, shared_memory: Optional[ReadOnlySharedMemory] = None, callback_manager: Optional[BaseCal... | lang/api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.create_openapi_agent.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.