id stringlengths 14 16 | text stringlengths 36 2.73k | source stringlengths 49 117 |
|---|---|---|
b3b9864775da-6 | classmethod create_prompt(tools: Sequence[langchain.tools.base.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 ... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-7 | powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.\n\nTOOLS:\n------\n\nAssistant has access to the follo... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-8 | 'AI', human_prefix: str = 'Human', input_variables: Optional[List[str]] = None) → langchain.prompts.prompt.PromptTemplate[source]# | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-9 | 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://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-10 | classmethod from_llm_and_tools(llm: langchain.base_language.BaseLanguageModel, tools: Sequence[langchain.tools.base.BaseTool], callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, output_parser: Optional[langchain.agents.agent.AgentOutputParser] = None, prefix: str = 'Assistant is a large la... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-11 | receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-12 | 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, **kwargs: Any) → langchain.agents.agent.Agent[source]# | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-13 | Construct an agent from an LLM and tools.
property llm_prefix: str#
Prefix to append the llm call with.
property observation_prefix: str#
Prefix to append the observation with.
pydantic model langchain.agents.ConversationalChatAgent[source]#
An agent designed to hold a conversation in addition to using tools.
field out... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-14 | classmethod create_prompt(tools: Sequence[langchain.tools.base.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-depth explanations and discussions on a wide r... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-15 | classmethod from_llm_and_tools(llm: langchain.base_language.BaseLanguageModel, tools: Sequence[langchain.tools.base.BaseTool], callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, output_parser: Optional[langchain.agents.agent.AgentOutputParser] = None, system_message: str = 'Assistant is a ... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-16 | it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific questi... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-17 | Construct an agent from an LLM and tools.
property llm_prefix: str#
Prefix to append the llm call with.
property observation_prefix: str#
Prefix to append the observation with.
pydantic model langchain.agents.LLMSingleActionAgent[source]#
field llm_chain: langchain.chains.llm.LLMChain [Required]#
field output_parser: l... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-18 | pydantic model langchain.agents.MRKLChain[source]#
Chain that implements the MRKL system.
Example
from langchain import OpenAI, MRKLChain
from langchain.chains.mrkl.base import ChainConfig
llm = OpenAI(temperature=0)
prompt = PromptTemplate(...)
chains = [...]
mrkl = MRKLChain.from_chains(llm=llm, prompt=prompt)
Valida... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-19 | action_description="useful for doing math"
)
]
mrkl = MRKLChain.from_chains(llm, chains)
pydantic model langchain.agents.ReActChain[source]#
Chain that implements the ReAct paper.
Example
from langchain import ReActChain, OpenAI
react = ReAct(llm=OpenAI())
Validators
raise_deprecation » all fields
set_verbose » ver... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-20 | field output_parser: langchain.agents.agent.AgentOutputParser [Optional]#
classmethod create_prompt(tools: Sequence[langchain.tools.base.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... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-21 | classmethod from_llm_and_tools(llm: langchain.base_language.BaseLanguageModel, tools: Sequence[langchain.tools.base.BaseTool], callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, output_parser: Optional[langchain.agents.agent.AgentOutputParser] = None, prefix: str = 'Respond to the human as... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-22 | Construct an agent from an LLM and tools.
property llm_prefix: str#
Prefix to append the llm call with.
property observation_prefix: str#
Prefix to append the observation with.
pydantic model langchain.agents.Tool[source]#
Tool that takes in function or coroutine directly.
field coroutine: Optional[Callable[[...], Awai... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-23 | field output_parser: langchain.agents.agent.AgentOutputParser [Optional]#
classmethod create_prompt(tools: Sequence[langchain.tools.base.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_scratchp... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-24 | Returns
A PromptTemplate with the template assembled from the pieces here.
classmethod from_llm_and_tools(llm: langchain.base_language.BaseLanguageModel, tools: Sequence[langchain.tools.base.BaseTool], callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, output_parser: Optional[langchain.age... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-25 | langchain.agents.create_json_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: langchain.agents.agent_toolkits.json.toolkit.JsonToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with JSON.\nYour goal is to return a... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-26 | use it.\nYou should only add one key at a time to the path. You cannot add multiple keys at once.\nIf you encounter a "KeyError", go back to the previous key, look at the available keys, and try again.\n\nIf the question does not seem to be related to the JSON, just return "I don\'t know" as the answer.\nAlways begin y... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-27 | 'Begin!"\n\nQuestion: {input}\nThought: I should look at the keys that exist in data to see what I have access to\n{agent_scratchpad}', format_instructions: str = 'Use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, sh... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-28 | Construct a json agent from an LLM and tools. | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-29 | langchain.agents.create_openapi_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: langchain.agents.agent_toolkits.openapi.toolkit.OpenAPIToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = "You are an agent designed to answer questions by making web reque... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-30 | which parameters are required. For parameters with a fixed set of values, please use the spec to look at which values are allowed.\n\nUse the exact parameter names as listed in the spec, do not make up any names or abbreviate the names of parameters.\nIf you get a not found error, ensure that you are using a path that ... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-31 | None, max_iterations: Optional[int] = 15, max_execution_time: Optional[float] = None, early_stopping_method: str = 'force', verbose: bool = False, return_intermediate_steps: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → langchain.agents.agent.AgentExecutor[source]# | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-32 | Construct a json agent from an LLM and tools.
langchain.agents.create_pandas_dataframe_agent(llm: langchain.base_language.BaseLanguageModel, df: Any, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = '\nYou are working with a pandas dataframe in Python. The name of the dataf... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-33 | langchain.agents.create_pbi_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: Optional[langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit], powerbi: Optional[langchain.utilities.powerbi.PowerBIDataset] = None, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, pref... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-34 | format for a human, also make sure to represent numbers in readable ways, like 1M instead of 1000000. Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results.\n', suffix: str = 'Begin!\n\nQuestion: {input}\nThought: I can first ask which tables I h... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-35 | Optional[List[str]] = None, top_k: int = 10, verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → langchain.agents.agent.AgentExecutor[source]# | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-36 | Construct a pbi agent from an LLM and tools. | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-37 | langchain.agents.create_pbi_chat_agent(llm: langchain.chat_models.base.BaseChatModel, toolkit: Optional[langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit], powerbi: Optional[langchain.utilities.powerbi.PowerBIDataset] = None, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, ... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-38 | rows are asked find a way to write that in a easily readible format for a human, also make sure to represent numbers in readable ways, like 1M instead of 1000000. Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results.\n', suffix: str = "TOOLS\n--... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-39 | 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.
langchain.agents.create_spark_dataframe_agent(llm: langchain.llms.base.BaseLLM, df: Any, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = '\... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-40 | langchain.agents.create_spark_sql_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: langchain.agents.agent_toolkits.spark_sql.toolkit.SparkSQLToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with Spark SQL.\nGiven... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-41 | rewrite the query and try again.\n\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\n\nIf the question does not seem related to the database, just return "I don\'t know" as the answer.\n', suffix: str = 'Begin!\n\nQuestion: {input}\nThought: I should look at the tables in the databas... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-42 | str = 'force', verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → langchain.agents.agent.AgentExecutor[source]# | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-43 | Construct a sql agent from an LLM and tools. | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-44 | langchain.agents.create_sql_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: langchain.agents.agent_toolkits.sql.toolkit.SQLDatabaseToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with a SQL database.\nGiven an ... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-45 | rewrite the query and try again.\n\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\n\nIf the question does not seem related to the database, just return "I don\'t know" as the answer.\n', suffix: str = 'Begin!\n\nQuestion: {input}\nThought: I should look at the tables in the databas... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-46 | str = 'force', verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → langchain.agents.agent.AgentExecutor[source]# | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-47 | Construct a sql agent from an LLM and tools.
langchain.agents.create_vectorstore_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = 'You are ... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-48 | Construct a vectorstore router agent from an LLM and tools.
langchain.agents.get_all_tool_names() → List[str][source]#
Get a list of all possible tool names.
langchain.agents.initialize_agent(tools: Sequence[langchain.tools.base.BaseTool], llm: langchain.base_language.BaseLanguageModel, agent: Optional[langchain.agents... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-49 | langchain.agents.load_tools(tool_names: List[str], llm: Optional[langchain.base_language.BaseLanguageModel] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None, **kwargs: Any) → List[langchain.tools.base.BaseTool][source]#
Load tool... | https://python.langchain.com/en/latest/reference/modules/agents.html |
b3b9864775da-50 | Tools
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 25, 2023. | https://python.langchain.com/en/latest/reference/modules/agents.html |
14a7ec450155-0 | .rst
.pdf
Experimental Modules
Contents
Autonomous Agents
Generative Agents
Experimental Modules#
This module contains experimental modules and reproductions of existing work using LangChain primitives.
Autonomous Agents#
Here, we document the BabyAGI and AutoGPT classes from the langchain.experimental module.
class ... | https://python.langchain.com/en/latest/reference/modules/experimental.html |
14a7ec450155-1 | Get the next task.
property input_keys: List[str]#
Input keys this chain expects.
property output_keys: List[str]#
Output keys this chain expects.
prioritize_tasks(this_task_id: int, objective: str) → List[Dict][source]#
Prioritize tasks.
class langchain.experimental.AutoGPT(ai_name: str, memory: langchain.vectorstores... | https://python.langchain.com/en/latest/reference/modules/experimental.html |
14a7ec450155-2 | Summary of the events in the plan that the agent took.
generate_dialogue_response(observation: str, now: Optional[datetime.datetime] = None) → Tuple[bool, str][source]#
React to a given observation.
generate_reaction(observation: str, now: Optional[datetime.datetime] = None) → Tuple[bool, str][source]#
React to a given... | https://python.langchain.com/en/latest/reference/modules/experimental.html |
14a7ec450155-3 | field traits: str = 'N/A'#
Permanent traits to ascribe to the character.
class langchain.experimental.GenerativeAgentMemory(*, llm: langchain.base_language.BaseLanguageModel, memory_retriever: langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever, verbose: bool = False, reflection_threshold: Opt... | https://python.langchain.com/en/latest/reference/modules/experimental.html |
14a7ec450155-4 | The core language model.
load_memory_variables(inputs: Dict[str, Any]) → Dict[str, str][source]#
Return key-value pairs given the text input to the chain.
field memory_retriever: langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever [Required]#
The retriever to fetch related memories.
property m... | https://python.langchain.com/en/latest/reference/modules/experimental.html |
84f1958c70b4-0 | .rst
.pdf
Memory
Memory#
class langchain.memory.CassandraChatMessageHistory(contact_points: List[str], session_id: str, port: int = 9042, username: str = 'cassandra', password: str = 'cassandra', keyspace_name: str = 'chat_history', table_name: str = 'message_store')[source]#
Chat message history that stores history in... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-1 | Validators
check_input_key » memories
check_repeated_memory_variable » memories
field memories: List[langchain.schema.BaseMemory] [Required]#
For tracking all the memories that should be accessed.
clear() → None[source]#
Clear context from this session for every memory.
load_memory_variables(inputs: Dict[str, Any]) → D... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-2 | field entity_extraction_prompt: langchain.prompts.base.BasePromptTemplate = PromptTemplate(input_variables=['history', 'input'], output_parser=None, partial_variables={}, template='You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last l... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-3 | a lot of work! What kind of things are you doing to make Langchain better?"\nLast line:\nPerson #1: i\'m trying to improve Langchain\'s interfaces, the UX, its integrations with various products the user might want ... a lot of stuff.\nOutput: Langchain\nEND OF EXAMPLE\n\nEXAMPLE\nConversation history:\nPerson #1: how\... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-4 | field entity_store: langchain.memory.entity.BaseEntityStore [Optional]#
field entity_summarization_prompt: langchain.prompts.base.BasePromptTemplate = PromptTemplate(input_variables=['entity', 'summary', 'history', 'input'], output_parser=None, partial_variables={}, template='You are an AI assistant helping a human kee... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-5 | Knowledge graph memory for storing conversation memory.
Integrates with external knowledge graph to store and retrieve
information about knowledge triples in the conversation.
field ai_prefix: str = 'AI'# | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-6 | field entity_extraction_prompt: langchain.prompts.base.BasePromptTemplate = PromptTemplate(input_variables=['history', 'input'], output_parser=None, partial_variables={}, template='You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last l... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-7 | a lot of work! What kind of things are you doing to make Langchain better?"\nLast line:\nPerson #1: i\'m trying to improve Langchain\'s interfaces, the UX, its integrations with various products the user might want ... a lot of stuff.\nOutput: Langchain\nEND OF EXAMPLE\n\nEXAMPLE\nConversation history:\nPerson #1: how\... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-8 | field human_prefix: str = 'Human'#
field k: int = 2#
field kg: langchain.graphs.networkx_graph.NetworkxEntityGraph [Optional]# | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-9 | field knowledge_extraction_prompt: langchain.prompts.base.BasePromptTemplate = PromptTemplate(input_variables=['history', 'input'], output_parser=None, partial_variables={}, template="You are a networked intelligence helping a human track knowledge triples about all relevant people, things, concepts, etc. and integrati... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-10 | It's also the number 1 producer of gold in the US.\n\nOutput: (Nevada, is a, state)<|>(Nevada, is in, US)<|>(Nevada, is the number 1 producer of, gold)\nEND OF EXAMPLE\n\nEXAMPLE\nConversation history:\nPerson #1: Hello.\nAI: Hi! How are you?\nPerson #1: I'm good. How are you?\nAI: I'm good too.\nLast line of conversat... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-11 | huh. I know Descartes likes to drive antique scooters and play the mandolin.\nOutput: (Descartes, likes to drive, antique scooters)<|>(Descartes, plays, mandolin)\nEND OF EXAMPLE\n\nConversation history (for reference only):\n{history}\nLast line of conversation (for extraction):\nHuman: {input}\n\nOutput:", template_f... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-12 | field llm: langchain.base_language.BaseLanguageModel [Required]#
field summary_message_cls: Type[langchain.schema.BaseMessage] = <class 'langchain.schema.SystemMessage'>#
Number of previous utterances to include in the context.
clear() → None[source]#
Clear memory contents.
get_current_entities(input_string: str) → Lis... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-13 | field memory_key: str = 'history'#
field moving_summary_buffer: str = ''#
clear() → None[source]#
Clear memory contents.
load_memory_variables(inputs: Dict[str, Any]) → Dict[str, Any][source]#
Return history buffer.
prune() → None[source]#
Prune buffer if it exceeds max token limit
save_context(inputs: Dict[str, Any], ... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-14 | Save context from this conversation to buffer. Pruned.
property buffer: List[langchain.schema.BaseMessage]#
String buffer of memory.
class langchain.memory.CosmosDBChatMessageHistory(cosmos_endpoint: str, cosmos_database: str, cosmos_container: str, session_id: str, user_id: str, credential: Any = None, connection_stri... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-15 | append(message: langchain.schema.BaseMessage) → None[source]#
Append the message to the record in DynamoDB
clear() → None[source]#
Clear session memory from DynamoDB
property messages: List[langchain.schema.BaseMessage]#
Retrieve the messages from DynamoDB
class langchain.memory.FileChatMessageHistory(file_path: str)[s... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-16 | Chat message history that stores history in MongoDB.
Parameters
connection_string – connection string to connect to MongoDB
session_id – arbitrary key that is used to store the messages
of a single chat session.
database_name – name of the database to use
collection_name – name of the collection to use
add_ai_message(m... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-17 | Load memory variables from memory.
save_context(inputs: Dict[str, Any], outputs: Dict[str, str]) → None[source]#
Nothing should be saved or changed
property memory_variables: List[str]#
Return memory variables.
class langchain.memory.RedisChatMessageHistory(session_id: str, url: str = 'redis://localhost:6379/0', key_pr... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-18 | get(key: str, default: Optional[str] = None) → Optional[str][source]#
Get entity value from store.
key_prefix: str = 'memory_store'#
recall_ttl: Optional[int] = 259200#
redis_client: Any#
session_id: str = 'default'#
set(key: str, value: Optional[str]) → None[source]#
Set entity value in store.
ttl: Optional[int] = 864... | https://python.langchain.com/en/latest/reference/modules/memory.html |
84f1958c70b4-19 | clear() → None[source]#
Nothing to clear.
load_memory_variables(inputs: Dict[str, Any]) → Dict[str, Union[List[langchain.schema.Document], str]][source]#
Return history buffer.
save_context(inputs: Dict[str, Any], outputs: Dict[str, str]) → None[source]#
Save context from this conversation to buffer.
property memory_va... | https://python.langchain.com/en/latest/reference/modules/memory.html |
555c1760e32c-0 | .rst
.pdf
Tools
Tools#
Core toolkit implementations.
pydantic model langchain.tools.AIPluginTool[source]#
field api_spec: str [Required]#
field args_schema: Type[AIPluginToolSchema] = <class 'langchain.tools.plugin.AIPluginToolSchema'>#
Pydantic model class to validate and parse the tool’s input arguments.
field plugin... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-1 | to_typescript() → str[source]#
Get typescript string representation of the operation.
static ts_type_from_python(type_: Union[str, Type, tuple, None, enum.Enum]) → str[source]#
property body_params: List[str]#
property path_params: List[str]#
property query_params: List[str]#
pydantic model langchain.tools.AzureCogsFor... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-2 | pydantic model langchain.tools.BaseTool[source]#
Interface LangChain tools must implement.
field args_schema: Optional[Type[pydantic.main.BaseModel]] = None#
Pydantic model class to validate and parse the tool’s input arguments.
field callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None#
Depr... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-3 | Run the tool.
property args: dict#
property is_single_input: bool#
Whether the tool only accepts a single input.
pydantic model langchain.tools.BingSearchResults[source]#
Tool that has capability to query the Bing Search API and get back json.
field api_wrapper: langchain.utilities.bing_search.BingSearchAPIWrapper [Req... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-4 | The unique name of the tool that clearly communicates its purpose.
pydantic model langchain.tools.CurrentWebPageTool[source]#
field args_schema: Type[BaseModel] = <class 'pydantic.main.BaseModel'>#
Pydantic model class to validate and parse the tool’s input arguments.
field description: str = 'Returns the URL of the cu... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-5 | pydantic model langchain.tools.ExtractHyperlinksTool[source]#
Extract all hyperlinks on the page.
field args_schema: Type[BaseModel] = <class 'langchain.tools.playwright.extract_hyperlinks.ExtractHyperlinksToolInput'>#
Pydantic model class to validate and parse the tool’s input arguments.
field description: str = 'Extr... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-6 | You can provide few-shot examples as a part of the description.
field name: str = 'file_search'#
The unique name of the tool that clearly communicates its purpose.
pydantic model langchain.tools.GetElementsTool[source]#
field args_schema: Type[BaseModel] = <class 'langchain.tools.playwright.get_elements.GetElementsTool... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-7 | Pydantic model class to validate and parse the tool’s input arguments.
field description: str = 'Use this tool to fetch an email by message ID. Returns the thread ID, snipet, body, subject, and sender.'#
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-8 | field name: str = 'search_gmail'#
The unique name of the tool that clearly communicates its purpose.
pydantic model langchain.tools.GmailSendMessage[source]#
field description: str = 'Use this tool to send email messages. The input is the message, recipents'#
Used to tell the model how/when/why to use the tool.
You can... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-9 | Tool that adds the capability to ask user for input.
field input_func: Callable [Optional]#
field prompt_func: Callable[[str], None] [Optional]#
pydantic model langchain.tools.IFTTTWebhook[source]#
IFTTT Webhook.
Parameters
name – name of the tool
description – description of the tool
url – url to hit with the json eve... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-10 | pydantic model langchain.tools.MoveFileTool[source]#
field args_schema: Type[pydantic.main.BaseModel] = <class 'langchain.tools.file_management.move.FileMoveInput'>#
Pydantic model class to validate and parse the tool’s input arguments.
field description: str = 'Move or rename a file from one location to another'#
Used... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-11 | The unique name of the tool that clearly communicates its purpose.
pydantic model langchain.tools.OpenAPISpec[source]#
OpenAPI Model that removes misformatted parts of the spec.
classmethod from_file(path: Union[str, pathlib.Path]) → langchain.tools.openapi.utils.openapi_utils.OpenAPISpec[source]#
Get an OpenAPI spec f... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-12 | Get the components for a given operation.
get_referenced_schema(ref: openapi_schema_pydantic.v3.v3_1_0.reference.Reference) → openapi_schema_pydantic.v3.v3_1_0.schema.Schema[source]#
Get a schema (or nested reference) or err.
get_request_body_for_operation(operation: openapi_schema_pydantic.v3.v3_1_0.operation.Operatio... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-13 | field llm_chain: langchain.chains.llm.LLMChain [Required]#
field max_iterations: int = 5#
field powerbi: langchain.utilities.powerbi.PowerBIDataset [Required]#
field session_cache: Dict[str, Any] [Optional]# | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-14 | field template: Optional[str] = '\nAnswer the question below with a DAX query that can be sent to Power BI. DAX queries have a simple syntax comprised of just one required keyword, EVALUATE, and several optional keywords: ORDER BY, START AT, DEFINE, MEASURE, VAR, TABLE, and COLUMN. Each keyword defines a statement used... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-15 | columns, expressions, and values. However, some functions, such as PI, do not require any arguments, but always require parentheses to indicate the null argument. For example, you must always type PI(), not PI. You can also nest functions within other functions. \n\nSome commonly used functions are:\nEVALUATE <table> -... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-16 | VAR; EVALUATE <table> - The optional DEFINE keyword introduces one or more calculated entity definitions that exist only for the duration of the query. Definitions precede the EVALUATE statement and are valid for all EVALUATE statements in the query. Definitions can be variables, measures, tables1, and columns1. Defini... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-17 | <filter> is a Boolean expression that is to be evaluated for each row of the table. For example, [Amount] > 0 or [Region] = "France"\nROW(<name>, <expression>) - Returns a table with a single row containing values that result from the expressions given to each column.\nDISTINCT(<column>) - Returns a one-column table th... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-18 | Functions names with an X in it can include a expression as an argument, this will be evaluated for each row in the table and the result will be used in the regular function calculation, these are the functions:\nCOUNT(<column>), COUNTA(<column>), COUNTX(<table>,<expression>), COUNTAX(<table>,<expression>), COUNTROWS([... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-19 | Returns a date value that represents the specified year, month, and day.\nDATEDIFF(date1, date2, <interval>) - Returns the difference between two date values, in the specified interval, that can be SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR.\nDATEVALUE(<date_text>) - Returns a date value that represents the ... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-20 | case you need to rewrite the DAX query to get the correct answer.\n\nThe following tables exist: {tables}\n\nand the schema\'s for some are given here:\n{schemas}\n\nExamples:\n{examples}\n\nQuestion: {tool_input}\nDAX: \n'# | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-21 | pydantic model langchain.tools.ReadFileTool[source]#
field args_schema: Type[pydantic.main.BaseModel] = <class 'langchain.tools.file_management.read.ReadFileInput'>#
Pydantic model class to validate and parse the tool’s input arguments.
field description: str = 'Read file from disk'#
Used to tell the model how/when/why... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-22 | The input arguments’ schema.
The tool schema.
field coroutine: Optional[Callable[[...], Awaitable[Any]]] = None#
The asynchronous version of the function.
field description: str = ''#
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
field func: Callabl... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-23 | The function to run when the tool is called.
field name: str [Required]#
The unique name of the tool that clearly communicates its purpose.
field return_direct: bool = False#
Whether to return the tool’s output directly. Setting this to True means
that after the tool is called, the AgentExecutor will stop looping.
fiel... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-24 | Pydantic model class to validate and parse the tool’s input arguments.
field description: str = 'Write file to disk'#
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
field name: str = 'write_file'#
The unique name of the tool that clearly communicates... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-25 | Parameters
action_id – a specific action ID (from list actions) of the action to execute
(the set api_key must be associated with the action owner)
instructions – a natural language instruction string for using the action
(eg. “get the latest email from Mike Knoop” for “Gmail: find email” action)
params – a dict, optio... | https://python.langchain.com/en/latest/reference/modules/tools.html |
555c1760e32c-26 | field params: Optional[dict] = None#
field params_schema: Dict[str, str] [Optional]#
field zapier_description: str [Required]#
langchain.tools.tool(*args: Union[str, Callable], return_direct: bool = False, args_schema: Optional[Type[pydantic.main.BaseModel]] = None, infer_schema: bool = True) → Callable[source]#
Make t... | https://python.langchain.com/en/latest/reference/modules/tools.html |
d6af3da2f09b-0 | .rst
.pdf
SerpAPI
SerpAPI#
For backwards compatiblity.
pydantic model langchain.serpapi.SerpAPIWrapper[source]#
Wrapper around SerpAPI.
To use, you should have the google-search-results python package installed,
and the environment variable SERPAPI_API_KEY set with your API key, or pass
serpapi_api_key as a named param... | https://python.langchain.com/en/latest/reference/modules/serpapi.html |
dd61f16d7e97-0 | .rst
.pdf
Agent Toolkits
Agent Toolkits#
Agent toolkits.
pydantic model langchain.agents.agent_toolkits.AzureCognitiveServicesToolkit[source]#
Toolkit for Azure Cognitive Services.
get_tools() → List[langchain.tools.base.BaseTool][source]#
Get the tools in the toolkit.
pydantic model langchain.agents.agent_toolkits.Fil... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
dd61f16d7e97-1 | get_tools() → List[langchain.tools.base.BaseTool][source]#
Get the tools in the toolkit.
pydantic model langchain.agents.agent_toolkits.NLAToolkit[source]#
Natural Language API Toolkit Definition.
field nla_tools: Sequence[langchain.agents.agent_toolkits.nla.tool.NLATool] [Required]#
List of API Endpoint Tools.
classme... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.