Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
14
16
text
stringlengths
31
2.41k
source
stringlengths
54
121
ffe6a87f4f10-0
Models LangChain provides interfaces and integrations for a number of different types of models. LLMs Chat Models
https://api.python.langchain.com/en/latest/models.html
570abd027f9e-0
Model I/O LangChain provides interfaces and integrations for working with language models. Prompts Models Output Parsers
https://api.python.langchain.com/en/latest/model_io.html
9d241ef1116b-0
Prompts The reference guides here all relate to objects for working with Prompts. Prompt Templates Example Selector
https://api.python.langchain.com/en/latest/prompts.html
98f977de8f2f-0
Data connection LangChain has a number of modules that help you load, structure, store, and retrieve documents. Document Loaders Document Transformers Embeddings Vector Stores Retrievers
https://api.python.langchain.com/en/latest/data_connection.html
f0bec661129a-0
Embeddings Wrappers around embedding modules. class langchain.embeddings.OpenAIEmbeddings(*, client=None, model='text-embedding-ada-002', deployment='text-embedding-ada-002', openai_api_version=None, openai_api_base=None, openai_api_type=None, openai_proxy=None, embedding_ctx_length=8191, openai_api_key=None, openai_o...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-1
from langchain.embeddings.openai import OpenAIEmbeddings embeddings = OpenAIEmbeddings( deployment="your-embeddings-deployment-name", model="your-embeddings-model-name", openai_api_base="https://your-endpoint.openai.azure.com/", openai_api_type="azure", ) text = "This is a test query." query_result = em...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-2
The model name to pass to tiktoken when using this class. Tiktoken is used to count the number of tokens in documents to constrain them to be under a certain limit. By default, when set to None, this will be the same as the embedding model name. However, there are some cases where you may want to use this Embedding cla...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-3
Return type List[List[float]] embed_query(text)[source] Call out to OpenAI’s embedding endpoint for embedding query text. Parameters text (str) – The text to embed. Returns Embedding for the text. Return type List[float] class langchain.embeddings.HuggingFaceEmbeddings(*, client=None, model_name='sentence-transformers...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-4
Model name to use. embed_documents(texts)[source] Compute doc embeddings using a HuggingFace transformer model. Parameters texts (List[str]) – The list of texts to embed. Returns List of embeddings, one for each text. Return type List[List[float]] embed_query(text)[source] Compute query embeddings using a HuggingFace...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-5
Parameters texts (List[str]) – The list of texts to embed. Returns List of embeddings, one for each text. Return type List[List[float]] embed_query(text)[source] Call out to Cohere’s embedding endpoint. Parameters text (str) – The text to embed. Returns Embeddings for the text. Return type List[float] class langchain....
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-6
es_password (Optional[str]) – (str, optional): Elasticsearch password. Return type langchain.embeddings.elasticsearch.ElasticsearchEmbeddings Example from langchain.embeddings import ElasticsearchEmbeddings # Define the model ID and input field name (if different from default) model_id = "your_model_id" # Optional, onl...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-7
Example from elasticsearch import Elasticsearch from langchain.embeddings import ElasticsearchEmbeddings # Define the model ID and input field name (if different from default) model_id = "your_model_id" # Optional, only if different from 'text_field' input_field = "your_input_field" # Create Elasticsearch connection es...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-8
Bases: pydantic.main.BaseModel, langchain.embeddings.base.Embeddings Wrapper around llama.cpp embedding models. To use, you should have the llama-cpp-python library installed, and provide the path to the Llama model as a named parameter to the constructor. Check out: https://github.com/abetlen/llama-cpp-python Example ...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-9
Number of threads to use. If None, the number of threads is automatically determined. attribute seed: int = -1 Seed. If -1, a random seed is used. attribute use_mlock: bool = False Force system to keep model in RAM. attribute vocab_only: bool = False Only load the vocabulary, no weights. embed_documents(texts)[sourc...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-10
) Parameters client (Any) – repo_id (str) – task (Optional[str]) – model_kwargs (Optional[dict]) – huggingfacehub_api_token (Optional[str]) – Return type None attribute model_kwargs: Optional[dict] = None Key word arguments to pass to the model. attribute repo_id: str = 'sentence-transformers/all-mpnet-base-v2' ...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-11
embed (Any) – model_id (str) – Return type None attribute model_id: str = 'damo/nlp_corom_sentence-embedding_english-base' Model name to use. embed_documents(texts)[source] Compute doc embeddings using a modelscope embedding model. Parameters texts (List[str]) – The list of texts to embed. Returns List of embedding...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-12
Returns List of embeddings, one for each text. Return type List[List[float]] embed_query(text)[source] Compute query embeddings using a TensorflowHub embedding model. Parameters text (str) – The text to embed. Returns Embeddings for the text. Return type List[float] class langchain.embeddings.SagemakerEndpointEmbeddin...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-13
The content handler class that provides an input and output transform functions to handle formats between LLM and the endpoint. attribute credentials_profile_name: Optional[str] = None The name of the profile in the ~/.aws/credentials or ~/.aws/config files, which has either access keys or role information specified. ...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-14
Parameters text (str) – The text to embed. Returns Embeddings for the text. Return type List[float] class langchain.embeddings.HuggingFaceInstructEmbeddings(*, client=None, model_name='hkunlp/instructor-large', cache_folder=None, model_kwargs=None, encode_kwargs=None, embed_instruction='Represent the document for retri...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-15
attribute model_kwargs: Dict[str, Any] [Optional] Key word arguments to pass to the model. attribute model_name: str = 'hkunlp/instructor-large' Model name to use. attribute query_instruction: str = 'Represent the question for retrieving supporting documents: ' Instruction to use for embedding query. embed_documents...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-16
endpoint_url=endpoint_url, mosaicml_api_token="my-api-key" ) Parameters endpoint_url (str) – embed_instruction (str) – query_instruction (str) – retry_sleep (float) – mosaicml_api_token (Optional[str]) – Return type None attribute embed_instruction: str = 'Represent the document for retrieval: ' Instruction u...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-17
Runs custom embedding models on self-hosted remote hardware. Supported hardware includes auto-launched instances on AWS, GCP, Azure, and Lambda, as well as servers specified by IP address and SSH credentials (such as on-prem, or another cloud like Paperspace, Coreweave, etc.). To use, you should have the runhouse pytho...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-18
) Parameters cache (Optional[bool]) – verbose (bool) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) – tags (Optional[List[str]]) – pipeline_ref (Any) – clien...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-19
Returns Embeddings for the text. Return type List[float] class langchain.embeddings.SelfHostedHuggingFaceEmbeddings(*, cache=None, verbose=None, callbacks=None, callback_manager=None, tags=None, pipeline_ref=None, client=None, inference_fn=<function _embed_documents>, hardware=None, model_load_fn=<function load_embeddi...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-20
inference_fn (Callable) – hardware (Any) – model_load_fn (Callable) – load_fn_kwargs (Optional[dict]) – model_reqs (List[str]) – inference_kwargs (Any) – model_id (str) – Return type None attribute hardware: Any = None Remote hardware to send the inference function to. attribute inference_fn: Callable = <functi...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-21
Supported hardware includes auto-launched instances on AWS, GCP, Azure, and Lambda, as well as servers specified by IP address and SSH credentials (such as on-prem, or another cloud like Paperspace, Coreweave, etc.). To use, you should have the runhouse python package installed. Example from langchain.embeddings import...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-22
Requirements to install on hardware to inference the model. attribute query_instruction: str = 'Represent the question for retrieving supporting documents: ' Instruction to use for embedding query. embed_documents(texts)[source] Compute doc embeddings using a HuggingFace instruct model. Parameters texts (List[str]) –...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-23
the query for a document as similar as possible. To learn more, check out: https://docs.aleph-alpha.com/docs/tasks/semantic_embed/ Example from aleph_alpha import AlephAlphaAsymmetricSemanticEmbedding embeddings = AlephAlphaSymmetricSemanticEmbedding() document = "This is a content of the document" query = "What is the...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-24
attribute normalize: Optional[bool] = True Should returned embeddings be normalized embed_documents(texts)[source] Call out to Aleph Alpha’s asymmetric Document endpoint. Parameters texts (List[str]) – The list of texts to embed. Returns List of embeddings, one for each text. Return type List[List[float]] embed_query...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-25
aleph_alpha_api_key (Optional[str]) – Return type None embed_documents(texts)[source] Call out to Aleph Alpha’s Document endpoint. Parameters texts (List[str]) – The list of texts to embed. Returns List of embeddings, one for each text. Return type List[List[float]] embed_query(text)[source] Call out to Aleph Alpha’...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-26
embed_type_query (str) – minimax_group_id (Optional[str]) – minimax_api_key (Optional[str]) – Return type None attribute embed_type_db: str = 'db' For embed_documents attribute embed_type_query: str = 'query' For embed_query attribute endpoint_url: str = 'https://api.minimax.chat/v1/embeddings' Endpoint URL to us...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-27
If a specific credential profile should be used, you must pass the name of the profile from the ~/.aws/credentials file that is to be used. Make sure the credentials / roles used have the required policies to access the Bedrock service. Parameters client (Any) – region_name (Optional[str]) – credentials_profile_name ...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-28
only for compatibility with the embeddings interface. Returns List of embeddings, one for each text. Return type List[List[float]] embed_query(text)[source] Compute query embeddings using a Bedrock model. Parameters text (str) – The text to embed. Returns Embeddings for the text. Return type List[float] class langchai...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-29
deepinfra_api_token (Optional[str]) – Return type None attribute embed_instruction: str = 'passage: ' Instruction used to embed documents. attribute model_id: str = 'sentence-transformers/clip-ViT-B-32' Embeddings model to use. attribute model_kwargs: Optional[dict] = None Other model keyword args attribute normali...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-30
os.environ["DASHSCOPE_API_KEY"] = "your DashScope API KEY" from langchain.embeddings.dashscope import DashScopeEmbeddings embeddings = DashScopeEmbeddings( model="text-embedding-v1", ) text = "This is a test query." query_result = embeddings.embed_query(text) Parameters client (Any) – model (str) – dashscope_api_...
https://api.python.langchain.com/en/latest/modules/embeddings.html
f0bec661129a-31
it as a named parameter to the constructor. Example # Initialise with default model and instruction from langchain.embeddings import EmbaasEmbeddings emb = EmbaasEmbeddings() # Initialise with custom model and instruction from langchain.embeddings import EmbaasEmbeddings emb_model = "instructor-large" emb_inst = "Repre...
https://api.python.langchain.com/en/latest/modules/embeddings.html
c0aff4bf2256-0
Memory class langchain.memory.CassandraChatMessageHistory(contact_points, session_id, port=9042, username='cassandra', password='cassandra', keyspace_name='chat_history', table_name='message_store')[source] Bases: langchain.schema.BaseChatMessageHistory Chat message history that stores history in Cassandra. Parameter...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-1
None class langchain.memory.CombinedMemory(*, memories)[source] Bases: langchain.schema.BaseMemory Class for combining multiple memories’ data together. Parameters memories (List[langchain.schema.BaseMemory]) – Return type None attribute memories: List[langchain.schema.BaseMemory] [Required] For tracking all the mem...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-2
load_memory_variables(inputs)[source] Return history buffer. Parameters inputs (Dict[str, Any]) – Return type Dict[str, Any] property buffer: Any String buffer of memory. class langchain.memory.ConversationBufferWindowMemory(*, chat_memory=None, output_key=None, input_key=None, return_messages=False, human_prefix='H...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-3
class langchain.memory.ConversationEntityMemory(*, chat_memory=None, output_key=None, input_key=None, return_messages=False, human_prefix='Human', ai_prefix='AI', llm, entity_extraction_prompt=PromptTemplate(input_variables=['history', 'input'], output_parser=None, partial_variables={}, template='You are an AI assistan...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-4
"That sounds like 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. I\'m working with Person #2.\nOutput: Langchain, Person #2\nEND OF ...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-5
Bases: langchain.memory.chat_memory.BaseChatMemory Entity extractor & summarizer memory. Extracts named entities from the recent chat history and generates summaries. With a swapable entity store, persisting entities across conversations. Defaults to an in-memory entity store, and can be swapped out for a Redis, SQLite...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-6
attribute 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 la...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-7
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. I\'m working with Person #2.\nOutput: Langchain, Person #2\nEND OF EXAMPLE\n\nConversation history (for reference only):\n{history}\nLast line of conversation (for ext...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-8
attribute entity_store: langchain.memory.entity.BaseEntityStore [Optional] attribute 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 h...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-9
Parameters inputs (Dict[str, Any]) – Return type Dict[str, Any] save_context(inputs, outputs)[source] Save context from this conversation history to the entity store. Generates a summary for each entity in the entity cache by prompting the model, and saves these summaries to the entity store. Parameters inputs (Dict[...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-10
class langchain.memory.ConversationKGMemory(*, chat_memory=None, output_key=None, input_key=None, return_messages=False, k=2, human_prefix='Human', ai_prefix='AI', kg=None, knowledge_extraction_prompt=PromptTemplate(input_variables=['history', 'input'], output_parser=None, partial_variables={}, template="You are a netw...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-11
NONE\nEND OF EXAMPLE\n\nEXAMPLE\nConversation history:\nPerson #1: What do you know about Descartes?\nAI: Descartes was a French philosopher, mathematician, and scientist who lived in the 17th century.\nPerson #1: The Descartes I'm referring to is a standup comedian and interior designer from Montreal.\nAI: Oh yes, He ...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-12
history:\nPerson #1: how\'s it going today?\nAI: "It\'s going great! How about you?"\nPerson #1: good! busy working on Langchain. lots to do.\nAI: "That sounds like 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,...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-13
Bases: langchain.memory.chat_memory.BaseChatMemory Knowledge graph memory for storing conversation memory. Integrates with external knowledge graph to store and retrieve information about knowledge triples in the conversation. Parameters chat_memory (langchain.schema.BaseChatMessageHistory) – output_key (Optional[str]...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-14
attribute 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 la...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-15
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. I\'m working with Person #2.\nOutput: Langchain, Person #2\nEND OF EXAMPLE\n\nConversation history (for reference only):\n{history}\nLast line of conversation (for ext...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-16
attribute human_prefix: str = 'Human' attribute k: int = 2 attribute kg: langchain.graphs.networkx_graph.NetworkxEntityGraph [Optional]
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-17
attribute 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 integ...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-18
Descartes was a French philosopher, mathematician, and scientist who lived in the 17th century.\nPerson #1: The Descartes I'm referring to is a standup comedian and interior designer from Montreal.\nAI: Oh yes, He is a comedian and an interior designer. He has been in the industry for 30 years. His favorite food is bak...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-19
attribute llm: langchain.base_language.BaseLanguageModel [Required] attribute summary_message_cls: Type[langchain.schema.BaseMessage] = <class 'langchain.schema.SystemMessage'> Number of previous utterances to include in the context. clear()[source] Clear memory contents. Return type None get_current_entities(input_...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-20
attribute input_key: Optional[str] = None attribute output_key: Optional[str] = None clear()[source] Clear memory contents. Return type None load_memory_variables(inputs)[source] Return history buffer. Parameters inputs (Dict[str, Any]) – Return type Dict[str, str] save_context(inputs, outputs)[source] Save conte...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-21
Will always return list of memory variables. :meta private: class langchain.memory.ConversationSummaryBufferMemory(*, human_prefix='Human', ai_prefix='AI', llm, prompt=PromptTemplate(input_variables=['summary', 'new_lines'], output_parser=None, partial_variables={}, template='Progressively summarize the lines of conver...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-22
output_key (Optional[str]) – input_key (Optional[str]) – return_messages (bool) – max_token_limit (int) – moving_summary_buffer (str) – memory_key (str) – Return type None attribute max_token_limit: int = 2000 attribute memory_key: str = 'history' attribute moving_summary_buffer: str = '' clear()[source] Clea...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-23
Return type None property buffer: List[langchain.schema.BaseMessage] class langchain.memory.ConversationSummaryMemory(*, human_prefix='Human', ai_prefix='AI', llm, prompt=PromptTemplate(input_variables=['summary', 'new_lines'], output_parser=None, partial_variables={}, template='Progressively summarize the lines of co...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-24
input_key (Optional[str]) – return_messages (bool) – buffer (str) – memory_key (str) – Return type None attribute buffer: str = '' clear()[source] Clear memory contents. Return type None classmethod from_messages(llm, chat_memory, *, summarize_step=2, **kwargs)[source] Parameters llm (langchain.base_language.Bas...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-25
max_token_limit (int) – Return type None attribute ai_prefix: str = 'AI' attribute human_prefix: str = 'Human' attribute llm: langchain.base_language.BaseLanguageModel [Required] attribute max_token_limit: int = 2000 attribute memory_key: str = 'history' load_memory_variables(inputs)[source] Return history buffe...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-26
Retrieve the messages from Cosmos Return type None add_message(message)[source] Add a self-created message to the store Parameters message (langchain.schema.BaseMessage) – Return type None upsert_messages()[source] Update the cosmosdb item. Return type None clear()[source] Clear session memory from this memory and ...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-27
Parameters file_path (str) – path of the local file to store the messages. property messages: List[langchain.schema.BaseMessage] Retrieve the messages from the local file add_message(message)[source] Append the message to the record in the local file Parameters message (langchain.schema.BaseMessage) – Return type No...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-28
See https://gomomento.com/ Parameters session_id (str) – cache_client (momento.CacheClient) – cache_name (str) – key_prefix (str) – ttl (Optional[timedelta]) – ensure_cache_exists (bool) – classmethod from_client_params(session_id, cache_name, ttl, *, configuration=None, auth_token=None, **kwargs)[source] Constr...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-29
session_id (str) – arbitrary key that is used to store the messages of a single chat session. database_name (str) – name of the database to use collection_name (str) – name of the collection to use property messages: List[langchain.schema.BaseMessage] Retrieve the messages from MongoDB add_message(message)[source] Ap...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-30
Delete a session Return type None async init()[source] Return type None load_memory_variables(values)[source] Return key-value pairs given the text input to the chain. If None, return all memories Parameters values (Dict[str, Any]) – Return type Dict[str, Any] save_context(inputs, outputs)[source] Save context from...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-31
Nothing to clear, got a memory like a vault. Return type None load_memory_variables(inputs)[source] Load memory variables from memory. Parameters inputs (Dict[str, Any]) – Return type Dict[str, str] save_context(inputs, outputs)[source] Nothing should be saved or changed Parameters inputs (Dict[str, Any]) – outputs...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-32
that TTL is extended by 3 days every time the entity is read back. Parameters session_id (str) – url (str) – key_prefix (str) – ttl (Optional[int]) – recall_ttl (Optional[int]) – args (Any) – redis_client (Any) – Return type None attribute key_prefix: str = 'memory_store' attribute recall_ttl: Optional[int] = 2...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-33
property messages: List[langchain.schema.BaseMessage] Retrieve all messages from db add_message(message)[source] Append the message to the record in db Parameters message (langchain.schema.BaseMessage) – Return type None clear()[source] Clear session memory from db Return type None class langchain.memory.SQLiteEnti...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-34
Simple memory for storing context or other bits of information that shouldn’t ever change between prompts. Parameters memories (Dict[str, Any]) – Return type None attribute memories: Dict[str, Any] = {} clear()[source] Nothing to clear, got a memory like a vault. Return type None load_memory_variables(inputs)[source...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-35
attribute return_docs: bool = False Whether or not to return the result of querying the database directly. clear()[source] Nothing to clear. Return type None load_memory_variables(inputs)[source] Return history buffer. Parameters inputs (Dict[str, Any]) – Return type Dict[str, Union[List[langchain.schema.Document],...
https://api.python.langchain.com/en/latest/modules/memory.html
c0aff4bf2256-36
properties. For more information on the zep-python package, see: https://github.com/getzep/zep-python Parameters session_id (str) – url (str) – Return type None property messages: List[langchain.schema.BaseMessage] Retrieve messages from Zep memory property zep_messages: List[Message] Retrieve summary from Zep memo...
https://api.python.langchain.com/en/latest/modules/memory.html
025b560d46c1-0
Output Parsers class langchain.output_parsers.BooleanOutputParser(*, true_val='YES', false_val='NO')[source] Bases: langchain.schema.BaseOutputParser[bool] Parameters true_val (str) – false_val (str) – Return type None attribute false_val: str = 'NO' attribute true_val: str = 'YES' parse(text)[source] Parse the ...
https://api.python.langchain.com/en/latest/modules/output_parsers.html
025b560d46c1-1
Parameters text (str) – Return type List[str] class langchain.output_parsers.DatetimeOutputParser(*, format='%Y-%m-%dT%H:%M:%S.%fZ')[source] Bases: langchain.schema.BaseOutputParser[datetime.datetime] Parameters format (str) – Return type None attribute format: str = '%Y-%m-%dT%H:%M:%S.%fZ' get_format_instructions(...
https://api.python.langchain.com/en/latest/modules/output_parsers.html
025b560d46c1-2
Bases: langchain.schema.BaseOutputParser Parameters guard (Any) – api (Optional[Callable]) – args (Any) – kwargs (Any) – Return type None attribute api: Optional[Callable] = None attribute args: Any = None attribute guard: Any = None attribute kwargs: Any = None classmethod from_rail(rail_file, num_reasks=1, ap...
https://api.python.langchain.com/en/latest/modules/output_parsers.html
025b560d46c1-3
Class to parse the output of an LLM call to a list. Return type None abstract parse(text)[source] Parse the output of an LLM call. Parameters text (str) – Return type List[str] class langchain.output_parsers.OutputFixingParser(*, parser, retry_chain)[source] Bases: langchain.schema.BaseOutputParser[langchain.output_...
https://api.python.langchain.com/en/latest/modules/output_parsers.html
025b560d46c1-4
get_format_instructions()[source] Instructions on how the LLM output should be formatted. Return type str parse(completion)[source] Parse the output of an LLM call. A method which takes in a string (assumed output of a language model ) and parses it into some structure. Parameters text – output of language model comp...
https://api.python.langchain.com/en/latest/modules/output_parsers.html
025b560d46c1-5
no_update_value (Optional[str]) – Return type None attribute no_update_value: Optional[str] = None attribute output_key_to_format: Dict[str, str] [Required] attribute regex_pattern: str = "{}:\\s?([^.'\\n']*)\\.?" parse(text)[source] Parse the output of an LLM call. Parameters text (str) – Return type Dict[str, s...
https://api.python.langchain.com/en/latest/modules/output_parsers.html
025b560d46c1-6
Wraps a parser and tries to fix parsing errors. Does this by passing the original prompt and the completion to another LLM, and telling it the completion did not satisfy criteria in the prompt. Parameters parser (langchain.schema.BaseOutputParser[langchain.output_parsers.retry.T]) – retry_chain (langchain.chains.llm.L...
https://api.python.langchain.com/en/latest/modules/output_parsers.html
025b560d46c1-7
parse_with_prompt(completion, prompt_value)[source] Optional method to parse the output of an LLM call with a prompt. The prompt is largely provided in the event the OutputParser wants to retry or fix the output in some way, and needs information from the prompt to do so. Parameters completion (str) – output of langua...
https://api.python.langchain.com/en/latest/modules/output_parsers.html
025b560d46c1-8
attribute retry_chain: langchain.chains.llm.LLMChain [Required] classmethod from_llm(llm, parser, prompt=PromptTemplate(input_variables=['completion', 'error', 'prompt'], output_parser=None, partial_variables={}, template='Prompt:\n{prompt}\nCompletion:\n{completion}\n\nAbove, the Completion did not satisfy the constr...
https://api.python.langchain.com/en/latest/modules/output_parsers.html
025b560d46c1-9
Returns structured output Return type langchain.output_parsers.retry.T class langchain.output_parsers.StructuredOutputParser(*, response_schemas)[source] Bases: langchain.schema.BaseOutputParser Parameters response_schemas (List[langchain.output_parsers.structured.ResponseSchema]) – Return type None attribute respons...
https://api.python.langchain.com/en/latest/modules/output_parsers.html
1ace37f9e39e-0
Tools Core toolkit implementations. class langchain.tools.AIPluginTool(*, name, description, args_schema=<class 'langchain.tools.plugin.AIPluginToolSchema'>, return_direct=False, verbose=False, callbacks=None, callback_manager=None, handle_tool_error=False, plugin, api_spec)[source] Bases: langchain.tools.base.BaseTo...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-1
base_url (str) – path (str) – method (langchain.utilities.openapi.HTTPVerb) – properties (Sequence[langchain.tools.openapi.utils.api_models.APIProperty]) – request_body (Optional[langchain.tools.openapi.utils.api_models.APIRequestBody]) – Return type None attribute base_url: str [Required] The base URL of the ope...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-2
Return type str static ts_type_from_python(type_)[source] Parameters type_ (Union[str, Type, tuple, None, enum.Enum]) – Return type str property body_params: List[str] property path_params: List[str] property query_params: List[str] class langchain.tools.ArxivQueryRun(*, name='arxiv', description='A wrapper around...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-3
attribute api_wrapper: langchain.utilities.arxiv.ArxivAPIWrapper [Optional] class langchain.tools.AzureCogsFormRecognizerTool(*, name='azure_cognitive_services_form_recognizer', description='A wrapper around Azure Cognitive Services Form Recognizer. Useful for when you need to extract text, tables, and key-value pairs...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-4
doc_analysis_client (Any) – Return type None class langchain.tools.AzureCogsImageAnalysisTool(*, name='azure_cognitive_services_image_analysis', description='A wrapper around Azure Cognitive Services Image Analysis. Useful for when you need to analyze images. Input should be a url to an image.', args_schema=None, retu...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-5
analysis_options (Any) – Return type None class langchain.tools.AzureCogsSpeech2TextTool(*, name='azure_cognitive_services_speech2text', description='A wrapper around Azure Cognitive Services Speech2Text. Useful for when you need to transcribe audio to text. Input should be a url to an audio file.', args_schema=None, ...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-6
speech_config (Any) – Return type None class langchain.tools.AzureCogsText2SpeechTool(*, name='azure_cognitive_services_text2speech', description='A wrapper around Azure Cognitive Services Text2Speech. Useful for when you need to convert text to speech. ', args_schema=None, return_direct=False, verbose=False, callback...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-7
speech_config (Any) – Return type None class langchain.tools.BaseGraphQLTool(*, name='query_graphql', description="Β Β Β  Input to this tool is a detailed and correct GraphQL query, output is a result from the API.\nΒ Β Β  If the query is not correct, an error message will be returned.\nΒ Β Β  If an error is returned with 'Bad...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-8
Parameters requests_wrapper (langchain.requests.TextRequestsWrapper) – Return type None attribute requests_wrapper: langchain.requests.TextRequestsWrapper [Required] class langchain.tools.BaseSQLDatabaseTool(*, db)[source] Bases: pydantic.main.BaseModel Base tool for interacting with a SQL database. Parameters db (l...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-9
attribute args_schema: Optional[Type[pydantic.main.BaseModel]] = None Pydantic model class to validate and parse the tool’s input arguments. attribute callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None Deprecated. Please use callbacks instead. attribute callbacks: Optional[Union[List[lang...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-10
kwargs (Any) – Return type Any run(tool_input, verbose=None, start_color='green', color='green', callbacks=None, **kwargs)[source] Run the tool. Parameters tool_input (Union[str, Dict]) – verbose (Optional[bool]) – start_color (Optional[str]) – color (Optional[str]) – callbacks (Optional[Union[List[langchain.call...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-11
num_results (int) – api_wrapper (langchain.utilities.bing_search.BingSearchAPIWrapper) – Return type None attribute api_wrapper: langchain.utilities.bing_search.BingSearchAPIWrapper [Required] attribute num_results: int = 4 class langchain.tools.BingSearchRun(*, name='bing_search', description='A wrapper around Bin...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-12
Bases: langchain.tools.base.BaseTool Parameters name (str) – description (str) – args_schema (Optional[Type[pydantic.main.BaseModel]]) – return_direct (bool) – verbose (bool) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – callback_...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-13
callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) – handle_tool_error (Optional[Union[bool, str, Callable[[langchain.tools.base.ToolException], str]]]) – sync_browser (Optional['SyncBrowser']) – async_browser (Optional['AsyncBrowser']) – visible_only (bool) – playwright_strict (bool) – pla...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-14
Parameters name (str) – description (str) – args_schema (Type[pydantic.main.BaseModel]) – return_direct (bool) – verbose (bool) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – callback_manager (Optional[langchain.callbacks.base.Base...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-15
return_direct (bool) – verbose (bool) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) – handle_tool_error (Optional[Union[bool, str, Callable[[langchain.tools.b...
https://api.python.langchain.com/en/latest/modules/tools.html
1ace37f9e39e-16
callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) – handle_tool_error (Optional[Union[bool, str, Callable[[langchain.tools.base.ToolException], str]]]) – root_dir (Optional[str]) – Return type None attribute args_schema: Type[pydantic.main.BaseModel] = <class 'langchain.tools.file_management....
https://api.python.langchain.com/en/latest/modules/tools.html
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
4