id stringlengths 14 15 | text stringlengths 35 2.51k | source stringlengths 61 154 |
|---|---|---|
074c5572f7f9-0 | langchain.text_splitter.TextSplitter¶
class langchain.text_splitter.TextSplitter(chunk_size: int = 4000, chunk_overlap: int = 200, length_function: ~typing.Callable[[str], int] = <built-in function len>, keep_separator: bool = False, add_start_index: bool = False)[source]¶
Bases: BaseDocumentTransformer, ABC
Interface ... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.TextSplitter.html |
074c5572f7f9-1 | Create documents from a list of texts.
classmethod from_huggingface_tokenizer(tokenizer: Any, **kwargs: Any) → TextSplitter[source]¶
Text splitter that uses HuggingFace tokenizer to count length.
classmethod from_tiktoken_encoder(encoding_name: str = 'gpt2', model_name: Optional[str] = None, allowed_special: Union[Lite... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.TextSplitter.html |
053b7184fba8-0 | langchain.text_splitter.Language¶
class langchain.text_splitter.Language(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases: str, Enum
Methods
__init__(*args, **kwds)
capitalize()
Return a capitalized version of the string.
casefold()
Return a version of the string suita... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.Language.html |
053b7184fba8-1 | 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 True if the string is a numeric string, False otherwise.
isprinta... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.Language.html |
053b7184fba8-2 | 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 trailing whitespace removed.
spl... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.Language.html |
053b7184fba8-3 | 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 as in slice notation.
encode(encoding='utf-8', errors='strict')¶
Encode t... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.Language.html |
053b7184fba8-4 | 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 and end are interpreted as in slice notation.
Raises ValueError when the substring is not found... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.Language.html |
053b7184fba8-5 | 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 characters in the string are numeric and there is at
least one character in the strin... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.Language.html |
053b7184fba8-6 | 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, it must be a dictionary mapping Unicode
ordinals (integers) or characters to Unicode ... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.Language.html |
053b7184fba8-7 | -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 S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end ar... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.Language.html |
053b7184fba8-8 | -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 characters in chars instead.
split(sep=None, maxsplit=- 1)¶
Return a list of the substrings... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.Language.html |
053b7184fba8-9 | More specifically, words start with uppercased characters and all remaining
cased characters have lower case.
translate(table, /)¶
Replace each character in the string using the given translation table.
tableTranslation table, which must be a mapping of Unicode ordinals to
Unicode ordinals, strings, or None.
The table ... | https://api.python.langchain.com/en/latest/text_splitter/langchain.text_splitter.Language.html |
4e0844ed3a17-0 | langchain.agents.agent.BaseMultiActionAgent¶
class langchain.agents.agent.BaseMultiActionAgent[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 aplan... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseMultiActionAgent.html |
4e0844ed3a17-1 | 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_kwargs() → Dict[source]¶
property return_values: List[str]¶
Return values of the agent. | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.BaseMultiActionAgent.html |
53048c14706b-0 | langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain¶
class langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain(llm: BaseLanguageModel, search_chain: Union[GoogleSerperAPIWrapper, SerpAPIWrapper], *, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], Bas... | https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
53048c14706b-1 | starting with on_chain_start, ending with on_chain_end or on_chain_error.
Each custom chain can optionally call additional callback methods, see Callback docs
for full details.
param early_stopping_method: str = 'force'¶
The method to use for early stopping if the agent never
returns AgentFinish. Either ‘force’ or ‘gen... | https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
53048c14706b-2 | There are many different types of memory - please see memory docs
for the full catalog.
param return_intermediate_steps: bool = False¶
Whether to return the agent’s trajectory of intermediate steps
at the end in addition to the final output.
param tags: Optional[List[str]] = None¶
Optional list of tags associated with ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
53048c14706b-3 | include_run_info – Whether to include run info in the response. Defaults
to False.
async acall(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, include_run_info: bool = False) → ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
53048c14706b-4 | Create from agent and tools.
lookup_tool(name: str) → BaseTool¶
Lookup tool by name.
prep_inputs(inputs: Union[Dict[str, Any], Any]) → Dict[str, str]¶
Validate and prep inputs.
prep_outputs(inputs: Dict[str, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶
Validate and prep outputs.
v... | https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
53048c14706b-5 | property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
55564706769f-0 | langchain.agents.schema.AgentScratchPadChatPromptTemplate¶
class langchain.agents.schema.AgentScratchPadChatPromptTemplate(*, input_variables: List[str], output_parser: Optional[BaseOutputParser] = None, partial_variables: Mapping[str, Union[str, Callable[[], str]]] = None, messages: List[Union[BaseMessagePromptTemplat... | https://api.python.langchain.com/en/latest/agents/langchain.agents.schema.AgentScratchPadChatPromptTemplate.html |
55564706769f-1 | classmethod from_template(template: str, **kwargs: Any) → ChatPromptTemplate¶
partial(**kwargs: Union[str, Callable[[], str]]) → BasePromptTemplate¶
Return a partial of the prompt template.
save(file_path: Union[Path, str]) → None¶
Save the prompt.
Parameters
file_path – Path to directory to save prompt to.
Example:
..... | https://api.python.langchain.com/en/latest/agents/langchain.agents.schema.AgentScratchPadChatPromptTemplate.html |
c943fecac49f-0 | langchain.agents.agent.Agent¶
class langchain.agents.agent.Agent(*, llm_chain: LLMChain, output_parser: AgentOutputParser, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: BaseSingleActionAgent
Class responsible for calling the language model and deciding the action.
This is driven by an LLMChain. The prompt ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.Agent.html |
c943fecac49f-1 | Construct an agent from an LLM and tools.
get_allowed_tools() → Optional[List[str]][source]¶
get_full_inputs(intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → Dict[str, Any][source]¶
Create the full inputs for the LLMChain from intermediate steps.
plan(intermediate_steps: List[Tuple[AgentAction, str]]... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.Agent.html |
cda79b35f488-0 | langchain.agents.agent_toolkits.nla.toolkit.NLAToolkit¶
class langchain.agents.agent_toolkits.nla.toolkit.NLAToolkit(*, nla_tools: Sequence[NLATool])[source]¶
Bases: BaseToolkit
Natural Language API Toolkit Definition.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationErro... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.toolkit.NLAToolkit.html |
80bd4ebf1f9c-0 | langchain.agents.agent_toolkits.jira.toolkit.JiraToolkit¶
class langchain.agents.agent_toolkits.jira.toolkit.JiraToolkit(*, tools: List[BaseTool] = [])[source]¶
Bases: BaseToolkit
Jira Toolkit.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data canno... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.jira.toolkit.JiraToolkit.html |
4f9d889b4398-0 | langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent¶
class langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: Agent
Agent for the self-ask-with-search paper.
Create a ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent.html |
4f9d889b4398-1 | 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: Optional[Union[List[BaseCallbackHandler], Bas... | https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent.html |
a2263de72216-0 | langchain.agents.mrkl.base.MRKLChain¶
class langchain.agents.mrkl.base.MRKLChain(*, 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.mrkl.base.MRKLChain.html |
a2263de72216-1 | Callback handlers are called throughout the lifecycle of a call to a chain,
starting with on_chain_start, ending with on_chain_end or on_chain_error.
Each custom chain can optionally call additional callback methods, see Callback docs
for full details.
param early_stopping_method: str = 'force'¶
The method to use for e... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
a2263de72216-2 | them along in the chain. At the end, it saves any returned variables.
There are many different types of memory - please see memory docs
for the full catalog.
param return_intermediate_steps: bool = False¶
Whether to return the agent’s trajectory of intermediate steps
at the end in addition to the final output.
param ta... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
a2263de72216-3 | include_run_info – Whether to include run info in the response. Defaults
to False.
async acall(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, include_run_info: bool = False) → ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
a2263de72216-4 | Create from agent and tools.
classmethod from_chains(llm: BaseLanguageModel, chains: List[ChainConfig], **kwargs: Any) → AgentExecutor[source]¶
User friendly way to initialize the MRKL chain.
This is intended to be an easy way to get up and running with the
MRKL chain.
Parameters
llm – The LLM to use as the agent LLM.
... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
a2263de72216-5 | 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 multiple variables, text out.
save(file_path: Union[Path, str]) → None¶
... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
2cdd8787c9d6-0 | langchain.agents.agent_toolkits.openapi.spec.dereference_refs¶
langchain.agents.agent_toolkits.openapi.spec.dereference_refs(spec_obj: dict, full_spec: dict) → Union[dict, list][source]¶
Try to substitute $refs.
The goal is to get the complete docs for each endpoint in context for now.
In the few OpenAPI specs I studie... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.spec.dereference_refs.html |
edeb88a669e1-0 | langchain.agents.agent_toolkits.zapier.toolkit.ZapierToolkit¶
class langchain.agents.agent_toolkits.zapier.toolkit.ZapierToolkit(*, tools: List[BaseTool] = [])[source]¶
Bases: BaseToolkit
Zapier Toolkit.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.zapier.toolkit.ZapierToolkit.html |
0608db322305-0 | langchain.agents.agent_toolkits.openapi.planner.RequestsPatchToolWithParsing¶
class langchain.agents.agent_toolkits.openapi.planner.RequestsPatchToolWithParsing(*, name: str = 'requests_patch', description: str = 'Use this when you want to PATCH content on a website.\nInput to the tool should be a json string with 3 ke... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsPatchToolWithParsing.html |
0608db322305-1 | Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'Use this when you want to PATCH content on a website.\nInput to the tool should be a json string with 3 keys: "url", "data", and "output_instructions".\nThe value of "url"... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsPatchToolWithParsing.html |
0608db322305-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.RequestsPatchToolWithParsing.html |
f0e54e18aa7d-0 | langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries¶
class langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries(*, base_parser: AgentOutputParser = None, output_fixing_parser: Optional[OutputFixingParser] = None)[source]¶
Bases: AgentOutputParser
Create a... | https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html |
f0e54e18aa7d-1 | to_json_not_implemented() → SerializedNotImplemented¶
property lc_attributes: Dict¶
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]¶
Return the namespace of the langchain object.
eg. [“langchain”, “... | https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html |
8b31af8d6ed6-0 | langchain.agents.mrkl.base.ChainConfig¶
class langchain.agents.mrkl.base.ChainConfig(action_name: str, action: Callable, action_description: str)[source]¶
Bases: NamedTuple
Configuration for chain to use in MRKL system.
Parameters
action_name – Name of the action.
action – Action function to call.
action_description – ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.mrkl.base.ChainConfig.html |
ece770d210b2-0 | langchain.agents.agent_toolkits.openapi.spec.reduce_openapi_spec¶
langchain.agents.agent_toolkits.openapi.spec.reduce_openapi_spec(spec: dict, dereference: bool = True) → ReducedOpenAPISpec[source]¶
Simplify/distill/minify a spec somehow.
I want a smaller target for retrieval and (more importantly)
I want smaller resul... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.spec.reduce_openapi_spec.html |
13959d9a99e7-0 | langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent.html |
13959d9a99e7-1 | langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent(llm: BaseLanguageModel, toolkit: Optional[PowerBIToolkit], powerbi: Optional[PowerBIDataset] = None, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to help users interact with a PowerBI Dataset.\n\nAgent has ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent.html |
13959d9a99e7-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', examples: Optional[str] = None, input_variables: Optional[List[str]] = None,... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent.html |
13959d9a99e7-3 | Construct a pbi agent from an LLM and tools. | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent.html |
e990dac6f9c9-0 | langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent.html |
e990dac6f9c9-1 | langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent(llm: BaseLanguageModel, toolkit: SparkSQLToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with Spark SQL.\nGiven an input question, create a syntactically correct Spark SQL query to... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent.html |
e990dac6f9c9-2 | (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, top_k: int = 10, max_iterations: Optional[int] = 15, max_execution_time: Optional[float] = None, early_sto... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent.html |
e990dac6f9c9-3 | Construct a sql agent from an LLM and tools. | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent.html |
d1461f332581-0 | langchain.agents.agent_toolkits.playwright.toolkit.PlayWrightBrowserToolkit¶
class langchain.agents.agent_toolkits.playwright.toolkit.PlayWrightBrowserToolkit(*, sync_browser: Optional['SyncBrowser'] = None, async_browser: Optional['AsyncBrowser'] = None)[source]¶
Bases: BaseToolkit
Toolkit for web browser tools.
Creat... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.playwright.toolkit.PlayWrightBrowserToolkit.html |
552d15b0838b-0 | langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing¶
class langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing(*, name: str = 'requests_post', description: str = 'Use this when you want to POST to a website.\nInput to the tool should be a json string with 3 keys: "url", "... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing.html |
552d15b0838b-1 | param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'Use this when you want to POST to a website.\nInput to the tool should be a json string with 3 keys: "url", "data", and "output_instructions".\nThe value of "url" should be a string.\nThe value of "data" should be... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing.html |
552d15b0838b-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.RequestsPostToolWithParsing.html |
93f8caf7700c-0 | langchain.agents.agent.AgentOutputParser¶
class langchain.agents.agent.AgentOutputParser[source]¶
Bases: BaseOutputParser
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(**kwargs: Any) → Dict¶
Return di... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentOutputParser.html |
93f8caf7700c-1 | Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentOutputParser.html |
f51c486981ec-0 | langchain.agents.agent_toolkits.spark.base.create_spark_dataframe_agent¶
langchain.agents.agent_toolkits.spark.base.create_spark_dataframe_agent(llm: BaseLLM, df: Any, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = '\nYou are working with a spark dataframe in Python. The name of the dataframe is ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.spark.base.create_spark_dataframe_agent.html |
e115e7c98830-0 | langchain.agents.conversational.output_parser.ConvoOutputParser¶
class langchain.agents.conversational.output_parser.ConvoOutputParser(*, ai_prefix: str = 'AI')[source]¶
Bases: AgentOutputParser
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cann... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
e115e7c98830-1 | eg. {“openai_api_key”: “OPENAI_API_KEY”}
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.output_parser.ConvoOutputParser.html |
e742993b5cb3-0 | langchain.agents.agent.ExceptionTool¶
class langchain.agents.agent.ExceptionTool(*, name: str = '_Exception', description: str = 'Exception tool', args_schema: Optional[Type[BaseModel]] = None, return_direct: bool = False, verbose: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.ExceptionTool.html |
e742993b5cb3-1 | param verbose: bool = False¶
Whether to log the tool’s progress.
__call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str¶
Make tool callable.
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: O... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.ExceptionTool.html |
0ef41eac9f6e-0 | langchain.agents.agent_toolkits.file_management.toolkit.FileManagementToolkit¶
class langchain.agents.agent_toolkits.file_management.toolkit.FileManagementToolkit(*, root_dir: Optional[str] = None, selected_tools: Optional[List[str]] = None)[source]¶
Bases: BaseToolkit
Toolkit for interacting with a Local Files.
Create... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.file_management.toolkit.FileManagementToolkit.html |
84666ea2f9b6-0 | langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent¶
langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent(llm: BaseLanguageModel, toolkit: VectorStoreRouterToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed t... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent.html |
b8495eb35dba-0 | langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent¶
langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent(llm: BaseLanguageModel, toolkit: VectorStoreToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to answer questions a... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent.html |
543529730692-0 | langchain.agents.self_ask_with_search.output_parser.SelfAskOutputParser¶
class langchain.agents.self_ask_with_search.output_parser.SelfAskOutputParser(*, followups: Sequence[str] = ('Follow up:', 'Followup:'), finish_string: str = 'So the final answer is: ')[source]¶
Bases: AgentOutputParser
Create a new model by parsi... | https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.output_parser.SelfAskOutputParser.html |
543529730692-1 | property lc_namespace: List[str]¶
Return the namespace of the langchain object.
eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
Return whether or not the class is s... | https://api.python.langchain.com/en/latest/agents/langchain.agents.self_ask_with_search.output_parser.SelfAskOutputParser.html |
bee39a1e3f9b-0 | langchain.agents.load_tools.load_tools¶
langchain.agents.load_tools.load_tools(tool_names: List[str], llm: Optional[BaseLanguageModel] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → List[BaseTool][source]¶
Load tools based on their name.
Parameters
tool_names... | https://api.python.langchain.com/en/latest/agents/langchain.agents.load_tools.load_tools.html |
50eec1b4f269-0 | langchain.agents.agent_toolkits.sql.base.create_sql_agent¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.sql.base.create_sql_agent.html |
50eec1b4f269-1 | langchain.agents.agent_toolkits.sql.base.create_sql_agent(llm: BaseLanguageModel, toolkit: SQLDatabaseToolkit, agent_type: AgentType = AgentType.ZERO_SHOT_REACT_DESCRIPTION, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with a SQL database.\nGiven an input ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.sql.base.create_sql_agent.html |
50eec1b4f269-2 | I now know the final answer\nFinal Answer: the final answer to the original input question', input_variables: Optional[List[str]] = None, top_k: int = 10, max_iterations: Optional[int] = 15, max_execution_time: Optional[float] = None, early_stopping_method: str = 'force', verbose: bool = False, agent_executor_kwargs: O... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.sql.base.create_sql_agent.html |
50eec1b4f269-3 | Construct a sql agent from an LLM and tools. | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.sql.base.create_sql_agent.html |
6371176e7a6f-0 | langchain.agents.react.output_parser.ReActOutputParser¶
class langchain.agents.react.output_parser.ReActOutputParser[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(**k... | https://api.python.langchain.com/en/latest/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
6371176e7a6f-1 | Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
898deb1226d2-0 | langchain.agents.agent_toolkits.csv.base.create_csv_agent¶
langchain.agents.agent_toolkits.csv.base.create_csv_agent(llm: BaseLanguageModel, path: Union[str, List[str]], pandas_kwargs: Optional[dict] = None, **kwargs: Any) → AgentExecutor[source]¶
Create csv agent by loading to a dataframe and using pandas agent. | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.csv.base.create_csv_agent.html |
a6c759cca118-0 | langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit¶
class langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit(*, vectorstores: List[VectorStoreInfo], llm: BaseLanguageModel = None)[source]¶
Bases: BaseToolkit
Toolkit for routing between vector stores.
Create a new mode... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit.html |
3f06521f26a9-0 | langchain.agents.tools.InvalidTool¶
class langchain.agents.tools.InvalidTool(*, name: str = 'invalid_tool', description: str = 'Called when tool name is invalid.', args_schema: Optional[Type[BaseModel]] = None, return_direct: bool = False, verbose: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], Base... | https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html |
3f06521f26a9-1 | param verbose: bool = False¶
Whether to log the tool’s progress.
__call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str¶
Make tool callable.
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: O... | https://api.python.langchain.com/en/latest/agents/langchain.agents.tools.InvalidTool.html |
9e1ee838b934-0 | langchain.agents.structured_chat.output_parser.StructuredChatOutputParser¶
class langchain.agents.structured_chat.output_parser.StructuredChatOutputParser[source]¶
Bases: AgentOutputParser
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParser.html |
9e1ee838b934-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.structured_chat.output_parser.StructuredChatOutputParser.html |
e1efcbfd921f-0 | langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit¶
class langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit(*, vectorstore_info: VectorStoreInfo, llm: BaseLanguageModel = None)[source]¶
Bases: BaseToolkit
Toolkit for interacting with a vector store.
Create a new model by parsing... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit.html |
3194ffff3e2e-0 | langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit¶
class langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit(*, powerbi: PowerBIDataset, llm: BaseLanguageModel, examples: Optional[str] = None, max_iterations: int = 5, callback_manager: Optional[BaseCallbackManager] = None)[source]¶
Bases: BaseTo... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit.html |
8caefb0bd649-0 | langchain.agents.agent_toolkits.python.base.create_python_agent¶
langchain.agents.agent_toolkits.python.base.create_python_agent(llm: BaseLanguageModel, tool: PythonREPLTool, agent_type: AgentType = AgentType.ZERO_SHOT_REACT_DESCRIPTION, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = False, pre... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.python.base.create_python_agent.html |
41ecee573f2e-0 | langchain.agents.agent.LLMSingleActionAgent¶
class langchain.agents.agent.LLMSingleActionAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser, stop: List[str])[source]¶
Bases: BaseSingleActionAgent
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the in... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.LLMSingleActionAgent.html |
41ecee573f2e-1 | 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.agent.LLMSingleActionAgent.html |
a1762b0771b8-0 | langchain.agents.chat.output_parser.ChatOutputParser¶
class langchain.agents.chat.output_parser.ChatOutputParser[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.chat.output_parser.ChatOutputParser.html |
a1762b0771b8-1 | Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html |
e2b1d9e19a77-0 | langchain.agents.agent_toolkits.json.base.create_json_agent¶ | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.json.base.create_json_agent.html |
e2b1d9e19a77-1 | langchain.agents.agent_toolkits.json.base.create_json_agent(llm: BaseLanguageModel, toolkit: JsonToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with JSON.\nYour goal is to return a final answer by interacting with the JSON.\nYou have access to the f... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.json.base.create_json_agent.html |
e2b1d9e19a77-2 | to see what keys exist at that path.\nDo not simply refer the user to the JSON or a section of the JSON, as this is not a valid answer. Keep digging until you find the answer and explicitly return it.\n', suffix: str = 'Begin!"\n\nQuestion: {input}\nThought: I should look at the keys that exist in data to see what I ha... | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.json.base.create_json_agent.html |
e2b1d9e19a77-3 | Construct a json agent from an LLM and tools. | https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.json.base.create_json_agent.html |
6189fa0cd240-0 | langchain.agents.conversational_chat.base.ConversationalChatAgent¶
class langchain.agents.conversational_chat.base.ConversationalChatAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None, template_tool_response: str = "TOOL RESPONSE: \n---------------------\n{o... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational_chat.base.ConversationalChatAgent.html |
6189fa0cd240-1 | Given input, decided what to do.
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. | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational_chat.base.ConversationalChatAgent.html |
6189fa0cd240-2 | **kwargs – User inputs.
Returns
Action specifying what tool to use.
classmethod create_prompt(tools: Sequence[BaseTool], system_message: 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... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational_chat.base.ConversationalChatAgent.html |
6189fa0cd240-3 | Create a prompt for this class.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of agent. | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational_chat.base.ConversationalChatAgent.html |
6189fa0cd240-4 | classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, system_message: str = 'Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a ... | https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational_chat.base.ConversationalChatAgent.html |
6189fa0cd240-5 | 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_chat.base.ConversationalChatAgent.html |
5e564e475d39-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 |
a20a0663e014-0 | langchain.agents.react.base.ReActDocstoreAgent¶
class langchain.agents.react.base.ReActDocstoreAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: Agent
Agent for the ReAct chain.
Create a new model by parsing and validating input data from k... | https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.ReActDocstoreAgent.html |
a20a0663e014-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.ReActDocstoreAgent.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.