id stringlengths 14 15 | text stringlengths 27 2.12k | source stringlengths 49 118 |
|---|---|---|
177a8ccdd721-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversMultiQueryRetrieverContextual compressionEnsemble RetrieverSelf-que... | https://python.langchain.com/docs/modules/data_connection/retrievers/time_weighted_vectorstore |
177a8ccdd721-2 | {})retriever = TimeWeightedVectorStoreRetriever(vectorstore=vectorstore, decay_rate=.0000000000000000000000001, k=1)yesterday = datetime.now() - timedelta(days=1)retriever.add_documents([Document(page_content="hello world", metadata={"last_accessed_at": yesterday})])retriever.add_documents([Document(page_content="hello... | https://python.langchain.com/docs/modules/data_connection/retrievers/time_weighted_vectorstore |
177a8ccdd721-3 | decay_rate=.999, k=1)yesterday = datetime.now() - timedelta(days=1)retriever.add_documents([Document(page_content="hello world", metadata={"last_accessed_at": yesterday})])retriever.add_documents([Document(page_content="hello foo")]) ['40011466-5bbe-4101-bfd1-e22e7f505de2']# "Hello Foo" is returned first because "he... | https://python.langchain.com/docs/modules/data_connection/retrievers/time_weighted_vectorstore |
23585a20860a-0 | Self-querying | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/ |
23585a20860a-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversMultiQueryRetrieverContextual compressionEnsemble RetrieverSelf-que... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/ |
23585a20860a-2 | environment=os.environ["PINECONE_ENV"])from langchain.schema import Documentfrom langchain.embeddings.openai import OpenAIEmbeddingsfrom langchain.vectorstores import Pineconeembeddings = OpenAIEmbeddings()# create new indexpinecone.create_index("langchain-self-retriever-demo", dimension=1536)docs = [ Document(page_... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/ |
23585a20860a-3 | docs, embeddings, index_name="langchain-self-retriever-demo")Creating our self-querying retriever​Now we can instantiate our retriever. To do this we'll need to provide some information upfront about the metadata fields that our documents support and a short description of the document contents.from langchain.llms im... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/ |
23585a20860a-4 | relevant queryretriever.get_relevant_documents("What are some movies about dinosaurs") query='dinosaur' filter=None [Document(page_content='A bunch of scientists bring back dinosaurs and mayhem breaks loose', metadata={'genre': ['action', 'science fiction'], 'rating': 7.7, 'year': 1993.0}), Document(page_cont... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/ |
23585a20860a-5 | ['science fiction', 'thriller'], 'rating': 9.9, 'year': 1979.0})]# This example specifies a query and a filterretriever.get_relevant_documents("Has Greta Gerwig directed any movies about women") query='women' filter=Comparison(comparator=<Comparator.EQ: 'eq'>, attribute='director', value='Greta Gerwig') [Document... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/ |
23585a20860a-6 | value=1990.0), Comparison(comparator=<Comparator.LT: 'lt'>, attribute='year', value=2005.0), Comparison(comparator=<Comparator.EQ: 'eq'>, attribute='genre', value='animated')]) [Document(page_content='Toys come alive and have a blast doing so', metadata={'genre': 'animated', 'year': 1995.0})]Filter k​We can also u... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/ |
ad4dac789bdd-0 | Chroma self-querying | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query |
ad4dac789bdd-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversMultiQueryRetrieverContextual compressionEnsemble RetrieverSelf-que... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query |
ad4dac789bdd-2 | Document( page_content="A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata={"year": 1993, "rating": 7.7, "genre": "science fiction"}, ), Document( page_content="Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", metadata={"year": 2... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query |
ad4dac789bdd-3 | "rating": 9.9, "director": "Andrei Tarkovsky", "genre": "science fiction", "rating": 9.9, }, ),]vectorstore = Chroma.from_documents(docs, embeddings) Using embedded DuckDB without persistence: data will be transientCreating our self-querying retriever​Now we can instantia... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query |
ad4dac789bdd-4 | ),]document_content_description = "Brief summary of a movie"llm = OpenAI(temperature=0)retriever = SelfQueryRetriever.from_llm( llm, vectorstore, document_content_description, metadata_field_info, verbose=True)Testing it out​And now we can try actually using our retriever!# This example only specifies a relevant q... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query |
ad4dac789bdd-5 | reused the idea', metadata={'year': 2006, 'director': 'Satoshi Kon', 'rating': 8.6}), Document(page_content='Three men walk into the Zone, three men walk out of the Zone', metadata={'year': 1979, 'rating': 9.9, 'director': 'Andrei Tarkovsky', 'genre': 'science fiction'})]# This example specifies a query and a filte... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query |
ad4dac789bdd-6 | 1990 but before 2005 that's all about toys, and preferably is animated") query='toys' filter=Operation(operator=<Operator.AND: 'and'>, arguments=[Comparison(comparator=<Comparator.GT: 'gt'>, attribute='year', value=1990), Comparison(comparator=<Comparator.LT: 'lt'>, attribute='year', value=2005), Comparison(comparat... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query |
ad4dac789bdd-7 | 'Satoshi Kon', 'rating': 8.6}), Document(page_content='Leo DiCaprio gets lost in a dream within a dream within a dream within a ...', metadata={'year': 2010, 'director': 'Christopher Nolan', 'rating': 8.2})]PreviousSelf-queryingNextDeepLake self-queryingCreating a Chroma vectorstoreCreating our self-querying retrie... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query |
f9f160ffcadb-0 | Self-querying with MyScale | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query |
f9f160ffcadb-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversMultiQueryRetrieverContextual compressionEnsemble RetrieverSelf-que... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query |
f9f160ffcadb-2 | proceed to the next step, we also want to remind you that clickhouse-connect is also needed to interact with your MyScale backend.pip install lark clickhouse-connectIn this tutorial we follow other example's setting and use OpenAIEmbeddings. Remember to get a OpenAI API Key for valid accesss to LLMs.import osimport get... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query |
f9f160ffcadb-3 | in a dream within a dream within a dream within a ...", metadata={"date": "2010-12-30", "director": "Christopher Nolan", "rating": 8.2}, ), Document( page_content="A psychologist / detective gets lost in a series of dreams within dreams within dreams and Inception reused the idea", metadata={... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query |
f9f160ffcadb-4 | "rating": 9.9, }, ),]vectorstore = MyScale.from_documents( docs, embeddings,)Creating our self-querying retriever​Just like other retrievers... Simple and nice.from langchain.llms import OpenAIfrom langchain.retrievers.self_query.base import SelfQueryRetrieverfrom langchain.chains.query_constructor.ba... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query |
f9f160ffcadb-5 | description="A 1-10 rating for the movie", type="float" ),]document_content_description = "Brief summary of a movie"llm = OpenAI(temperature=0)retriever = SelfQueryRetriever.from_llm( llm, vectorstore, document_content_description, metadata_field_info, verbose=True)Testing it out with self-query retriever's exist... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query |
f9f160ffcadb-6 | is like Andrei?")# Contain works for lists: so you can match a list with contain comparator!retriever.get_relevant_documents( "What's a movie who has genres science fiction and adventure?")Filter k​We can also use the self query retriever to specify k: the number of documents to fetch.We can do this by passing ena... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query |
34a815b81fe6-0 | Qdrant self-querying | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query |
34a815b81fe6-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversMultiQueryRetrieverContextual compressionEnsemble RetrieverSelf-que... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query |
34a815b81fe6-2 | import OpenAIEmbeddingsfrom langchain.vectorstores import Qdrantembeddings = OpenAIEmbeddings()docs = [ Document( page_content="A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata={"year": 1993, "rating": 7.7, "genre": "science fiction"}, ), Document( page_content... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query |
34a815b81fe6-3 | metadata={ "year": 1979, "rating": 9.9, "director": "Andrei Tarkovsky", "genre": "science fiction", }, ),]vectorstore = Qdrant.from_documents( docs, embeddings, location=":memory:", # Local mode with in-memory storage only collection_name="my_documents"... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query |
34a815b81fe6-4 | name="rating", description="A 1-10 rating for the movie", type="float" ),]document_content_description = "Brief summary of a movie"llm = OpenAI(temperature=0)retriever = SelfQueryRetriever.from_llm( llm, vectorstore, document_content_description, metadata_field_info, verbose=True)Testing it out​And now we can t... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query |
34a815b81fe6-5 | value=8.5) limit=None [Document(page_content='Three men walk into the Zone, three men walk out of the Zone', metadata={'year': 1979, 'rating': 9.9, 'director': 'Andrei Tarkovsky', 'genre': 'science fiction'}), Document(page_content='A psychologist / detective gets lost in a series of dreams within dreams within ... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query |
34a815b81fe6-6 | Tarkovsky', 'genre': 'science fiction'})]# This example specifies a query and composite filterretriever.get_relevant_documents( "What's a movie after 1990 but before 2005 that's all about toys, and preferably is animated") query='toys' filter=Operation(operator=<Operator.AND: 'and'>, arguments=[Comparison(compara... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query |
34a815b81fe6-7 | 'animated'})]PreviousSelf-querying with PineconeNextWeaviate self-queryingCreating a Qdrant vectorstoreCreating our self-querying retrieverTesting it outFilter kCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright © 2023 LangChain, Inc. | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query |
3b08d28ed2a9-0 | Self-querying with Pinecone | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone |
3b08d28ed2a9-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversMultiQueryRetrieverContextual compressionEnsemble RetrieverSelf-que... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone |
3b08d28ed2a9-2 | instead to force console mode (e.g. in jupyter console) from tqdm.autonotebook import tqdmfrom langchain.schema import Documentfrom langchain.embeddings.openai import OpenAIEmbeddingsfrom langchain.vectorstores import Pineconeembeddings = OpenAIEmbeddings()# create new indexpinecone.create_index("langchain-self-re... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone |
3b08d28ed2a9-3 | come alive and have a blast doing so", metadata={"year": 1995, "genre": "animated"}, ), Document( page_content="Three men walk into the Zone, three men walk out of the Zone", metadata={ "year": 1979, "rating": 9.9, "director": "Andrei Tarkovsky", "g... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone |
3b08d28ed2a9-4 | released", type="integer", ), AttributeInfo( name="director", description="The name of the movie director", type="string", ), AttributeInfo( name="rating", description="A 1-10 rating for the movie", type="float" ),]document_content_description = "Brief summary of a movi... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone |
3b08d28ed2a9-5 | metadata={'director': 'Christopher Nolan', 'rating': 8.2, 'year': 2010.0})]# This example only specifies a filterretriever.get_relevant_documents("I want to watch a movie rated higher than 8.5") query=' ' filter=Comparison(comparator=<Comparator.GT: 'gt'>, attribute='rating', value=8.5) [Document(page_content='A ... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone |
3b08d28ed2a9-6 | 'eq'>, attribute='genre', value='science fiction'), Comparison(comparator=<Comparator.GT: 'gt'>, attribute='rating', value=8.5)]) [Document(page_content='Three men walk into the Zone, three men walk out of the Zone', metadata={'director': 'Andrei Tarkovsky', 'genre': ['science fiction', 'thriller'], 'rating': 9.9, '... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone |
3b08d28ed2a9-7 | dinosaurs")PreviousSelf-querying with MyScaleNextQdrant self-queryingCreating a Pinecone indexCreating our self-querying retrieverTesting it outFilter kCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright © 2023 LangChain, Inc. | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone |
116f660c1da9-0 | Weaviate self-querying | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query |
116f660c1da9-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversMultiQueryRetrieverContextual compressionEnsemble RetrieverSelf-que... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query |
116f660c1da9-2 | dream within a ...", metadata={"year": 2010, "director": "Christopher Nolan", "rating": 8.2}, ), Document( page_content="A psychologist / detective gets lost in a series of dreams within dreams within dreams and Inception reused the idea", metadata={"year": 2006, "director": "Satoshi Kon", "r... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query |
116f660c1da9-3 | ),]vectorstore = Weaviate.from_documents( docs, embeddings, weaviate_url="http://127.0.0.1:8080")Creating our self-querying retriever​Now we can instantiate our retriever. To do this we'll need to provide some information upfront about the metadata fields that our documents support and a short description of the d... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query |
116f660c1da9-4 | This example only specifies a relevant queryretriever.get_relevant_documents("What are some movies about dinosaurs") query='dinosaur' filter=None limit=None [Document(page_content='A bunch of scientists bring back dinosaurs and mayhem breaks loose', metadata={'genre': 'science fiction', 'rating': 7.7, 'year': 199... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query |
116f660c1da9-5 | vectorstore, document_content_description, metadata_field_info, enable_limit=True, verbose=True,)# This example only specifies a relevant queryretriever.get_relevant_documents("what are two movies about dinosaurs") query='dinosaur' filter=None limit=2 [Document(page_content='A bunch of scientists brin... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query |
d007048864f9-0 | DeepLake self-querying | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query |
d007048864f9-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversMultiQueryRetrieverContextual compressionEnsemble RetrieverSelf-que... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query |
d007048864f9-2 | bring back dinosaurs and mayhem breaks loose", metadata={"year": 1993, "rating": 7.7, "genre": "science fiction"}, ), Document( page_content="Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", metadata={"year": 2010, "director": "Christopher Nolan", "rating": 8.2},... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query |
d007048864f9-3 | "director": "Andrei Tarkovsky", "genre": "science fiction", "rating": 9.9, }, ),]username_or_org = "<USER_NAME_OR_ORG>"vectorstore = DeepLake.from_documents( docs, embeddings, dataset_path=f"hub://{username_or_org}/self_queery") Your Deep Lake dataset has been successfully created!... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query |
d007048864f9-4 | metadata fields that our documents support and a short description of the document contents.from langchain.llms import OpenAIfrom langchain.retrievers.self_query.base import SelfQueryRetrieverfrom langchain.chains.query_constructor.base import AttributeInfometadata_field_info = [ AttributeInfo( name="genre", ... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query |
d007048864f9-5 | LLMChain. warnings.warn( query='dinosaur' filter=None limit=None [Document(page_content='A bunch of scientists bring back dinosaurs and mayhem breaks loose', metadata={'year': 1993, 'rating': 7.7, 'genre': 'science fiction'}), Document(page_content='Toys come alive and have a blast doing so', metadata={'... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query |
d007048864f9-6 | Tarkovsky', 'genre': 'science fiction'})]# This example specifies a query and a filterretriever.get_relevant_documents("Has Greta Gerwig directed any movies about women") query='women' filter=Comparison(comparator=<Comparator.EQ: 'eq'>, attribute='director', value='Greta Gerwig') limit=None [Document(page_content... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query |
d007048864f9-7 | 'lt'>, attribute='year', value=2005), Comparison(comparator=<Comparator.EQ: 'eq'>, attribute='genre', value='animated')]) limit=None [Document(page_content='Toys come alive and have a blast doing so', metadata={'year': 1995, 'genre': 'animated'})]Filter k​We can also use the self query retriever to specify k: the ... | https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query |
72f8b05fa9fa-0 | Text embedding models | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/data_connection/text_embedding/ |
72f8b05fa9fa-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversChainsMemoryAgentsCallbacksModulesGuidesEcosystemAdditional resourc... | https://python.langchain.com/docs/modules/data_connection/text_embedding/ |
72f8b05fa9fa-2 | OpenAI LLM class:from langchain.embeddings import OpenAIEmbeddingsembeddings_model = OpenAIEmbeddings(openai_api_key="...")otherwise you can initialize without any params:from langchain.embeddings import OpenAIEmbeddingsembeddings_model = OpenAIEmbeddings()embed_documents​Embed list of texts​embeddings = embeddings... | https://python.langchain.com/docs/modules/data_connection/text_embedding/ |
0729a0b080b7-0 | Agents | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/agents/ |
0729a0b080b7-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionChainsMemoryAgentsAgent typesHow-toToolsToolkitsCallbacksModulesGuidesEcosystemAdditional resourcesModulesAgentsOn this pageAgentsThe core idea of a... | https://python.langchain.com/docs/modules/agents/ |
0729a0b080b7-2 | If you don't describe the tools properly, the agent won't know how to properly use them.LangChain provides a wide set of tools to get started, but also makes it easy to define your own (including custom descriptions).
For a full list of tools, see hereToolkits​Often the set of tools an agent has access to is more imp... | https://python.langchain.com/docs/modules/agents/ |
0729a0b080b7-3 | We will then define custom tools, and then run it all in the standard LangChain AgentExecutor.Set up the agent​We will use the OpenAIFunctionsAgent.
This is easiest and best agent to get started with.
It does however require usage of ChatOpenAI models.
If you want to use a different language model, we would recommend... | https://python.langchain.com/docs/modules/agents/ |
0729a0b080b7-4 | This allows for a few different ways to customize, including passing in a custom SystemMessage, which we will do.from langchain.schema import SystemMessagesystem_message = SystemMessage(content="You are very powerful assistant, but bad at calculating lengths of words.")prompt = OpenAIFunctionsAgent.create_prompt(system... | https://python.langchain.com/docs/modules/agents/ |
0729a0b080b7-5 | We do this by adding a placeholder for messages with the key "chat_history".from langchain.prompts import MessagesPlaceholderMEMORY_KEY = "chat_history"prompt = OpenAIFunctionsAgent.create_prompt( system_message=system_message, extra_prompt_messages=[MessagesPlaceholder(variable_name=MEMORY_KEY)])Next, let's crea... | https://python.langchain.com/docs/modules/agents/ |
62db24a79b8d-0 | Agent types | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/agents/agent_types/ |
62db24a79b8d-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionChainsMemoryAgentsAgent typesConversationalOpenAI functionsOpenAI Multi Functions AgentPlan and executeReActReAct document storeSelf ask with search... | https://python.langchain.com/docs/modules/agents/agent_types/ |
62db24a79b8d-2 | The prompt is designed to make the agent helpful and conversational.
It uses the ReAct framework to decide which tool to use, and uses memory to remember the previous conversation interactions.Self ask with search​This agent utilizes a single tool that should be named Intermediate Answer.
This tool should be able to ... | https://python.langchain.com/docs/modules/agents/agent_types/ |
ef13765193a4-0 | Page Not Found | 🦜�🔗 Langchain
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKPage Not FoundWe could not find what you were looking for.Please contact the owner of the site that linked you to the original URL and let them know their link is broken.CommunityDisc... | https://python.langchain.com/docs/modules/agents/agent_types/react.html |
533c097eeae6-0 | Page Not Found | 🦜�🔗 Langchain
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKPage Not FoundWe could not find what you were looking for.Please contact the owner of the site that linked you to the original URL and let them know their link is broken.CommunityDisc... | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat.html |
8bcc7b05b3fe-0 | Page Not Found | 🦜�🔗 Langchain
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKPage Not FoundWe could not find what you were looking for.Please contact the owner of the site that linked you to the original URL and let them know their link is broken.CommunityDisc... | https://python.langchain.com/docs/modules/agents/agent_types/chat_conversation_agent.html |
d3be13be6cfe-0 | Self ask with search | 🦜�🔗 Langchain
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionChainsMemoryAgentsAgent typesConversationalOpenAI functionsOpenAI Multi Functions AgentPlan and ex... | https://python.langchain.com/docs/modules/agents/agent_types/self_ask_with_search |
31979d777674-0 | Structured tool chat | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat |
31979d777674-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionChainsMemoryAgentsAgent typesConversationalOpenAI functionsOpenAI Multi Functions AgentPlan and executeReActReAct document storeSelf ask with search... | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat |
31979d777674-2 | # Also works well with Anthropic modelsagent_chain = initialize_agent(tools, llm, agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION, verbose=True)response = await agent_chain.arun(input="Hi I'm Erica.")print(response) > Entering new AgentExecutor chain... Action: ``` { "action": "Fina... | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat |
31979d777674-3 | Action: ``` { "action": "extract_text", "action_input": {} } ``` Observation: LangChain LangChain Home About GitHub Docs LangChain The official LangChain blog. Auto-Evaluator Opportunities Editor's Note: this is a guest blog post by Lance Martin. TL;DR We recently open-sou... | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat |
31979d777674-4 | defined by the tools they have, so to be able to equip Apr 23, 2023 4 min read RecAlign - The smart content filter for social media feed [Editor's Note] This is a guest post by Tian Jin. We are highlighting this application as we think it is a novel use case. Specifically, we think recommendation systems are incredibly... | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat |
31979d777674-5 | Tasks By Lance Martin Context LLM ops platforms, such as LangChain, make it easy to assemble LLM components (e.g., models, document retrievers, data loaders) into chains. Question-Answering is one of the most popular applications of these chains. But it is often not always obvious to determine what parame... | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat |
31979d777674-6 | Agents One of the most common requests we've heard is better functionality and documentation for creating custom agents. This has always been a bit tricky - because in our mind it's actually still very unclear what an "agent" actually is, and therefore what the "right" abstractions for them may be. Recently, Apr 3, 202... | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat |
31979d777674-7 | to announce that we’ Mar 13, 2023 8 min read Origin Web Browser [Editor's Note]: This is the second of hopefully many guest posts. We intend to highlight novel applications building on top of LangChain. If you are interested in working with us on such a post, please reach out to harrison@langchain.dev. Authors... | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat |
31979d777674-8 | database or interacting with an OpenAPI spec). We hope to continue developing different toolkits that can enable agents to do amazing feats. Toolkits are supported Mar 1, 2023 3 min read TypeScript Support It's finally here... TypeScript support for LangChain. What does this mean? It means that all your favorite... | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat |
31979d777674-9 | to expand usability. The blog also discusses various opportunities to further improve the LangChain platform.response = await agent_chain.arun(input="What's the latest xkcd comic about?")print(response) > Entering new AgentExecutor chain... Thought: I can navigate to the xkcd website and extract the lates... | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat |
31979d777674-10 | you add in memory to this agentfrom langchain.prompts import MessagesPlaceholderfrom langchain.memory import ConversationBufferMemorychat_history = MessagesPlaceholder(variable_name="chat_history")memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)agent_chain = initialize_agent( tools,... | https://python.langchain.com/docs/modules/agents/agent_types/structured_chat |
b65633e2819d-0 | Page Not Found | 🦜�🔗 Langchain
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKPage Not FoundWe could not find what you were looking for.Please contact the owner of the site that linked you to the original URL and let them know their link is broken.CommunityDisc... | https://python.langchain.com/docs/modules/agents/agent_types/self_ask_with_search.html |
4d2fcc628c52-0 | ReAct document store | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/agents/agent_types/react_docstore |
4d2fcc628c52-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionChainsMemoryAgentsAgent typesConversationalOpenAI functionsOpenAI Multi Functions AgentPlan and executeReActReAct document storeSelf ask with search... | https://python.langchain.com/docs/modules/agents/agent_types/react_docstore |
4d2fcc628c52-2 | Thought: I need to search David Chanoff and find the U.S. Navy admiral he collaborated with. Then I need to find which President the admiral served under. Action: Search[David Chanoff] Observation: David Chanoff is a noted author of non-fiction work. His work has typically involved collaborations with the... | https://python.langchain.com/docs/modules/agents/agent_types/react_docstore |
4d2fcc628c52-3 | > Finished chain. 'Bill Clinton'PreviousReActNextSelf ask with searchCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright © 2023 LangChain, Inc. | https://python.langchain.com/docs/modules/agents/agent_types/react_docstore |
6177e5a9f570-0 | ReAct | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/agents/agent_types/react |
6177e5a9f570-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionChainsMemoryAgentsAgent typesConversationalOpenAI functionsOpenAI Multi Functions AgentPlan and executeReActReAct document storeSelf ask with search... | https://python.langchain.com/docs/modules/agents/agent_types/react |
6177e5a9f570-2 | Camila Morrone Thought: I need to find out Camila Morrone's age Action: Search Action Input: "Camila Morrone age" Observation: 25 years Thought: I need to calculate 25 raised to the 0.43 power Action: Calculator Action Input: 25^0.43 Observation: Answer: 3.991298452658078 Thought: I now k... | https://python.langchain.com/docs/modules/agents/agent_types/react |
7bdc6867ba9a-0 | Page Not Found | 🦜�🔗 Langchain
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKPage Not FoundWe could not find what you were looking for.Please contact the owner of the site that linked you to the original URL and let them know their link is broken.CommunityDisc... | https://python.langchain.com/docs/modules/agents/agent_types/react_docstore.html |
75c86010017f-0 | Page Not Found | 🦜�🔗 Langchain
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKPage Not FoundWe could not find what you were looking for.Please contact the owner of the site that linked you to the original URL and let them know their link is broken.CommunityDisc... | https://python.langchain.com/docs/modules/agents/agent_types/openai_functions_agent.html |
ac0cea215bce-0 | OpenAI Multi Functions Agent | 🦜�🔗 Langchain | https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent |
ac0cea215bce-1 | Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionChainsMemoryAgentsAgent typesConversationalOpenAI functionsOpenAI Multi Functions AgentPlan and executeReActReAct document storeSelf ask with search... | https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent |
ac0cea215bce-2 | = [ Tool( name="Search", func=search.run, description="Useful when you need to answer questions about current events. You should ask targeted questions.", ),]mrkl = initialize_agent( tools, llm, agent=AgentType.OPENAI_MULTI_FUNCTIONS, verbose=True)# Do this so we can see exactly what's goi... | https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent |
ac0cea215bce-3 | "content": "", "additional_kwargs": { "function_call": { "name": "tool_selection", "arguments": "{\n \"actions\": [\n {\n \"action_name\": \"Search\",\n \"action\": {\n \"tool_input\": \"weather in Los Angeles\"\n }\n },\n {\n... | https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent |
ac0cea215bce-4 | }, "model_name": "gpt-3.5-turbo-0613" }, "run": null } [tool/start] [1:chain:AgentExecutor > 3:tool:Search] Entering Tool run with input: "{'tool_input': 'weather in Los Angeles'}" [tool/end] [1:chain:AgentExecutor > 3:tool:Search] [608.693ms] Exiting Tool run with output: "Mostly cloudy... | https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent |
ac0cea215bce-5 | {\\n \"action_name\": \"Search\",\\n \"action\": {\\n \"tool_input\": \"weather in Los Angeles\"\\n }\\n },\\n {\\n \"action_name\": \"Search\",\\n \"action\": {\\n \"tool_input\": \"weather in San Francisco\"\\n }\\n }\\n ]\\n}'}\nFunction: Mostly cloudy early, the... | https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent |
ac0cea215bce-6 | [1:chain:AgentExecutor > 5:llm:ChatOpenAI] [2.33s] Exiting LLM run with output: { "generations": [ [ { "text": "The weather in Los Angeles is mostly cloudy with a high of 76°F and a humidity of 59%. The weather in San Francisco is partly cloudy in the evening, becoming cloudy after m... | https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent |
ac0cea215bce-7 | }, "model_name": "gpt-3.5-turbo-0613" }, "run": null } [chain/end] [1:chain:AgentExecutor] [6.37s] Exiting Chain run with output: { "output": "The weather in Los Angeles is mostly cloudy with a high of 76°F and a humidity of 59%. The weather in San Francisco is partly cloudy in the eveni... | https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.