id stringlengths 14 16 | text stringlengths 31 2.73k | source stringlengths 88 153 |
|---|---|---|
aeba3cb74158-0 | .rst
.pdf
Welcome to LangChain
Contents
Getting Started
Modules
Use Cases
Reference Docs
LangChain Ecosystem
Additional Resources
Welcome to LangChain#
LangChain is a framework for developing applications powered by language models. We believe that the most powerful and differentiated applications will not only call ... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/index.html |
aeba3cb74158-1 | Agents: Agents involve an LLM making decisions about which Actions to take, taking that Action, seeing an Observation, and repeating that until done. LangChain provides a standard interface for agents, a selection of agents to choose from, and examples of end to end agents.
Use Cases#
The above modules can be used in a... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/index.html |
aeba3cb74158-2 | Guides for how other companies/products can be used with LangChain
LangChain Ecosystem
Additional Resources#
Additional collection of resources we think may be useful as you develop your application!
LangChainHub: The LangChainHub is a place to share and explore other prompts, chains, and agents.
Glossary: A glossary o... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/index.html |
1e1ddafb99a3-0 | Index
_
| A
| B
| C
| D
| E
| F
| G
| H
| I
| J
| K
| L
| M
| N
| O
| P
| Q
| R
| S
| T
| U
| V
| W
| Z
_
__call__() (langchain.llms.AI21 method)
(langchain.llms.AlephAlpha method)
(langchain.llms.Anthropic method)
(langchain.llms.AzureOpenAI method)
(langchain.llms.Banana method)
(langchain.llm... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-1 | A
aapply() (langchain.chains.LLMChain method)
aapply_and_parse() (langchain.chains.LLMChain method)
add() (langchain.docstore.InMemoryDocstore method)
add_documents() (langchain.vectorstores.VectorStore method)
add_embeddings() (langchain.vectorstores.FAISS method)
add_example() (langchain.prompts.example_selector.Leng... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-2 | (langchain.llms.LlamaCpp method)
(langchain.llms.Modal method)
(langchain.llms.NLPCloud method)
(langchain.llms.OpenAI method)
(langchain.llms.OpenAIChat method)
(langchain.llms.Petals method)
(langchain.llms.PromptLayerOpenAI method)
(langchain.llms.PromptLayerOpenAIChat method)
(langchain.llms.Replicate method)
(lang... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-3 | (langchain.llms.Replicate method)
(langchain.llms.SagemakerEndpoint method)
(langchain.llms.SelfHostedHuggingFaceLLM method)
(langchain.llms.SelfHostedPipeline method)
(langchain.llms.StochasticAI method)
(langchain.llms.Writer method)
agent (langchain.agents.AgentExecutor attribute)
(langchain.agents.MRKLChain attribu... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-4 | aprep_prompts() (langchain.chains.LLMChain method)
are_all_true_prompt (langchain.chains.LLMSummarizationCheckerChain attribute)
aresults() (langchain.utilities.searx_search.SearxSearchWrapper method)
arun() (langchain.serpapi.SerpAPIWrapper method)
(langchain.utilities.searx_search.SearxSearchWrapper method)
as_retrie... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-5 | check_assertions_prompt (langchain.chains.LLMCheckerChain attribute)
(langchain.chains.LLMSummarizationCheckerChain attribute)
Chroma (class in langchain.vectorstores)
chunk_size (langchain.embeddings.OpenAIEmbeddings attribute)
client (langchain.llms.Petals attribute)
combine_docs_chain (langchain.chains.AnalyzeDocume... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-6 | (langchain.llms.Petals class method)
(langchain.llms.PromptLayerOpenAI class method)
(langchain.llms.PromptLayerOpenAIChat class method)
(langchain.llms.Replicate class method)
(langchain.llms.SagemakerEndpoint class method)
(langchain.llms.SelfHostedHuggingFaceLLM class method)
(langchain.llms.SelfHostedPipeline class... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-7 | (langchain.llms.LlamaCpp method)
(langchain.llms.Modal method)
(langchain.llms.NLPCloud method)
(langchain.llms.OpenAI method)
(langchain.llms.OpenAIChat method)
(langchain.llms.Petals method)
(langchain.llms.PromptLayerOpenAI method)
(langchain.llms.PromptLayerOpenAIChat method)
(langchain.llms.Replicate method)
(lang... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-8 | (langchain.agents.ReActTextWorldAgent class method)
(langchain.agents.ZeroShotAgent class method)
create_sql_agent() (in module langchain.agents)
create_vectorstore_agent() (in module langchain.agents)
create_vectorstore_router_agent() (in module langchain.agents)
credentials_profile_name (langchain.embeddings.Sagemake... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-9 | (langchain.llms.LlamaCpp method)
(langchain.llms.Modal method)
(langchain.llms.NLPCloud method)
(langchain.llms.OpenAI method)
(langchain.llms.OpenAIChat method)
(langchain.llms.Petals method)
(langchain.llms.PromptLayerOpenAI method)
(langchain.llms.PromptLayerOpenAIChat method)
(langchain.llms.Replicate method)
(lang... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-10 | (langchain.embeddings.FakeEmbeddings method)
(langchain.embeddings.HuggingFaceEmbeddings method)
(langchain.embeddings.HuggingFaceHubEmbeddings method)
(langchain.embeddings.HuggingFaceInstructEmbeddings method)
(langchain.embeddings.LlamaCppEmbeddings method)
(langchain.embeddings.OpenAIEmbeddings method)
(langchain.e... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-11 | (langchain.llms.SagemakerEndpoint attribute)
endpoint_name (langchain.embeddings.SagemakerEndpointEmbeddings attribute)
(langchain.llms.SagemakerEndpoint attribute)
endpoint_url (langchain.llms.CerebriumAI attribute)
(langchain.llms.ForefrontAI attribute)
(langchain.llms.HuggingFaceEndpoint attribute)
(langchain.llms.M... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-12 | (langchain.prompts.BasePromptTemplate method)
(langchain.prompts.ChatPromptTemplate method)
(langchain.prompts.FewShotPromptTemplate method)
(langchain.prompts.FewShotPromptWithTemplates method)
(langchain.prompts.PromptTemplate method)
format_messages() (langchain.prompts.BaseChatPromptTemplate method)
(langchain.prom... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-13 | from_huggingface_tokenizer() (langchain.text_splitter.TextSplitter class method)
from_llm() (langchain.chains.ChatVectorDBChain class method)
(langchain.chains.ConstitutionalChain class method)
(langchain.chains.ConversationalRetrievalChain class method)
(langchain.chains.GraphQAChain class method)
(langchain.chains.Hy... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-14 | (langchain.vectorstores.Qdrant class method)
(langchain.vectorstores.VectorStore class method)
(langchain.vectorstores.Weaviate class method)
from_tiktoken_encoder() (langchain.text_splitter.TextSplitter class method)
func (langchain.agents.Tool attribute)
G
generate() (langchain.chains.LLMChain method)
(langchain.llms... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-15 | (langchain.llms.AlephAlpha method)
(langchain.llms.Anthropic method)
(langchain.llms.AzureOpenAI method)
(langchain.llms.Banana method)
(langchain.llms.CerebriumAI method)
(langchain.llms.Cohere method)
(langchain.llms.DeepInfra method)
(langchain.llms.ForefrontAI method)
(langchain.llms.GooseAI method)
(langchain.llms... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-16 | (langchain.llms.Anthropic method)
(langchain.llms.AzureOpenAI method)
(langchain.llms.Banana method)
(langchain.llms.CerebriumAI method)
(langchain.llms.Cohere method)
(langchain.llms.DeepInfra method)
(langchain.llms.ForefrontAI method)
(langchain.llms.GooseAI method)
(langchain.llms.GPT4All method)
(langchain.llms.Hu... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-17 | (langchain.llms.GooseAI method)
(langchain.llms.GPT4All method)
(langchain.llms.HuggingFaceEndpoint method)
(langchain.llms.HuggingFaceHub method)
(langchain.llms.HuggingFacePipeline method)
(langchain.llms.LlamaCpp method)
(langchain.llms.Modal method)
(langchain.llms.NLPCloud method)
(langchain.llms.OpenAI method)
(l... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-18 | hosting (langchain.embeddings.AlephAlphaAsymmetricSemanticEmbedding attribute)
I
inference_fn (langchain.embeddings.SelfHostedEmbeddings attribute)
(langchain.embeddings.SelfHostedHuggingFaceEmbeddings attribute)
(langchain.llms.SelfHostedHuggingFaceLLM attribute)
(langchain.llms.SelfHostedPipeline attribute)
inference... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-19 | (langchain.llms.GooseAI method)
(langchain.llms.GPT4All method)
(langchain.llms.HuggingFaceEndpoint method)
(langchain.llms.HuggingFaceHub method)
(langchain.llms.HuggingFacePipeline method)
(langchain.llms.LlamaCpp method)
(langchain.llms.Modal method)
(langchain.llms.NLPCloud method)
(langchain.llms.OpenAI method)
(l... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-20 | module
langchain.utilities.searx_search
module
langchain.vectorstores
module
last_n_tokens_size (langchain.llms.LlamaCpp attribute)
LatexTextSplitter (class in langchain.text_splitter)
length (langchain.llms.ForefrontAI attribute)
(langchain.llms.Writer attribute)
length_no_input (langchain.llms.N... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-21 | load_fn_kwargs (langchain.embeddings.SelfHostedHuggingFaceEmbeddings attribute)
(langchain.llms.SelfHostedHuggingFaceLLM attribute)
(langchain.llms.SelfHostedPipeline attribute)
load_local() (langchain.vectorstores.FAISS class method)
load_prompt() (in module langchain.prompts)
load_tools() (in module langchain.agents)... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-22 | (langchain.vectorstores.Milvus method)
(langchain.vectorstores.Qdrant method)
(langchain.vectorstores.VectorStore method)
max_marginal_relevance_search_by_vector() (langchain.vectorstores.Chroma method)
(langchain.vectorstores.FAISS method)
(langchain.vectorstores.VectorStore method)
max_new_tokens (langchain.llms.Peta... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-23 | min_length (langchain.llms.NLPCloud attribute)
min_tokens (langchain.llms.GooseAI attribute)
minimum_tokens (langchain.llms.AlephAlpha attribute)
minTokens (langchain.llms.AI21 attribute)
model (langchain.embeddings.AlephAlphaAsymmetricSemanticEmbedding attribute)
(langchain.embeddings.CohereEmbeddings attribute)
(lang... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-24 | (langchain.llms.SelfHostedHuggingFaceLLM attribute)
(langchain.llms.StochasticAI attribute)
model_load_fn (langchain.embeddings.SelfHostedHuggingFaceEmbeddings attribute)
(langchain.llms.SelfHostedHuggingFaceLLM attribute)
(langchain.llms.SelfHostedPipeline attribute)
model_name (langchain.chains.OpenAIModerationChain ... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-25 | langchain.vectorstores
N
n (langchain.llms.AlephAlpha attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.GooseAI attribute)
n_batch (langchain.embeddings.LlamaCppEmbeddings attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
n_ctx (langchain.embeddings.LlamaCppEmbeddings att... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-26 | (langchain.chains.HypotheticalDocumentEmbedder property)
(langchain.chains.QAGenerationChain property)
output_parser (langchain.agents.ConversationalChatAgent attribute)
(langchain.agents.LLMSingleActionAgent attribute)
(langchain.prompts.BasePromptTemplate attribute)
output_variables (langchain.chains.TransformChain a... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-27 | (langchain.llms.OpenAI method)
(langchain.llms.PromptLayerOpenAI method)
presence_penalty (langchain.llms.AlephAlpha attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.Cohere attribute)
(langchain.llms.GooseAI attribute)
presencePenalty (langchain.llms.AI21 attribute)
Prompt (in module langchain.prompts)... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-28 | (langchain.llms.SagemakerEndpoint attribute)
remove_end_sequence (langchain.llms.NLPCloud attribute)
remove_input (langchain.llms.NLPCloud attribute)
repeat_last_n (langchain.llms.GPT4All attribute)
repeat_penalty (langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
repetition_penalties_include_comple... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-29 | (langchain.chains.SQLDatabaseChain attribute)
(langchain.chains.SQLDatabaseSequentialChain attribute)
return_stopped_response() (langchain.agents.Agent method)
(langchain.agents.BaseSingleActionAgent method)
return_values (langchain.agents.Agent property)
(langchain.agents.BaseSingleActionAgent property)
revised_answer... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-30 | (langchain.llms.PromptLayerOpenAI method)
(langchain.llms.PromptLayerOpenAIChat method)
(langchain.llms.Replicate method)
(langchain.llms.SagemakerEndpoint method)
(langchain.llms.SelfHostedHuggingFaceLLM method)
(langchain.llms.SelfHostedPipeline method)
(langchain.llms.StochasticAI method)
(langchain.llms.Writer meth... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-31 | (langchain.vectorstores.Chroma method)
(langchain.vectorstores.DeepLake method)
(langchain.vectorstores.ElasticVectorSearch method)
(langchain.vectorstores.FAISS method)
(langchain.vectorstores.Milvus method)
(langchain.vectorstores.OpenSearchVectorSearch method)
(langchain.vectorstores.Pinecone method)
(langchain.vect... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-32 | (langchain.llms.LlamaCpp attribute)
(langchain.llms.Writer attribute)
stop_sequences (langchain.llms.AlephAlpha attribute)
stream() (langchain.llms.Anthropic method)
(langchain.llms.AzureOpenAI method)
(langchain.llms.OpenAI method)
(langchain.llms.PromptLayerOpenAI method)
streaming (langchain.llms.Anthropic attribute... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-33 | template_format (langchain.prompts.FewShotPromptTemplate attribute)
(langchain.prompts.FewShotPromptWithTemplates attribute)
(langchain.prompts.PromptTemplate attribute)
text_length (langchain.chains.LLMRequestsChain attribute)
text_splitter (langchain.chains.AnalyzeDocumentChain attribute)
(langchain.chains.MapReduceC... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-34 | (langchain.llms.AzureOpenAI attribute)
(langchain.llms.ForefrontAI attribute)
(langchain.llms.GooseAI attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
(langchain.llms.NLPCloud attribute)
(langchain.llms.Petals attribute)
(langchain.llms.Writer attribute)
topP (langchain.llms.AI21 attrib... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-35 | (langchain.llms.PromptLayerOpenAI class method)
(langchain.llms.PromptLayerOpenAIChat class method)
(langchain.llms.Replicate class method)
(langchain.llms.SagemakerEndpoint class method)
(langchain.llms.SelfHostedHuggingFaceLLM class method)
(langchain.llms.SelfHostedPipeline class method)
(langchain.llms.StochasticAI... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
1e1ddafb99a3-36 | Wikipedia (class in langchain.docstore)
Z
ZERO_SHOT_REACT_DESCRIPTION (langchain.agents.AgentType attribute)
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 05, 2023. | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/genindex.html |
def01e4517dc-0 | Search
Error
Please activate JavaScript to enable the search functionality.
Ctrl+K
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 05, 2023. | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/search.html |
1a18e84a5a85-0 | .rst
.pdf
API References
API References#
All of LangChain’s reference documentation, in one place.
Full documentation on all methods, classes, and APIs in LangChain.
Prompts
Utilities
Chains
Agents
previous
Integrations
next
Utilities
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated ... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/reference.html |
e8a54cdcb1e2-0 | .rst
.pdf
LangChain Ecosystem
LangChain Ecosystem#
Guides for how other companies/products can be used with LangChain
AI21 Labs
Aim
Apify
AtlasDB
Banana
CerebriumAI
Chroma
ClearML Integration
Getting API Credentials
Setting Up
Scenario 1: Just an LLM
Scenario 2: Creating a agent with tools
Tips and Next Steps
Cohere
De... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/ecosystem.html |
4e55088beee3-0 | .md
.pdf
Glossary
Contents
Chain of Thought Prompting
Action Plan Generation
ReAct Prompting
Self-ask
Prompt Chaining
Memetic Proxy
Self Consistency
Inception
MemPrompt
Glossary#
This is a collection of terminology commonly used when developing LLM applications.
It contains reference to external papers or sources whe... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/glossary.html |
4e55088beee3-1 | Language Model Cascades
ICE Primer Book
Socratic Models
Memetic Proxy#
Encouraging the LLM to respond in a certain way framing the discussion in a context that the model knows of and that will result in that type of response. For example, as a conversation between a student and a teacher.
Resources:
Paper
Self Consiste... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/glossary.html |
fabd14f4341a-0 | .rst
.pdf
LangChain Gallery
Contents
Open Source
Misc. Colab Notebooks
Proprietary
LangChain Gallery#
Lots of people have built some pretty awesome stuff with LangChain.
This is a collection of our favorites.
If you see any other demos that you think we should highlight, be sure to let us know!
Open Source#
HowDoI.ai... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/gallery.html |
fabd14f4341a-1 | Record sounds of anything (birds, wind, fire, train station) and chat with it.
ChatGPT LangChain
This simple application demonstrates a conversational agent implemented with OpenAI GPT-3.5 and LangChain. When necessary, it leverages tools for complex math, searching the internet, and accessing news and weather.
GPT Mat... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/gallery.html |
fabd14f4341a-2 | Daimon
A chat-based AI personal assistant with long-term memory about you.
AI Assisted SQL Query Generator
An app to write SQL using natural language, and execute against real DB.
Clerkie
Stack Tracing QA Bot to help debug complex stack tracing (especially the ones that go multi-function/file deep).
Sales Email Writer
... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/gallery.html |
8bb42fe3b009-0 | .md
.pdf
Deployments
Contents
Streamlit
Gradio (on Hugging Face)
Beam
Vercel
SteamShip
Langchain-serve
Deployments#
So you’ve made a really cool chain - now what? How do you deploy it and make it easily sharable with the world?
This section covers several options for that.
Note that these are meant as quick deploymen... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/deployments.html |
8bb42fe3b009-1 | This includes: production ready endpoints, horizontal scaling across dependencies, persistant storage of app state, multi-tenancy support, etc.
Langchain-serve#
This repository allows users to serve local chains and agents as RESTful, gRPC, or Websocket APIs thanks to Jina. Deploy your chains & agents with ease and enj... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/deployments.html |
0775e1d99a11-0 | .md
.pdf
Tracing
Contents
Tracing Walkthrough
Changing Sessions
Tracing#
By enabling tracing in your LangChain runs, you’ll be able to more effectively visualize, step through, and debug your chains and agents.
First, you should install tracing and set up your environment properly.
You can use either a locally hosted... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/tracing.html |
0775e1d99a11-1 | Changing Sessions#
To initially record traces to a session other than "default", you can set the LANGCHAIN_SESSION environment variable to the name of the session you want to record to:
import os
os.environ["LANGCHAIN_HANDLER"] = "langchain"
os.environ["LANGCHAIN_SESSION"] = "my_session" # Make sure this session actual... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/tracing.html |
faf2021d0f22-0 | .ipynb
.pdf
Model Comparison
Model Comparison#
Constructing your language model application will likely involved choosing between many different options of prompts, models, and even chains to use. When doing so, you will want to compare these different options on different inputs in an easy, flexible, and intuitive way... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/model_laboratory.html |
faf2021d0f22-1 | pink
prompt = PromptTemplate(template="What is the capital of {state}?", input_variables=["state"])
model_lab_with_prompt = ModelLaboratory.from_llms(llms, prompt=prompt)
model_lab_with_prompt.compare("New York")
Input:
New York
OpenAI
Params: {'model': 'text-davinci-002', 'temperature': 0.0, 'max_tokens': 256, 'top_p'... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/model_laboratory.html |
faf2021d0f22-2 | names = [str(open_ai_llm), str(cohere_llm)]
model_lab = ModelLaboratory(chains, names=names)
model_lab.compare("What is the hometown of the reigning men's U.S. Open champion?")
Input:
What is the hometown of the reigning men's U.S. Open champion?
OpenAI
Params: {'model': 'text-davinci-002', 'temperature': 0.0, 'max_tok... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/model_laboratory.html |
faf2021d0f22-3 | So the final answer is:
Carlos Alcaraz
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 05, 2023. | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/model_laboratory.html |
321c3fc21769-0 | .md
.pdf
Quickstart Guide
Contents
Installation
Environment Setup
Building a Language Model Application: LLMs
Building a Language Model Application: Chat Models
Quickstart Guide#
This tutorial gives you a quick walkthrough about building an end-to-end language model application with LangChain.
Installation#
To get st... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
321c3fc21769-1 | llm = OpenAI(temperature=0.9)
We can now call it on some input!
text = "What would be a good company name for a company that makes colorful socks?"
print(llm(text))
Feetful of Fun
For more details on how to use LLMs within LangChain, see the LLM getting started guide.
Prompt Templates: Manage prompts for LLMs
Calling a... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
321c3fc21769-2 | A chain in LangChain is made up of links, which can be either primitives like LLMs or other chains.
The most core type of chain is an LLMChain, which consists of a PromptTemplate and an LLM.
Extending the previous example, we can construct an LLMChain which takes user input, formats it with a PromptTemplate, and then p... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
321c3fc21769-3 | In order to load agents, you should understand the following concepts:
Tool: A function that performs a specific duty. This can be things like: Google Search, Database lookup, Python REPL, other chains. The interface for a tool is currently a function that is expected to have a string as an input, with a string as an o... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
321c3fc21769-4 | agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
# Now let's test it out!
agent.run("What was the high temperature in SF yesterday in Fahrenheit? What is that number raised to the .023 power?")
> Entering new AgentExecutor chain...
I need to find the temperature first, th... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
321c3fc21769-5 | LangChain provides several specially created chains just for this purpose. This notebook walks through using one of those chains (the ConversationChain) with two different types of memory.
By default, the ConversationChain has a simple type of memory that remembers all previous inputs/outputs and adds them to the conte... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
321c3fc21769-6 | Building a Language Model Application: Chat Models#
Similarly, you can use chat models instead of LLMs. Chat models are a variation on language models. While chat models use language models under the hood, the interface they expose is a bit different: rather than expose a “text in, text out” API, they expose an interfa... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
321c3fc21769-7 | batch_messages = [
[
SystemMessage(content="You are a helpful assistant that translates English to French."),
HumanMessage(content="Translate this sentence from English to French. I love programming.")
],
[
SystemMessage(content="You are a helpful assistant that translates English to... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
321c3fc21769-8 | from langchain.prompts.chat import (
ChatPromptTemplate,
SystemMessagePromptTemplate,
HumanMessagePromptTemplate,
)
chat = ChatOpenAI(temperature=0)
template="You are a helpful assistant that translates {input_language} to {output_language}."
system_message_prompt = SystemMessagePromptTemplate.from_template... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
321c3fc21769-9 | from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents import AgentType
from langchain.chat_models import ChatOpenAI
from langchain.llms import OpenAI
# First, let's load the language model we're going to use to control the agent.
chat = ChatOpenAI(temperature=0)
# N... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
321c3fc21769-10 | Action:
{
"action": "Search",
"action_input": "Harry Styles age"
}
Observation: 29 years
Thought:Now I need to calculate 29 raised to the 0.23 power.
Action:
{
"action": "Calculator",
"action_input": "29^0.23"
}
Observation: Answer: 2.169459462491557
Thought:I now know the final answer.
Final Answer: 2.16945946... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
321c3fc21769-11 | conversation.predict(input="Hi there!")
# -> 'Hello! How can I assist you today?'
conversation.predict(input="I'm doing well! Just having a conversation with an AI.")
# -> "That sounds like fun! I'm happy to chat with you. Is there anything specific you'd like to talk about?"
conversation.predict(input="Tell me about y... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/getting_started/getting_started.html |
1edb18876dbb-0 | .rst
.pdf
Models
Contents
Go Deeper
Models#
Note
Conceptual Guide
This section of the documentation deals with different types of models that are used in LangChain.
On this page we will go over the model types at a high level,
but we have individual pages for each model type.
The pages contain more detailed “how-to” ... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models.html |
2f5ac5adc1eb-0 | .rst
.pdf
Prompts
Contents
Go Deeper
Prompts#
Note
Conceptual Guide
The new way of programming models is through prompts.
A “prompt” refers to the input to the model.
This input is rarely hard coded, but rather is often constructed from multiple components.
A PromptTemplate is responsible for the construction of this... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/prompts.html |
610d8f632207-0 | .rst
.pdf
Indexes
Contents
Go Deeper
Indexes#
Note
Conceptual Guide
Indexes refer to ways to structure documents so that LLMs can best interact with them.
This module contains utility functions for working with documents, different types of indexes, and then examples for using those indexes in chains.
The most common... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/indexes.html |
610d8f632207-1 | previous
Structured Output Parser
next
Getting Started
Contents
Go Deeper
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 05, 2023. | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/indexes.html |
20ee4b212749-0 | .rst
.pdf
Memory
Memory#
Note
Conceptual Guide
By default, Chains and Agents are stateless,
meaning that they treat each incoming query independently (as are the underlying LLMs and chat models).
In some applications (chatbots being a GREAT example) it is highly important
to remember previous interactions, both at a sh... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/memory.html |
aea75e43c546-0 | .rst
.pdf
Chains
Chains#
Note
Conceptual Guide
Using an LLM in isolation is fine for some simple applications,
but many more complex ones require chaining LLMs - either with each other or with other experts.
LangChain provides a standard interface for Chains, as well as some common implementations of chains for ease of... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/chains.html |
e99cc6ad2995-0 | .rst
.pdf
Agents
Contents
Go Deeper
Agents#
Note
Conceptual Guide
Some applications will require not just a predetermined chain of calls to LLMs/other tools,
but potentially an unknown chain that depends on the user’s input.
In these types of chains, there is a “agent” which has access to a suite of tools.
Depending ... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/agents.html |
2b34bad144f5-0 | .rst
.pdf
LLMs
LLMs#
Note
Conceptual Guide
Large Language Models (LLMs) are a core component of LangChain.
LangChain is not a provider of LLMs, but rather provides a standard interface through which
you can interact with a variety of LLMs.
The following sections of documentation are provided:
Getting Started: An overvi... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms.html |
77ca23f29076-0 | .rst
.pdf
Chat Models
Chat Models#
Note
Conceptual Guide
Chat models are a variation on language models.
While chat models use language models under the hood, the interface they expose is a bit different.
Rather than expose a “text in, text out” API, they expose an interface where “chat messages” are the inputs and out... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/chat.html |
8a4c0a4169c0-0 | .rst
.pdf
Text Embedding Models
Text Embedding Models#
Note
Conceptual Guide
This documentation goes over how to use the Embedding class in LangChain.
The Embedding class is a class designed for interfacing with embeddings. There are lots of Embedding providers (OpenAI, Cohere, Hugging Face, etc) - this class is design... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/text_embedding.html |
b1a820342d3e-0 | .ipynb
.pdf
Getting Started
Getting Started#
This notebook goes over how to use the LLM class in LangChain.
The LLM class is a class designed for interfacing with LLMs. There are lots of LLM providers (OpenAI, Cohere, Hugging Face, etc) - this class is designed to provide a standard interface for all of them. In this p... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/getting_started.html |
b1a820342d3e-1 | llm_result.generations[-1]
[Generation(text="\n\nWhat if love neverspeech\n\nWhat if love never ended\n\nWhat if love was only a feeling\n\nI'll never know this love\n\nIt's not a feeling\n\nBut it's what we have for each other\n\nWe just know that love is something strong\n\nAnd we can't help but be happy\n\nWe just f... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/getting_started.html |
4a558a82bf39-0 | .rst
.pdf
Generic Functionality
Generic Functionality#
The examples here all address certain “how-to” guides for working with LLMs.
How to use the async API for LLMs
How to write a custom LLM wrapper
How (and why) to use the fake LLM
How to cache LLM calls
How to serialize LLM classes
How to stream LLM and Chat Model r... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/how_to_guides.html |
e1db37c17139-0 | .rst
.pdf
Integrations
Integrations#
The examples here are all “how-to” guides for how to integrate with various LLM providers.
AI21
Aleph Alpha
Anthropic
Azure OpenAI LLM Example
Banana
CerebriumAI LLM Example
Cohere
DeepInfra LLM Example
ForefrontAI LLM Example
GooseAI LLM Example
GPT4all
Hugging Face Hub
Llama-cpp
M... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/integrations.html |
be66d16908cb-0 | .ipynb
.pdf
How to use the async API for LLMs
How to use the async API for LLMs#
LangChain provides async support for LLMs by leveraging the asyncio library.
Async support is particularly useful for calling multiple LLMs concurrently, as these calls are network-bound. Currently, OpenAI, PromptLayerOpenAI, ChatOpenAI an... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/async_llm.html |
be66d16908cb-1 | I'm doing well, thank you. How about you?
I'm doing well, thank you. How about you?
I'm doing well, how about you?
I'm doing well, thank you. How about you?
I'm doing well, thank you. How about you?
I'm doing well, thank you. How about yourself?
I'm doing well, thank you! How about you?
I'm doing well, thank you. How a... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/async_llm.html |
9149c720a568-0 | .ipynb
.pdf
How to write a custom LLM wrapper
How to write a custom LLM wrapper#
This notebook goes over how to create a custom LLM wrapper, in case you want to use your own LLM or a different wrapper than one that is supported in LangChain.
There is only one required thing that a custom LLM needs to implement:
A _call... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/custom_llm.html |
9149c720a568-1 | previous
How to use the async API for LLMs
next
How (and why) to use the fake LLM
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 05, 2023. | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/custom_llm.html |
2cb408cd3ac3-0 | .ipynb
.pdf
How (and why) to use the fake LLM
How (and why) to use the fake LLM#
We expose a fake LLM class that can be used for testing. This allows you to mock out calls to the LLM and simulate what would happen if the LLM responded in a certain way.
In this notebook we go over how to use this.
We start this with usi... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/fake_llm.html |
2ea8433aafea-0 | .ipynb
.pdf
How to cache LLM calls
Contents
In Memory Cache
SQLite Cache
Redis Cache
SQLAlchemy Cache
Custom SQLAlchemy Schemas
Optional Caching
Optional Caching in Chains
How to cache LLM calls#
This notebook covers how to cache results of individual LLM calls.
from langchain.llms import OpenAI
In Memory Cache#
impo... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/llm_caching.html |
2ea8433aafea-1 | llm("Tell me a joke")
CPU times: user 17 ms, sys: 9.76 ms, total: 26.7 ms
Wall time: 825 ms
'\n\nWhy did the chicken cross the road?\n\nTo get to the other side.'
%%time
# The second time it is, so it goes faster
llm("Tell me a joke")
CPU times: user 2.46 ms, sys: 1.23 ms, total: 3.7 ms
Wall time: 2.67 ms
'\n\nWhy did ... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/llm_caching.html |
2ea8433aafea-2 | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy_utils import TSVectorType
from langchain.cache import SQLAlchemyCache
Base = declarative_base()
class FulltextLLMCache(Base): # type: ignore
"""Postgres table for fulltext-indexed LLM Cache"""
__tablena... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/llm_caching.html |
2ea8433aafea-3 | %%time
llm("Tell me a joke")
CPU times: user 4.91 ms, sys: 2.64 ms, total: 7.55 ms
Wall time: 623 ms
'\n\nTwo guys stole a calendar. They got six months each.'
Optional Caching in Chains#
You can also turn off caching for particular nodes in chains. Note that because of certain interfaces, its often easier to construct... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/llm_caching.html |
2ea8433aafea-4 | Wall time: 5.09 s
'\n\nPresident Biden is discussing the American Rescue Plan and the Bipartisan Infrastructure Law, which will create jobs and help Americans. He also talks about his vision for America, which includes investing in education and infrastructure. In response to Russian aggression in Ukraine, the United S... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/llm_caching.html |
6a64cb5f4e18-0 | .ipynb
.pdf
How to serialize LLM classes
Contents
Loading
Saving
How to serialize LLM classes#
This notebook walks through how to write and read an LLM Configuration to and from disk. This is useful if you want to save the configuration for a given LLM (e.g., the provider, the temperature, etc).
from langchain.llms i... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/llm_serialization.html |
6a64cb5f4e18-1 | llm.save("llm.json")
llm.save("llm.yaml")
previous
How to cache LLM calls
next
How to stream LLM and Chat Model responses
Contents
Loading
Saving
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 05, 2023. | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/llm_serialization.html |
c732c3672ad6-0 | .ipynb
.pdf
How to stream LLM and Chat Model responses
How to stream LLM and Chat Model responses#
LangChain provides streaming support for LLMs. Currently, we support streaming for the OpenAI, ChatOpenAI. and Anthropic implementations, but streaming support for other LLM implementations is on the roadmap. To utilize s... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/streaming_llm.html |
c732c3672ad6-1 | It's the perfect way to keep me cool
On a hot summer night.
Chorus
Sparkling water, sparkling water,
It's the best way to stay hydrated,
It's so crisp and so clean,
It's the perfect way to stay refreshed.
We still have access to the end LLMResult if using generate. However, token_usage is not currently supported for st... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/streaming_llm.html |
c732c3672ad6-2 | Sparkling water, oh how you shine
A taste so clean, it's simply divine
You quench my thirst, you make me feel alive
Sparkling water, you're my favorite vibe
Bridge:
You're my go-to drink, day or night
You make me feel so light
I'll never give you up, you're my true love
Sparkling water, you're sent from above
Chorus:
S... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/streaming_llm.html |
c732c3672ad6-3 | previous
How to serialize LLM classes
next
How to track token usage
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 05, 2023. | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/streaming_llm.html |
3c90e747c7a7-0 | .ipynb
.pdf
How to track token usage
How to track token usage#
This notebook goes over how to track your token usage for specific calls. It is currently only implemented for the OpenAI API.
Let’s first look at an extremely simple example of tracking token usage for a single LLM call.
from langchain.llms import OpenAI
f... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/token_usage_tracking.html |
3c90e747c7a7-1 | agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
with get_openai_callback() as cb:
response = agent.run("Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?")
print(f"Total Tokens: {cb.total_tokens}")
print(f"Prompt Tokens: {cb.pr... | /content/drive/MyDrive/Chatgpt-plugins/https://python.langchain.com/en/latest/modules/models/llms/examples/token_usage_tracking.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.