id stringlengths 14 15 | text stringlengths 35 2.51k | source stringlengths 61 154 |
|---|---|---|
da024386350d-0 | langchain.agents.load_tools.load_huggingface_tool¶
langchain.agents.load_tools.load_huggingface_tool(task_or_repo_id: str, model_repo_id: Optional[str] = None, token: Optional[str] = None, remote: bool = False, **kwargs: Any) → BaseTool[source]¶
Loads a tool from the HuggingFace Hub.
Parameters
task_or_repo_id – Task o... | https://api.python.langchain.com/en/latest/agents/langchain.agents.load_tools.load_huggingface_tool.html |
c4012aa76216-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]¶
Bases: str, Enum
Enumerator with the Agent types.
Methods
__init__(*args, **kwds)
capitalize()
Return a capitalized version of the string.
ca... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
c4012aa76216-1 | Return True if the string is a decimal string, False otherwise.
isdigit()
Return True if the string is a digit string, False otherwise.
isidentifier()
Return True if the string is a valid Python identifier, False otherwise.
islower()
Return True if the string is a lowercase string, False otherwise.
isnumeric()
Return T... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
c4012aa76216-2 | rjust(width[, fillchar])
Return a right-justified string of length width.
rpartition(sep, /)
Partition the string into three parts using the given separator.
rsplit([sep, maxsplit])
Return a list of the substrings in the string, using sep as the separator string.
rstrip([chars])
Return a copy of the string with trailin... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
c4012aa76216-3 | center(width, fillchar=' ', /)¶
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
count(sub[, start[, end]]) → int¶
Return the number of non-overlapping occurrences of substring sub in
string S[start:end]. Optional arguments start and end are
interpreted... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
c4012aa76216-4 | format_map(mapping) → str¶
Return a formatted version of S, using substitutions from mapping.
The substitutions are identified by braces (‘{’ and ‘}’).
index(sub[, start[, end]]) → int¶
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start a... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
c4012aa76216-5 | islower()¶
Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and
there is at least one cased character in the string.
isnumeric()¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characte... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
c4012aa76216-6 | lower()¶
Return a copy of the string converted to lowercase.
lstrip(chars=None, /)¶
Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
static maketrans()¶
Return a translation table usable for str.translate().
If there is only one argument, i... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
c4012aa76216-7 | Return a copy with all occurrences of substring old replaced by new.
countMaximum number of occurrences to replace.
-1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are
replaced.
rfind(sub[, start[, end]]) → int¶
Return the highest index in ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
c4012aa76216-8 | empty strings from the result.
maxsplitMaximum number of splits (starting from the left).
-1 (the default value) means no limit.
Splitting starts at the end of the string and works to the front.
rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove c... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
c4012aa76216-9 | Convert uppercase characters to lowercase and lowercase characters to uppercase.
title()¶
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining
cased characters have lower case.
translate(table, /)¶
Replace each character in the string ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_types.AgentType.html |
b96e0a8491c7-0 | langchain.agents.agent_toolkits.openapi.planner.RequestsDeleteToolWithParsing¶
class langchain.agents.agent_toolkits.openapi.planner.RequestsDeleteToolWithParsing(*, name: str = 'requests_delete', description: str = 'ONLY USE THIS TOOL WHEN THE USER HAS SPECIFICALLY REQUESTED TO DELETE CONTENT FROM A WEBSITE.\nInput to... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsDeleteToolWithParsing.html |
b96e0a8491c7-1 | param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'ONLY USE THIS TOOL WHEN THE USER HAS SPECIFICALLY REQUESTED TO DELETE CONTENT FROM A WEBSITE.\nInput to the tool should be a json string with 2 keys: "url", and "output_instructions".\nThe value of "url" should be... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsDeleteToolWithParsing.html |
b96e0a8491c7-2 | Make tool callable.
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Any¶
Run the tool asynchronously.
validator raise_depreca... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsDeleteToolWithParsing.html |
e38045a85a11-0 | langchain.agents.mrkl.output_parser.MRKLOutputParser¶
class langchain.agents.mrkl.output_parser.MRKLOutputParser[source]¶
Bases: AgentOutputParser
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
dict(**kwarg... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.output_parser.MRKLOutputParser.html |
e38045a85a11-1 | property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.output_parser.MRKLOutputParser.html |
0fd2cd68ba92-0 | langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent¶
class langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent(*, llm: BaseLanguageModel, tools: Sequence[BaseTool], prompt: BasePromptTemplate)[source]¶
Bases: BaseMultiActionAgent
An Agent driven by OpenAIs function powe... | https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent.html |
0fd2cd68ba92-1 | Create prompt for this agent.
Parameters
system_message – Message to use as the system message that will be the
first in the prompt.
extra_prompt_messages – Prompt messages that will be placed between the
system message and the new human input.
Returns
A prompt template to pass into this agent.
dict(**kwargs: Any) → Di... | https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent.html |
0fd2cd68ba92-2 | # If working with agent executor
agent.agent.save(file_path=”path/agent.yaml”)
tool_run_logging_kwargs() → Dict¶
validator validate_llm » all fields[source]¶
validator validate_prompt » all fields[source]¶
property functions: List[dict]¶
property input_keys: List[str]¶
Get input keys. Input refers to user input her... | https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent.html |
16ae84f9a807-0 | langchain.agents.agent_toolkits.nla.tool.NLATool¶
class langchain.agents.agent_toolkits.nla.tool.NLATool(name: str, func: Callable, description: str, *, args_schema: Optional[Type[BaseModel]] = None, return_direct: bool = False, verbose: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackMan... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
16ae84f9a807-1 | Whether to return the tool’s output directly. Setting this to True means
that after the tool is called, the AgentExecutor will stop looping.
param verbose: bool = False¶
Whether to log the tool’s progress.
__call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
16ae84f9a807-2 | Raise deprecation warning if callback_manager is used.
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, **kwargs: Any) → Any¶
Run the tool.
property a... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
2b8bd42f6847-0 | langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent¶
class langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent(*, llm: BaseLanguageModel, tools: Sequence[BaseTool], prompt: BasePromptTemplate)[source]¶
Bases: BaseSingleActionAgent
An Agent driven by OpenAIs function powered API.
Parameters
l... | https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent.html |
2b8bd42f6847-1 | Create prompt for this agent.
Parameters
system_message – Message to use as the system message that will be the
first in the prompt.
extra_prompt_messages – Prompt messages that will be placed between the
system message and the new human input.
Returns
A prompt template to pass into this agent.
dict(**kwargs: Any) → Di... | https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent.html |
2b8bd42f6847-2 | # If working with agent executor
agent.agent.save(file_path=”path/agent.yaml”)
tool_run_logging_kwargs() → Dict¶
validator validate_llm » all fields[source]¶
validator validate_prompt » all fields[source]¶
property functions: List[dict]¶
property input_keys: List[str]¶
Get input keys. Input refers to user input her... | https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent.html |
e0cc51bf1e05-0 | langchain.agents.agent_toolkits.openapi.toolkit.OpenAPIToolkit¶
class langchain.agents.agent_toolkits.openapi.toolkit.OpenAPIToolkit(*, json_agent: AgentExecutor, requests_wrapper: TextRequestsWrapper)[source]¶
Bases: BaseToolkit
Toolkit for interacting with a OpenAPI api.
Create a new model by parsing and validating i... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.toolkit.OpenAPIToolkit.html |
ee2e4baab2bf-0 | langchain.agents.agent_toolkits.gmail.toolkit.GmailToolkit¶
class langchain.agents.agent_toolkits.gmail.toolkit.GmailToolkit(*, api_resource: Resource = None)[source]¶
Bases: BaseToolkit
Toolkit for interacting with Gmail.
Create a new model by parsing and validating input data from keyword arguments.
Raises Validation... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.gmail.toolkit.GmailToolkit.html |
594d8ef9a937-0 | langchain.agents.chat.base.ChatAgent¶
class langchain.agents.chat.base.ChatAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: Agent
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the... | https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.base.ChatAgent.html |
594d8ef9a937-1 | **kwargs – User inputs.
Returns
Action specifying what tool to use.
classmethod create_prompt(tools: Sequence[BaseTool], system_message_prefix: str = 'Answer the following questions as best you can. You have access to the following tools:', system_message_suffix: str = 'Begin! Reminder to always use the exact character... | https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.base.ChatAgent.html |
594d8ef9a937-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, system_message_prefix: str = 'Answer the following questions... | https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.base.ChatAgent.html |
594d8ef9a937-3 | Construct an agent from an LLM and tools.
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.
plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Opt... | https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.base.ChatAgent.html |
583696efc504-0 | langchain.agents.agent_toolkits.azure_cognitive_services.toolkit.AzureCognitiveServicesToolkit¶
class langchain.agents.agent_toolkits.azure_cognitive_services.toolkit.AzureCognitiveServicesToolkit[source]¶
Bases: BaseToolkit
Toolkit for Azure Cognitive Services.
Create a new model by parsing and validating input data f... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.azure_cognitive_services.toolkit.AzureCognitiveServicesToolkit.html |
e152fcb6b7ba-0 | langchain.agents.structured_chat.base.StructuredChatAgent¶
class langchain.agents.structured_chat.base.StructuredChatAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: Agent
Create a new model by parsing and validating input data from keywor... | https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.base.StructuredChatAgent.html |
e152fcb6b7ba-1 | **kwargs – User inputs.
Returns
Action specifying what tool to use.
classmethod create_prompt(tools: Sequence[BaseTool], prefix: str = 'Respond to the human as helpfully and accurately as possible. You have access to the following tools:', suffix: str = 'Begin! Reminder to ALWAYS respond with a valid json blob of a sin... | https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.base.StructuredChatAgent.html |
e152fcb6b7ba-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 = 'Respond to the human as helpfully and accurat... | https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.base.StructuredChatAgent.html |
e152fcb6b7ba-3 | Construct an agent from an LLM and tools.
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.
plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Opt... | https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.base.StructuredChatAgent.html |
4c6cbae0c36a-0 | langchain.agents.react.base.ReActChain¶
class langchain.agents.react.base.ReActChain(llm: BaseLanguageModel, docstore: Docstore, *, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verbose: boo... | https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html |
4c6cbae0c36a-1 | The method to use for early stopping if the agent never
returns AgentFinish. Either ‘force’ or ‘generate’.
“force” returns a string saying that it stopped because it met atime or iteration limit.
“generate” calls the agent’s LLM Chain one final time to generatea final answer based on the previous steps.
param handle_pa... | https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html |
4c6cbae0c36a-2 | Optional list of tags associated with the chain. Defaults to None
These tags will be associated with each call to this chain,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a chain with its use case.
param tools: Sequence[BaseTool] [Required]¶
The v... | https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html |
4c6cbae0c36a-3 | Run the logic of this chain and add to output if desired.
Parameters
inputs – Dictionary of inputs, or single input if chain expects
only one param.
return_only_outputs – boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
returned. If False, both input key... | https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html |
4c6cbae0c36a-4 | Validate and prep outputs.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used.
run(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, **kwargs: Any) → str¶
Run the chain as text in, text out or m... | https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActChain.html |
e9e68fb63747-0 | langchain.agents.agent.BaseSingleActionAgent¶
class langchain.agents.agent.BaseSingleActionAgent[source]¶
Bases: BaseModel
Base 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.
abstract async apl... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseSingleActionAgent.html |
e9e68fb63747-1 | Return response when agent has been stopped due to max iterations.
save(file_path: Union[Path, str]) → None[source]¶
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”)
tool_run_logging_k... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseSingleActionAgent.html |
c398c910b030-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... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.create_openapi_agent.html |
823b43cce2d6-0 | langchain.agents.agent_toolkits.json.toolkit.JsonToolkit¶
class langchain.agents.agent_toolkits.json.toolkit.JsonToolkit(*, spec: JsonSpec)[source]¶
Bases: BaseToolkit
Toolkit for interacting with a JSON spec.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.json.toolkit.JsonToolkit.html |
3a9d4e97c5da-0 | langchain.agents.loading.load_agent_from_config¶
langchain.agents.loading.load_agent_from_config(config: dict, llm: Optional[BaseLanguageModel] = None, tools: Optional[List[Tool]] = None, **kwargs: Any) → Union[BaseSingleActionAgent, BaseMultiActionAgent][source]¶
Load agent from Config Dict. | https://api.python.langchain.com/en/latest/agents/langchain.agents.loading.load_agent_from_config.html |
0ec4cf217bb3-0 | langchain.agents.mrkl.base.ZeroShotAgent¶
class langchain.agents.mrkl.base.ZeroShotAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: Agent
Agent for the MRKL chain.
Create a new model by parsing and validating input data from keyword argume... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html |
0ec4cf217bb3-1 | **kwargs – User inputs.
Returns
Action specifying what tool to use.
classmethod create_prompt(tools: Sequence[BaseTool], prefix: str = 'Answer the following questions as best you can. You have access to the following tools:', suffix: str = 'Begin!\n\nQuestion: {input}\nThought:{agent_scratchpad}', format_instructions: ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html |
0ec4cf217bb3-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 |
0ec4cf217bb3-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.mrkl.base.ZeroShotAgent.html |
5c97df78aed8-0 | langchain.agents.agent_toolkits.base.BaseToolkit¶
class langchain.agents.agent_toolkits.base.BaseToolkit[source]¶
Bases: BaseModel
Class responsible for defining a collection of related tools.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.base.BaseToolkit.html |
84c6a0c448f5-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. | https://api.python.langchain.com/en/latest/agents/langchain.agents.load_tools.get_all_tool_names.html |
506029133c5b-0 | langchain.agents.agent_toolkits.sql.toolkit.SQLDatabaseToolkit¶
class langchain.agents.agent_toolkits.sql.toolkit.SQLDatabaseToolkit(*, db: SQLDatabase, llm: BaseLanguageModel)[source]¶
Bases: BaseToolkit
Toolkit for interacting with SQL databases.
Create a new model by parsing and validating input data from keyword ar... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.sql.toolkit.SQLDatabaseToolkit.html |
c09bb7399563-0 | langchain.agents.agent_toolkits.office365.toolkit.O365Toolkit¶
class langchain.agents.agent_toolkits.office365.toolkit.O365Toolkit(*, account: Account = None)[source]¶
Bases: BaseToolkit
Toolkit for interacting with Office365.
Create a new model by parsing and validating input data from keyword arguments.
Raises Valida... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.office365.toolkit.O365Toolkit.html |
3d42dc1cb198-0 | langchain.agents.agent_toolkits.openapi.base.create_openapi_agent¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html |
3d42dc1cb198-1 | langchain.agents.agent_toolkits.openapi.base.create_openapi_agent(llm: BaseLanguageModel, toolkit: OpenAPIToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = "You are an agent designed to answer questions by making web requests to an API given the openapi spec.\n\nIf the question does not see... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html |
3d42dc1cb198-2 | Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question', input_variables: Optional[List[str]] = None, max_iterations: Optional[int] =... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html |
3d42dc1cb198-3 | Construct a json agent from an LLM and tools. | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html |
1807ee6c2696-0 | langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo¶
class langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo(*, vectorstore: VectorStore, name: str, description: str)[source]¶
Bases: BaseModel
Information about a vectorstore.
Create a new model by parsing and validating input data from... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo.html |
c6463cc51058-0 | langchain.agents.agent.AgentExecutor¶
class langchain.agents.agent.AgentExecutor(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = None, tags: Optional[List[str]] = None, agen... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html |
c6463cc51058-1 | returns AgentFinish. Either ‘force’ or ‘generate’.
“force” returns a string saying that it stopped because it met atime or iteration limit.
“generate” calls the agent’s LLM Chain one final time to generatea final answer based on the previous steps.
param handle_parsing_errors: Union[bool, str, Callable[[OutputParserExc... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html |
c6463cc51058-2 | Optional list of tags associated with the chain. Defaults to None
These tags will be associated with each call to this chain,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a chain with its use case.
param tools: Sequence[BaseTool] [Required]¶
The v... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html |
c6463cc51058-3 | Run the logic of this chain and add to output if desired.
Parameters
inputs – Dictionary of inputs, or single input if chain expects
only one param.
return_only_outputs – boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
returned. If False, both input key... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html |
c6463cc51058-4 | Validate and prep outputs.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used.
run(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, **kwargs: Any) → str¶
Run the chain as text in, text out or m... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html |
3e8f2586d2ce-0 | langchain.agents.loading.load_agent¶
langchain.agents.loading.load_agent(path: Union[str, Path], **kwargs: Any) → Union[BaseSingleActionAgent, BaseMultiActionAgent][source]¶
Unified method for loading a agent from LangChainHub or local fs. | https://api.python.langchain.com/en/latest/agents/langchain.agents.loading.load_agent.html |
75614decb725-0 | langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html |
75614decb725-1 | langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent(llm: BaseChatModel, toolkit: Optional[PowerBIToolkit], powerbi: Optional[PowerBIDataset] = None, callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, prefix: str = 'Assistant is a large language... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html |
75614decb725-2 | examples: Optional[str] = None, input_variables: Optional[List[str]] = None, memory: Optional[BaseChatMemory] = None, top_k: int = 10, verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → AgentExecutor[source]¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html |
75614decb725-3 | Construct a pbi agent from an Chat LLM and tools.
If you supply only a toolkit and no powerbi dataset, the same LLM is used for both. | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html |
0bc42337da5b-0 | langchain.agents.agent_toolkits.spark_sql.toolkit.SparkSQLToolkit¶
class langchain.agents.agent_toolkits.spark_sql.toolkit.SparkSQLToolkit(*, db: SparkSQL, llm: BaseLanguageModel)[source]¶
Bases: BaseToolkit
Toolkit for interacting with Spark SQL.
Create a new model by parsing and validating input data from keyword arg... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.spark_sql.toolkit.SparkSQLToolkit.html |
e4d60ef36c03-0 | langchain.agents.conversational.base.ConversationalAgent¶
class langchain.agents.conversational.base.ConversationalAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None, ai_prefix: str = 'AI')[source]¶
Bases: Agent
An agent designed to hold a conversation in ad... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
e4d60ef36c03-1 | 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 |
e4d60ef36c03-2 | 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 |
e4d60ef36c03-3 | 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 |
e4d60ef36c03-4 | 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 |
e4d60ef36c03-5 | 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 |
e4d60ef36c03-6 | Construct an agent from an LLM and tools.
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.
plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Opt... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
d455fd75da8f-0 | langchain.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent¶
langchain.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent(llm: BaseLanguageModel, df: Any, agent_type: AgentType = AgentType.ZERO_SHOT_REACT_DESCRIPTION, callback_manager: Optional[BaseCallbackManager] = None, prefix: Optional[st... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent.html |
20def99d4375-0 | langchain.agents.conversational_chat.output_parser.ConvoOutputParser¶
class langchain.agents.conversational_chat.output_parser.ConvoOutputParser[source]¶
Bases: AgentOutputParser
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational_chat.output_parser.ConvoOutputParser.html |
20def99d4375-1 | property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational_chat.output_parser.ConvoOutputParser.html |
92e37645131b-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 |
5614c193e33e-0 | langchain.agents.react.base.ReActTextWorldAgent¶
class langchain.agents.react.base.ReActTextWorldAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: ReActDocstoreAgent
Agent for the ReAct TextWorld chain.
Create a new model by parsing and val... | https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActTextWorldAgent.html |
5614c193e33e-1 | Create the full inputs for the LLMChain from intermediate steps.
plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish]¶
Given input, decided what to do.
Parameters
intermediate_steps – S... | https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActTextWorldAgent.html |
e1457e8e778c-0 | langchain.agents.agent_toolkits.openapi.toolkit.RequestsToolkit¶
class langchain.agents.agent_toolkits.openapi.toolkit.RequestsToolkit(*, requests_wrapper: TextRequestsWrapper)[source]¶
Bases: BaseToolkit
Toolkit for making requests.
Create a new model by parsing and validating input data from keyword arguments.
Raises... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.toolkit.RequestsToolkit.html |
ae7d3536e8ea-0 | langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing¶
class langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing(*, name: str = 'requests_get', description: str = 'Use this to GET content from a website.\nInput to the tool should be a json string with 3 keys: "url", "params" ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
ae7d3536e8ea-1 | Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'Use this to GET content from a website.\nInput to the tool should be a json string with 3 keys: "url", "params" and "output_instructions".\nThe value of "url" should be a ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
ae7d3536e8ea-2 | Make tool callable.
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Any¶
Run the tool asynchronously.
validator raise_depreca... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
d20c76a2fb42-0 | langchain.math_utils.cosine_similarity¶
langchain.math_utils.cosine_similarity(X: Union[List[List[float]], List[ndarray], ndarray], Y: Union[List[List[float]], List[ndarray], ndarray]) → ndarray[source]¶
Row-wise cosine similarity between two equal-width matrices. | https://api.python.langchain.com/en/latest/math_utils/langchain.math_utils.cosine_similarity.html |
692ce8f9f48c-0 | langchain.math_utils.cosine_similarity_top_k¶
langchain.math_utils.cosine_similarity_top_k(X: Union[List[List[float]], List[ndarray], ndarray], Y: Union[List[List[float]], List[ndarray], ndarray], top_k: Optional[int] = 5, score_threshold: Optional[float] = None) → Tuple[List[Tuple[int, int]], List[float]][source]¶
Row... | https://api.python.langchain.com/en/latest/math_utils/langchain.math_utils.cosine_similarity_top_k.html |
f56963fc17e4-0 | langchain.graphs.networkx_graph.parse_triples¶
langchain.graphs.networkx_graph.parse_triples(knowledge_str: str) → List[KnowledgeTriple][source]¶
Parse knowledge triples from the knowledge string. | https://api.python.langchain.com/en/latest/graphs/langchain.graphs.networkx_graph.parse_triples.html |
afee68401d88-0 | langchain.graphs.networkx_graph.get_entities¶
langchain.graphs.networkx_graph.get_entities(entity_str: str) → List[str][source]¶
Extract entities from entity string. | https://api.python.langchain.com/en/latest/graphs/langchain.graphs.networkx_graph.get_entities.html |
cb8be65c4575-0 | langchain.graphs.networkx_graph.KnowledgeTriple¶
class langchain.graphs.networkx_graph.KnowledgeTriple(subject: str, predicate: str, object_: str)[source]¶
Bases: NamedTuple
A triple in the graph.
Create new instance of KnowledgeTriple(subject, predicate, object_)
Methods
__init__()
count(value, /)
Return number of occ... | https://api.python.langchain.com/en/latest/graphs/langchain.graphs.networkx_graph.KnowledgeTriple.html |
1ea0cf163399-0 | langchain.formatting.StrictFormatter¶
class langchain.formatting.StrictFormatter[source]¶
Bases: Formatter
A subclass of formatter that checks for extra keys.
Methods
__init__()
check_unused_args(used_args, args, kwargs)
Check to see if extra parameters are passed.
convert_field(value, conversion)
format(format_string,... | https://api.python.langchain.com/en/latest/formatting/langchain.formatting.StrictFormatter.html |
c48fab993cdb-0 | All modules for which code is available
langchain.agents.agent
langchain.agents.agent_toolkits.azure_cognitive_services.toolkit
langchain.agents.agent_toolkits.base
langchain.agents.agent_toolkits.csv.base
langchain.agents.agent_toolkits.file_management.toolkit
langchain.agents.agent_toolkits.gmail.toolkit
langchain.ag... | https://api.python.langchain.com/en/latest/_modules/index.html |
c48fab993cdb-1 | langchain.agents.conversational_chat.output_parser
langchain.agents.initialize
langchain.agents.load_tools
langchain.agents.loading
langchain.agents.mrkl.base
langchain.agents.mrkl.output_parser
langchain.agents.openai_functions_agent.base
langchain.agents.openai_functions_multi_agent.base
langchain.agents.react.base
l... | https://api.python.langchain.com/en/latest/_modules/index.html |
c48fab993cdb-2 | langchain.callbacks.utils
langchain.callbacks.wandb_callback
langchain.callbacks.whylabs_callback
langchain.chains.api.base
langchain.chains.api.openapi.chain
langchain.chains.api.openapi.requests_chain
langchain.chains.api.openapi.response_chain
langchain.chains.base
langchain.chains.combine_documents.base
langchain.c... | https://api.python.langchain.com/en/latest/_modules/index.html |
c48fab993cdb-3 | langchain.chains.pal.base
langchain.chains.prompt_selector
langchain.chains.qa_generation.base
langchain.chains.qa_with_sources.base
langchain.chains.qa_with_sources.loading
langchain.chains.qa_with_sources.retrieval
langchain.chains.qa_with_sources.vector_db
langchain.chains.query_constructor.base
langchain.chains.que... | https://api.python.langchain.com/en/latest/_modules/index.html |
c48fab993cdb-4 | langchain.document_loaders.bigquery
langchain.document_loaders.bilibili
langchain.document_loaders.blackboard
langchain.document_loaders.blob_loaders.file_system
langchain.document_loaders.blob_loaders.schema
langchain.document_loaders.blob_loaders.youtube_audio
langchain.document_loaders.blockchain
langchain.document_... | https://api.python.langchain.com/en/latest/_modules/index.html |
c48fab993cdb-5 | langchain.document_loaders.json_loader
langchain.document_loaders.larksuite
langchain.document_loaders.markdown
langchain.document_loaders.mastodon
langchain.document_loaders.max_compute
langchain.document_loaders.mediawikidump
langchain.document_loaders.merge
langchain.document_loaders.mhtml
langchain.document_loaders... | https://api.python.langchain.com/en/latest/_modules/index.html |
c48fab993cdb-6 | langchain.document_loaders.slack_directory
langchain.document_loaders.snowflake_loader
langchain.document_loaders.spreedly
langchain.document_loaders.srt
langchain.document_loaders.stripe
langchain.document_loaders.telegram
langchain.document_loaders.tencent_cos_directory
langchain.document_loaders.tencent_cos_file
lan... | https://api.python.langchain.com/en/latest/_modules/index.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.