id stringlengths 14 16 | source stringlengths 49 117 | text stringlengths 16 2.73k |
|---|---|---|
d9c5cdcfdf64-1 | https://python.langchain.com/en/latest/integrations/predictionguard.html | Monthly Candle Box - $45 (NEW!)
Scent of The Month Box - $28 (NEW!)
Head to stories to get ALLL the deets on each box! 👆 BONUS: Save 50% on your first box with code 50OFF! 🎉
Query: {query}
Result: """
prompt = PromptTemplate(template=template, input_variables=["query"])
# With "guarding" or controlling the output of ... |
d9c5cdcfdf64-2 | https://python.langchain.com/en/latest/integrations/predictionguard.html | llm_chain = LLMChain(prompt=prompt, llm=pgllm, verbose=True)
question = "What NFL team won the Super Bowl in the year Justin Beiber was born?"
llm_chain.predict(question=question)
previous
PipelineAI
next
PromptLayer
Contents
Installation and Setup
LLM Wrapper
Example usage
By Harrison Chase
© Copyright ... |
75cbd829a13f-0 | https://python.langchain.com/en/latest/integrations/openai.html | .md
.pdf
OpenAI
Contents
Installation and Setup
LLM
Text Embedding Model
Tokenizer
Chain
Document Loader
Retriever
OpenAI#
OpenAI is American artificial intelligence (AI) research laboratory
consisting of the non-profit OpenAI Incorporated
and its for-profit subsidiary corporation OpenAI Limited Partnership.
OpenAI c... |
75cbd829a13f-1 | https://python.langchain.com/en/latest/integrations/openai.html | See a usage example.
from langchain.document_loaders.chatgpt import ChatGPTLoader
Retriever#
See a usage example.
from langchain.retrievers import ChatGPTPluginRetriever
previous
Obsidian
next
OpenSearch
Contents
Installation and Setup
LLM
Text Embedding Model
Tokenizer
Chain
Document Loader
Retriever
By Harrison C... |
4f0b86ffd87f-0 | https://python.langchain.com/en/latest/integrations/college_confidential.html | .md
.pdf
College Confidential
Contents
Installation and Setup
Document Loader
College Confidential#
College Confidential gives information on 3,800+ colleges and universities.
Installation and Setup#
There isn’t any special setup for it.
Document Loader#
See a usage example.
from langchain.document_loaders import Col... |
ff5f4857a42e-0 | https://python.langchain.com/en/latest/integrations/stripe.html | .md
.pdf
Stripe
Contents
Installation and Setup
Document Loader
Stripe#
Stripe is an Irish-American financial services and software as a service (SaaS) company. It offers payment-processing software and application programming interfaces for e-commerce websites and mobile applications.
Installation and Setup#
See set... |
28252375a43d-0 | https://python.langchain.com/en/latest/integrations/airbyte.html | .md
.pdf
Airbyte
Contents
Installation and Setup
Document Loader
Airbyte#
Airbyte is a data integration platform for ELT pipelines from APIs,
databases & files to warehouses & lakes. It has the largest catalog of ELT connectors to data warehouses and databases.
Installation and Setup#
This instruction shows how to lo... |
9cf386474b89-0 | https://python.langchain.com/en/latest/integrations/microsoft_powerpoint.html | .md
.pdf
Microsoft PowerPoint
Contents
Installation and Setup
Document Loader
Microsoft PowerPoint#
Microsoft PowerPoint is a presentation program by Microsoft.
Installation and Setup#
There isn’t any special setup for it.
Document Loader#
See a usage example.
from langchain.document_loaders import UnstructuredPowerP... |
a4c48a2191f6-0 | https://python.langchain.com/en/latest/integrations/roam.html | .md
.pdf
Roam
Contents
Installation and Setup
Document Loader
Roam#
ROAM is a note-taking tool for networked thought, designed to create a personal knowledge base.
Installation and Setup#
There isn’t any special setup for it.
Document Loader#
See a usage example.
from langchain.document_loaders import RoamLoader
prev... |
09517125a093-0 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | .ipynb
.pdf
ClearML
Contents
Installation and Setup
Getting API Credentials
Callbacks
Scenario 1: Just an LLM
Scenario 2: Creating an agent with tools
Tips and Next Steps
ClearML#
ClearML is a ML/DL development and production suite, it contains 5 main modules:
Experiment Manager - Automagical experiment tracking, env... |
09517125a093-1 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | Callbacks#
from langchain.callbacks import ClearMLCallbackHandler
from datetime import datetime
from langchain.callbacks import StdOutCallbackHandler
from langchain.llms import OpenAI
# Setup and use the ClearML Callback
clearml_callback = ClearMLCallbackHandler(
task_type="inference",
project_name="langchain_c... |
09517125a093-2 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_start', 'name': 'OpenAI', 'step': 3, 'starts': 2, 'ends': 1, 'errors': 0, 'text_ctr': 0, 'chain_starts': 0, 'chain_ends': 0, 'llm_starts': 2, 'llm_ends': 1, 'llm_streams': 0, 'tool_starts': 0, 'tool_ends': 0, 'agent_ends': 0, 'prompts': 'Tell me a joke'}
{'action': 'on_llm_start', 'name': 'OpenAI', '... |
09517125a093-3 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_start', 'name': 'OpenAI', 'step': 3, 'starts': 2, 'ends': 1, 'errors': 0, 'text_ctr': 0, 'chain_starts': 0, 'chain_ends': 0, 'llm_starts': 2, 'llm_ends': 1, 'llm_streams': 0, 'tool_starts': 0, 'tool_ends': 0, 'agent_ends': 0, 'prompts': 'Tell me a poem'}
{'action': 'on_llm_start', 'name': 'OpenAI', '... |
09517125a093-4 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_end', 'token_usage_prompt_tokens': 24, 'token_usage_completion_tokens': 138, 'token_usage_total_tokens': 162, 'model_name': 'text-davinci-003', 'step': 4, 'starts': 2, 'ends': 2, 'errors': 0, 'text_ctr': 0, 'chain_starts': 0, 'chain_ends': 0, 'llm_starts': 2, 'llm_ends': 2, 'llm_streams': 0, 'tool_st... |
09517125a093-5 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_end', 'token_usage_prompt_tokens': 24, 'token_usage_completion_tokens': 138, 'token_usage_total_tokens': 162, 'model_name': 'text-davinci-003', 'step': 4, 'starts': 2, 'ends': 2, 'errors': 0, 'text_ctr': 0, 'chain_starts': 0, 'chain_ends': 0, 'llm_starts': 2, 'llm_ends': 2, 'llm_streams': 0, 'tool_st... |
09517125a093-6 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_end', 'token_usage_prompt_tokens': 24, 'token_usage_completion_tokens': 138, 'token_usage_total_tokens': 162, 'model_name': 'text-davinci-003', 'step': 4, 'starts': 2, 'ends': 2, 'errors': 0, 'text_ctr': 0, 'chain_starts': 0, 'chain_ends': 0, 'llm_starts': 2, 'llm_ends': 2, 'llm_streams': 0, 'tool_st... |
09517125a093-7 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_end', 'token_usage_prompt_tokens': 24, 'token_usage_completion_tokens': 138, 'token_usage_total_tokens': 162, 'model_name': 'text-davinci-003', 'step': 4, 'starts': 2, 'ends': 2, 'errors': 0, 'text_ctr': 0, 'chain_starts': 0, 'chain_ends': 0, 'llm_starts': 2, 'llm_ends': 2, 'llm_streams': 0, 'tool_st... |
09517125a093-8 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_end', 'token_usage_prompt_tokens': 24, 'token_usage_completion_tokens': 138, 'token_usage_total_tokens': 162, 'model_name': 'text-davinci-003', 'step': 4, 'starts': 2, 'ends': 2, 'errors': 0, 'text_ctr': 0, 'chain_starts': 0, 'chain_ends': 0, 'llm_starts': 2, 'llm_ends': 2, 'llm_streams': 0, 'tool_st... |
09517125a093-9 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_end', 'token_usage_prompt_tokens': 24, 'token_usage_completion_tokens': 138, 'token_usage_total_tokens': 162, 'model_name': 'text-davinci-003', 'step': 4, 'starts': 2, 'ends': 2, 'errors': 0, 'text_ctr': 0, 'chain_starts': 0, 'chain_ends': 0, 'llm_starts': 2, 'llm_ends': 2, 'llm_streams': 0, 'tool_st... |
09517125a093-10 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 0 on_llm_start OpenAI 1 1 0 0 0 0
1 on_llm_start OpenAI 1 1 0 0 0 0
2 on_llm_start OpenAI 1 1 0 0 0 0
3 on_llm_start OpenAI 1 1 0 0 0 0
... |
09517125a093-11 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 14 on_llm_start OpenAI 3 2 1 0 0 0
15 on_llm_start OpenAI 3 2 1 0 0 0
16 on_llm_start OpenAI 3 2 1 0 0 0
17 on_llm_start OpenAI 3 2 1 0 0 0
... |
09517125a093-12 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 6 0 1 ... 0.0 5.5
7 0 1 ... 2.0 6.5
8 0 1 ... 0.0 5.5
9 0 1 ... 2.0 6.5
10 0 ... |
09517125a093-13 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 3 NaN NaN NaN NaN
4 NaN NaN NaN NaN
5 NaN NaN NaN NaN
6 5.20 5th and 6th grade 133.58 131.54
7 8.28 6th and 7th gra... |
09517125a093-14 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 23 8.28 6th and 7th grade 115.58 112.37
gutierrez_polini crawford gulpease_index osman
0 NaN NaN NaN NaN
1 NaN NaN NaN NaN
2 NaN NaN NaN NaN
3 NaN... |
09517125a093-15 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 21 54.83 1.4 72.1 100.17
22 62.30 -0.2 79.8 116.91
23 54.83 1.4 72.1 100.17
[24 rows x 39 columns], 'session_analysis': prompt_step prompts name output_step \
0 1 Tell me a joke OpenAI ... |
09517125a093-16 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 4 \n\nQ: What did the fish say when it hit the w...
5 \n\nRoses are red,\nViolets are blue,\nSugar i...
6 \n\nQ: What did the fish say when it hit the w...
7 \n\nRoses are red,\nViolets are blue,\nSugar i...
8 \n\nQ: What did the fish say when it hit the w...
9 \n\nRoses are red,\nViolets are... |
09517125a093-17 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 5 138 83.66 4.8
6 138 109.04 1.3
7 138 83.66 4.8
8 138 109.04 1.3
... |
09517125a093-18 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 1 6th and 7th grade 115.58 112.37 54.83
2 5th and 6th grade 133.58 131.54 62.30
3 6th and 7th grade 115.58 112.37 54.83
4 5th and 6th grade 133.58 131.54 62.30
5 6th ... |
09517125a093-19 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 5 1.4 72.1 100.17
6 -0.2 79.8 116.91
7 1.4 72.1 100.17
8 -0.2 79.8 116.91
9 1.4 72.1 100.17
10 -0.2 79.8 116.91
11 1.4 72.1 100.17
[12 rows x 24 columns]}
2023-03-29 14:00:25,948 - clea... |
09517125a093-20 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | from langchain.agents import initialize_agent, load_tools
from langchain.agents import AgentType
# SCENARIO 2 - Agent with Tools
tools = load_tools(["serpapi", "llm-math"], llm=llm, callbacks=callbacks)
agent = initialize_agent(
tools,
llm,
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
callbacks=callback... |
09517125a093-21 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_start', 'name': 'OpenAI', 'step': 2, 'starts': 2, 'ends': 0, 'errors': 0, 'text_ctr': 0, 'chain_starts': 1, 'chain_ends': 0, 'llm_starts': 1, 'llm_ends': 0, 'llm_streams': 0, 'tool_starts': 0, 'tool_ends': 0, 'agent_ends': 0, 'prompts': 'Answer the following questions as best you can. You have access... |
09517125a093-22 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_end', 'token_usage_prompt_tokens': 189, 'token_usage_completion_tokens': 34, 'token_usage_total_tokens': 223, 'model_name': 'text-davinci-003', 'step': 3, 'starts': 2, 'ends': 1, 'errors': 0, 'text_ctr': 0, 'chain_starts': 1, 'chain_ends': 0, 'llm_starts': 1, 'llm_ends': 1, 'llm_streams': 0, 'tool_st... |
09517125a093-23 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | I need to find out who sang summer of 69 and then find out who their wife is.
Action: Search
Action Input: "Who sang summer of 69"{'action': 'on_agent_action', 'tool': 'Search', 'tool_input': 'Who sang summer of 69', 'log': ' I need to find out who sang summer of 69 and then find out who their wife is.\nAction: Search\... |
09517125a093-24 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | Thought:{'action': 'on_tool_end', 'output': 'Bryan Adams - Summer Of 69 (Official Music Video).', 'step': 6, 'starts': 4, 'ends': 2, 'errors': 0, 'text_ctr': 0, 'chain_starts': 1, 'chain_ends': 0, 'llm_starts': 1, 'llm_ends': 1, 'llm_streams': 0, 'tool_starts': 2, 'tool_ends': 1, 'agent_ends': 0} |
09517125a093-25 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_start', 'name': 'OpenAI', 'step': 7, 'starts': 5, 'ends': 2, 'errors': 0, 'text_ctr': 0, 'chain_starts': 1, 'chain_ends': 0, 'llm_starts': 2, 'llm_ends': 1, 'llm_streams': 0, 'tool_starts': 2, 'tool_ends': 1, 'agent_ends': 0, 'prompts': 'Answer the following questions as best you can. You have access... |
09517125a093-26 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_end', 'token_usage_prompt_tokens': 242, 'token_usage_completion_tokens': 28, 'token_usage_total_tokens': 270, 'model_name': 'text-davinci-003', 'step': 8, 'starts': 5, 'ends': 3, 'errors': 0, 'text_ctr': 0, 'chain_starts': 1, 'chain_ends': 0, 'llm_starts': 2, 'llm_ends': 2, 'llm_streams': 0, 'tool_st... |
09517125a093-27 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | Action Input: "Who is Bryan Adams married to"{'action': 'on_agent_action', 'tool': 'Search', 'tool_input': 'Who is Bryan Adams married to', 'log': ' I need to find out who Bryan Adams is married to.\nAction: Search\nAction Input: "Who is Bryan Adams married to"', 'step': 9, 'starts': 6, 'ends': 3, 'errors': 0, 'text_ct... |
09517125a093-28 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | Thought:{'action': 'on_tool_end', 'output': 'Bryan Adams has never married. In the 1990s, he was in a relationship with Danish model Cecilie Thomsen. In 2011, Bryan and Alicia Grimaldi, his ...', 'step': 11, 'starts': 7, 'ends': 4, 'errors': 0, 'text_ctr': 0, 'chain_starts': 1, 'chain_ends': 0, 'llm_starts': 2, 'llm_en... |
09517125a093-29 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_start', 'name': 'OpenAI', 'step': 12, 'starts': 8, 'ends': 4, 'errors': 0, 'text_ctr': 0, 'chain_starts': 1, 'chain_ends': 0, 'llm_starts': 3, 'llm_ends': 2, 'llm_streams': 0, 'tool_starts': 4, 'tool_ends': 2, 'agent_ends': 0, 'prompts': 'Answer the following questions as best you can. You have acces... |
09517125a093-30 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | a relationship with Danish model Cecilie Thomsen. In 2011, Bryan and Alicia Grimaldi, his ...\nThought:'} |
09517125a093-31 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_llm_end', 'token_usage_prompt_tokens': 314, 'token_usage_completion_tokens': 18, 'token_usage_total_tokens': 332, 'model_name': 'text-davinci-003', 'step': 13, 'starts': 8, 'ends': 5, 'errors': 0, 'text_ctr': 0, 'chain_starts': 1, 'chain_ends': 0, 'llm_starts': 3, 'llm_ends': 3, 'llm_streams': 0, 'tool_s... |
09517125a093-32 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | {'action': 'on_agent_finish', 'output': 'Bryan Adams has never been married.', 'log': ' I now know the final answer.\nFinal Answer: Bryan Adams has never been married.', 'step': 14, 'starts': 8, 'ends': 6, 'errors': 0, 'text_ctr': 0, 'chain_starts': 1, 'chain_ends': 0, 'llm_starts': 3, 'llm_ends': 3, 'llm_streams': 0, ... |
09517125a093-33 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 4 on_llm_start OpenAI 1 1 0 0 0
.. ... ... ... ... ... ... ...
66 on_tool_end NaN 11 7 4 0 0
67 on_llm_start OpenAI 12 8 4 0 0
68 on_llm_end NaN 13 8 ... |
09517125a093-34 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 70 1 1 3 ... NaN NaN NaN
tool tool_input log \
0 NaN NaN NaN
1 NaN NaN NaN
2 NaN ... |
09517125a093-35 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 2 12 Answer the following questions as best you can... OpenAI
output_step output \
0 3 I need to find out who sang summer of 69 and ...
1 8 I need to find out who Bryan Adams is married...
2 13 I now know the fina... |
09517125a093-36 | https://python.langchain.com/en/latest/integrations/clearml_tracking.html | 0 0.9 72.7 92.16
1 0.7 74.7 84.20
2 0.7 85.4 83.14
[3 rows x 24 columns]}
Could not update last created model in Task 988bd727b0e94a29a3ac0ee526813545, Task status 'completed' cannot be updated
Tips and Next Steps#
Make sure you always use a unique name argument ... |
89b95b747eea-0 | https://python.langchain.com/en/latest/integrations/metal.html | .md
.pdf
Metal
Contents
What is Metal?
Quick start
Metal#
This page covers how to use Metal within LangChain.
What is Metal?#
Metal is a managed retrieval & memory platform built for production. Easily index your data into Metal and run semantic search and retrieval on it.
Quick start#
Get started by creating a Meta... |
89ec380f4ab9-0 | https://python.langchain.com/en/latest/integrations/rwkv.html | .md
.pdf
RWKV-4
Contents
Installation and Setup
Usage
RWKV
Model File
Rwkv-4 models -> recommended VRAM
RWKV-4#
This page covers how to use the RWKV-4 wrapper within LangChain.
It is broken into two parts: installation and setup, and then usage with an example.
Installation and Setup#
Install the Python package with ... |
89ec380f4ab9-1 | https://python.langchain.com/en/latest/integrations/rwkv.html | 14B | 16GB | 28GB | >50GB
7B | 8GB | 14GB | 28GB
3B | 2.8GB| 6GB | 12GB
1b5 | 1.3GB| 3GB | 6GB
See the rwkv pip page for more information about strategies, including streaming and cuda support.
previous
Runhouse
next
SageMaker Endpoint
Contents
Installation and Setup
Usage
RWKV
Mode... |
7b0cbb9103f3-0 | https://python.langchain.com/en/latest/integrations/agent_with_wandb_tracing.html | .ipynb
.pdf
Tracing Walkthrough
Tracing Walkthrough#
There are two recommended ways to trace your LangChains:
Setting the LANGCHAIN_WANDB_TRACING environment variable to “true”.
Using a context manager with tracing_enabled() to trace a particular block of code.
Note if the environment variable is set, all code will be ... |
7b0cbb9103f3-1 | https://python.langchain.com/en/latest/integrations/agent_with_wandb_tracing.html | del os.environ["LANGCHAIN_WANDB_TRACING"]
# enable tracing using a context manager
with wandb_tracing_enabled():
agent.run("What is 5 raised to .123243 power?") # this should be traced
agent.run("What is 2 raised to .123243 power?") # this should not be traced
> Entering new AgentExecutor chain...
I need to use ... |
acda2f94d966-0 | https://python.langchain.com/en/latest/integrations/azlyrics.html | .md
.pdf
AZLyrics
Contents
Installation and Setup
Document Loader
AZLyrics#
AZLyrics is a large, legal, every day growing collection of lyrics.
Installation and Setup#
There isn’t any special setup for it.
Document Loader#
See a usage example.
from langchain.document_loaders import AZLyricsLoader
previous
AWS S3 Dire... |
3db3d0d2eaa8-0 | https://python.langchain.com/en/latest/integrations/elasticsearch.html | .md
.pdf
Elasticsearch
Contents
Installation and Setup
Retriever
Elasticsearch#
Elasticsearch is a distributed, RESTful search and analytics engine.
It provides a distributed, multi-tenant-capable full-text search engine with an HTTP web interface and schema-free
JSON documents.
Installation and Setup#
pip install el... |
2ec11495fc78-0 | https://python.langchain.com/en/latest/integrations/replicate.html | .md
.pdf
Replicate
Contents
Installation and Setup
Calling a model
Replicate#
This page covers how to run models on Replicate within LangChain.
Installation and Setup#
Create a Replicate account. Get your API key and set it as an environment variable (REPLICATE_API_TOKEN)
Install the Replicate python client with pip ... |
2ec11495fc78-1 | https://python.langchain.com/en/latest/integrations/replicate.html | Answer the following yes/no question by reasoning step by step.
Can a dog drive a car?
"""
llm(prompt)
We can call any Replicate model (not just LLMs) using this syntax. For example, we can call Stable Diffusion:
text2image = Replicate(model="stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930... |
39a84b235d96-0 | https://python.langchain.com/en/latest/integrations/aim_tracking.html | .ipynb
.pdf
Aim
Aim#
Aim makes it super easy to visualize and debug LangChain executions. Aim tracks inputs and outputs of LLMs and tools, as well as actions of agents.
With Aim, you can easily debug and examine an individual execution:
Additionally, you have the option to compare multiple executions side by side:
Aim ... |
39a84b235d96-1 | https://python.langchain.com/en/latest/integrations/aim_tracking.html | experiment_name="scenario 1: OpenAI LLM",
)
callbacks = [StdOutCallbackHandler(), aim_callback]
llm = OpenAI(temperature=0, callbacks=callbacks)
The flush_tracker function is used to record LangChain assets on Aim. By default, the session is reset rather than being terminated outright.
Scenario 1 In the first scenario,... |
39a84b235d96-2 | https://python.langchain.com/en/latest/integrations/aim_tracking.html | from langchain.agents import initialize_agent, load_tools
from langchain.agents import AgentType
# scenario 3 - Agent with Tools
tools = load_tools(["serpapi", "llm-math"], llm=llm, callbacks=callbacks)
agent = initialize_agent(
tools,
llm,
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
callbacks=callback... |
4dcb8feca69c-0 | https://python.langchain.com/en/latest/integrations/tair.html | .md
.pdf
Tair
Contents
Installation and Setup
Wrappers
VectorStore
Tair#
This page covers how to use the Tair ecosystem within LangChain.
Installation and Setup#
Install Tair Python SDK with pip install tair.
Wrappers#
VectorStore#
There exists a wrapper around TairVector, allowing you to use it as a vectorstore,
whe... |
1ff7f7b3761e-0 | https://python.langchain.com/en/latest/integrations/ifixit.html | .md
.pdf
iFixit
Contents
Installation and Setup
Document Loader
iFixit#
iFixit is the largest, open repair community on the web. The site contains nearly 100k
repair manuals, 200k Questions & Answers on 42k devices, and all the data is licensed under CC-BY-NC-SA 3.0.
Installation and Setup#
There isn’t any special se... |
1e60a70505e4-0 | https://python.langchain.com/en/latest/integrations/azure_blob_storage.html | .md
.pdf
Azure Blob Storage
Contents
Installation and Setup
Document Loader
Azure Blob Storage#
Azure Blob Storage is Microsoft’s object storage solution for the cloud. Blob Storage is optimized for storing massive amounts of unstructured data. Unstructured data is data that doesn’t adhere to a particular data model ... |
d2c347e223c3-0 | https://python.langchain.com/en/latest/integrations/vectara/vectara_chat.html | .ipynb
.pdf
Chat Over Documents with Vectara
Contents
Pass in chat history
Return Source Documents
ConversationalRetrievalChain with search_distance
ConversationalRetrievalChain with map_reduce
ConversationalRetrievalChain with Question Answering with sources
ConversationalRetrievalChain with streaming to stdout
get_... |
d2c347e223c3-1 | https://python.langchain.com/en/latest/integrations/vectara/vectara_chat.html | qa = ConversationalRetrievalChain.from_llm(llm, retriever, memory=memory)
<class 'langchain.vectorstores.vectara.Vectara'>
query = "What did the president say about Ketanji Brown Jackson"
result = qa({"question": query})
result["answer"]
" The president said that Ketanji Brown Jackson is one of the nation's top legal m... |
d2c347e223c3-2 | https://python.langchain.com/en/latest/integrations/vectara/vectara_chat.html | You can also easily return source documents from the ConversationalRetrievalChain. This is useful for when you want to inspect what documents were returned.
qa = ConversationalRetrievalChain.from_llm(llm, vectorstore.as_retriever(), return_source_documents=True)
chat_history = []
query = "What did the president say abo... |
d2c347e223c3-3 | https://python.langchain.com/en/latest/integrations/vectara/vectara_chat.html | We can also use different types of combine document chains with the ConversationalRetrievalChain chain.
from langchain.chains import LLMChain
from langchain.chains.question_answering import load_qa_chain
from langchain.chains.conversational_retrieval.prompts import CONDENSE_QUESTION_PROMPT
question_generator = LLMChain... |
d2c347e223c3-4 | https://python.langchain.com/en/latest/integrations/vectara/vectara_chat.html | ConversationalRetrievalChain with streaming to stdout#
Output from the chain will be streamed to stdout token by token in this example.
from langchain.chains.llm import LLMChain
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.chains.conversational_retrieval.prompts import ... |
d2c347e223c3-5 | https://python.langchain.com/en/latest/integrations/vectara/vectara_chat.html | You can also specify a get_chat_history function, which can be used to format the chat_history string.
def get_chat_history(inputs) -> str:
res = []
for human, ai in inputs:
res.append(f"Human:{human}\nAI:{ai}")
return "\n".join(res)
qa = ConversationalRetrievalChain.from_llm(llm, vectorstore.as_ret... |
4b0cc4b5042e-0 | https://python.langchain.com/en/latest/integrations/vectara/vectara_text_generation.html | .ipynb
.pdf
Vectara Text Generation
Contents
Prepare Data
Set Up Vector DB
Set Up LLM Chain with Custom Prompt
Generate Text
Vectara Text Generation#
This notebook is based on chat_vector_db and adapted to Vectara.
Prepare Data#
First, we prepare the data. For this example, we fetch a documentation site that consists... |
4b0cc4b5042e-1 | https://python.langchain.com/en/latest/integrations/vectara/vectara_text_generation.html | splitter = CharacterTextSplitter(separator=" ", chunk_size=1024, chunk_overlap=0)
for source in sources:
for chunk in splitter.split_text(source.page_content):
source_chunks.append(chunk)
Cloning into '.'...
Set Up Vector DB#
Now that we have the documentation content in chunks, let’s put all this informati... |
4b0cc4b5042e-2 | https://python.langchain.com/en/latest/integrations/vectara/vectara_text_generation.html | [{'text': '\n\nEnvironment variables are an essential part of any development workflow. They provide a way to store and access information that is specific to the environment in which the code is running. This can be especially useful when working with different versions of a language or framework, or when running code... |
4b0cc4b5042e-3 | https://python.langchain.com/en/latest/integrations/vectara/vectara_text_generation.html | processes.\n\nFor example, if you wanted to store a value and then use it in a command, you could do something like this:\n\n```sh\nVAR=hello && echo $VAR && deno eval "console.log(\'Deno: \' + Deno.env.get(\'VAR\'))"\n```\n\nThis would output the following:\n\n```\nhello\nDeno: undefined\n```\n\nAs you can see, the va... |
4b0cc4b5042e-4 | https://python.langchain.com/en/latest/integrations/vectara/vectara_text_generation.html | with `Deno.env`, and you can also use a `.env` file to store and access environment variables. In this blog post, we\'ll explore both of these options and how to use them in your Deno applications.\n\n## Built-in `Deno.env`\n\nThe Deno runtime offers built-in support for environment variables with [`Deno.env`](https://... |
4b0cc4b5042e-5 | https://python.langchain.com/en/latest/integrations/vectara/vectara_text_generation.html | Contents
Prepare Data
Set Up Vector DB
Set Up LLM Chain with Custom Prompt
Generate Text
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 04, 2023. |
de301e8f982b-0 | https://python.langchain.com/en/latest/use_cases/autonomous_agents.html | .md
.pdf
Autonomous Agents
Contents
Baby AGI (Original Repo)
AutoGPT (Original Repo)
MetaPrompt (Original Repo)
Autonomous Agents#
Autonomous Agents are agents that designed to be more long running.
You give them one or multiple long term goals, and they independently execute towards those goals.
The applications com... |
59ba8a43869c-0 | https://python.langchain.com/en/latest/use_cases/evaluation.html | .rst
.pdf
Evaluation
Contents
The Problem
The Solution
The Examples
Other Examples
Evaluation#
Note
Conceptual Guide
This section of documentation covers how we approach and think about evaluation in LangChain.
Both evaluation of internal chains/agents, but also how we would recommend people building on top of LangCh... |
59ba8a43869c-1 | https://python.langchain.com/en/latest/use_cases/evaluation.html | We have contributed five datasets of our own to start, but we highly intend this to be a community effort.
In order to contribute a dataset, you simply need to join the community and then you will be able to upload datasets.
We’re also aiming to make it as easy as possible for people to create their own datasets.
As a ... |
59ba8a43869c-2 | https://python.langchain.com/en/latest/use_cases/evaluation.html | SQL Question Answering (Chinook): A notebook showing evaluation of a question-answering task over a SQL database (the Chinook database).
Agent Vectorstore: A notebook showing evaluation of an agent doing question answering while routing between two different vector databases.
Agent Search + Calculator: A notebook showi... |
ed26b8cf83b3-0 | https://python.langchain.com/en/latest/use_cases/personal_assistants.html | .md
.pdf
Agents
Contents
Create Your Own Agent
Step 1: Create Tools
(Optional) Step 2: Modify Agent
(Optional) Step 3: Modify Agent Executor
Examples
Agents#
Conceptual Guide
Agents can be used for a variety of tasks.
Agents combine the decision making ability of a language model with tools in order to create a syste... |
ed26b8cf83b3-1 | https://python.langchain.com/en/latest/use_cases/personal_assistants.html | (Optional) Step 3: Modify Agent Executor#
This step is usually not necessary, as this is pretty general logic.
Possible reasons you would want to modify this include adding different stopping conditions, or handling errors
Examples#
Specific examples of agents include:
AI Plugins: an implementation of an agent that is ... |
f835b9856251-0 | https://python.langchain.com/en/latest/use_cases/extraction.html | .md
.pdf
Extraction
Extraction#
Conceptual Guide
Most APIs and databases still deal with structured information.
Therefore, in order to better work with those, it can be useful to extract structured information from text.
Examples of this include:
Extracting a structured row to insert into a database from a sentence
Ex... |
092d8c7fb5dd-0 | https://python.langchain.com/en/latest/use_cases/apis.html | .md
.pdf
Interacting with APIs
Contents
Chains
Agents
Interacting with APIs#
Conceptual Guide
Lots of data and information is stored behind APIs.
This page covers all resources available in LangChain for working with APIs.
Chains#
If you are just getting started, and you have relatively simple apis, you should get st... |
1b23ecb1dcdb-0 | https://python.langchain.com/en/latest/use_cases/question_answering.html | .md
.pdf
Question Answering over Docs
Contents
Document Question Answering
Adding in sources
Additional Related Resources
End-to-end examples
Question Answering over Docs#
Conceptual Guide
Question answering in this context refers to question answering over your document data.
For question answering over other types ... |
1b23ecb1dcdb-1 | https://python.langchain.com/en/latest/use_cases/question_answering.html | The recommended way to get started using a question answering chain is:
from langchain.chains.question_answering import load_qa_chain
chain = load_qa_chain(llm, chain_type="stuff")
chain.run(input_documents=docs, question=query)
The following resources exist:
Question Answering Notebook: A notebook walking through how ... |
1b23ecb1dcdb-2 | https://python.langchain.com/en/latest/use_cases/question_answering.html | CombineDocuments Chains: A conceptual overview of specific types of chains by which you can accomplish this task.
End-to-end examples#
For examples to this done in an end-to-end manner, please see the following resources:
Semantic search over a group chat with Sources Notebook: A notebook that semantically searches ove... |
1a3bc28e0d10-0 | https://python.langchain.com/en/latest/use_cases/chatbots.html | .md
.pdf
Chatbots
Chatbots#
Conceptual Guide
Since language models are good at producing text, that makes them ideal for creating chatbots.
Aside from the base prompts/LLMs, an important concept to know for Chatbots is memory.
Most chat based applications rely on remembering what happened in previous interactions, whic... |
d3821648875e-0 | https://python.langchain.com/en/latest/use_cases/agent_simulations.html | .md
.pdf
Agent Simulations
Contents
Simulations with One Agent
Simulations with Two Agents
Simulations with Multiple Agents
Agent Simulations#
Agent simulations involve interacting one of more agents with each other.
Agent simulations generally involve two main components:
Long Term Memory
Simulation Environment
Spec... |
d3821648875e-1 | https://python.langchain.com/en/latest/use_cases/agent_simulations.html | Simulated Environment: PettingZoo: an example of how to create a agent-environment interaction loop for multiple agents with PettingZoo (a multi-agent version of Gymnasium).
Generative Agents: This notebook implements a generative agent based on the paper Generative Agents: Interactive Simulacra of Human Behavior by Pa... |
a0872f24f194-0 | https://python.langchain.com/en/latest/use_cases/code.html | .md
.pdf
Code Understanding
Contents
Conversational Retriever Chain
Code Understanding#
Overview
LangChain is a useful tool designed to parse GitHub code repositories. By leveraging VectorStores, Conversational RetrieverChain, and GPT-4, it can answer questions in the context of an entire GitHub repository or generat... |
a0872f24f194-1 | https://python.langchain.com/en/latest/use_cases/code.html | Twitter the-algorithm codebase analysis with Deep Lake: A notebook walking through how to parse github source code and run queries conversation.
LangChain codebase analysis with Deep Lake: A notebook walking through how to analyze and do question answering over THIS code base.
previous
Querying Tabular Data
next
Intera... |
7ac8f8027519-0 | https://python.langchain.com/en/latest/use_cases/summarization.html | .md
.pdf
Summarization
Summarization#
Conceptual Guide
Summarization involves creating a smaller summary of multiple longer documents.
This can be useful for distilling long documents into the core pieces of information.
The recommended way to get started using a summarization chain is:
from langchain.chains.summarize ... |
15790188f481-0 | https://python.langchain.com/en/latest/use_cases/tabular.html | .md
.pdf
Querying Tabular Data
Contents
Document Loading
Querying
Chains
Agents
Querying Tabular Data#
Conceptual Guide
Lots of data and information is stored in tabular data, whether it be csvs, excel sheets, or SQL tables.
This page covers all resources available in LangChain for working with data in this format.
D... |
2bd23bb88743-0 | https://python.langchain.com/en/latest/use_cases/autonomous_agents/autogpt.html | .ipynb
.pdf
AutoGPT
Contents
Set up tools
Set up memory
Setup model and AutoGPT
Run an example
AutoGPT#
Implementation of https://github.com/Significant-Gravitas/Auto-GPT but with LangChain primitives (LLMs, PromptTemplates, VectorStores, Embeddings, Tools)
Set up tools#
We’ll set up an AutoGPT with a search tool, an... |
2bd23bb88743-1 | https://python.langchain.com/en/latest/use_cases/autonomous_agents/autogpt.html | llm=ChatOpenAI(temperature=0),
memory=vectorstore.as_retriever()
)
# Set verbose to be true
agent.chain.verbose = True
Run an example#
Here we will make it write a weather report for SF
agent.run(["write a weather report for SF today"])
> Entering new LLMChain chain...
Prompt after formatting:
System: You are Tom, ... |
2bd23bb88743-2 | https://python.langchain.com/en/latest/use_cases/autonomous_agents/autogpt.html | 4. finish: use this to signal that you have finished all your objectives, args: "response": "final response to let people know you have finished your objectives"
Resources:
1. Internet access for searches and information gathering.
2. Long Term memory management.
3. GPT-3.5 powered Agents for delegation of simple tasks... |
2bd23bb88743-3 | https://python.langchain.com/en/latest/use_cases/autonomous_agents/autogpt.html | "text": "I will start by writing a weather report for San Francisco today. I will use the 'search' command to find the current weather conditions.",
"reasoning": "I need to gather information about the current weather conditions in San Francisco to write an accurate weather report.",
"plan": "- Use the ... |
2bd23bb88743-4 | https://python.langchain.com/en/latest/use_cases/autonomous_agents/autogpt.html | 1. search: useful for when you need to answer questions about current events. You should ask targeted questions, args json schema: {"query": {"title": "Query", "type": "string"}}
2. write_file: Write file to disk, args json schema: {"file_path": {"title": "File Path", "description": "name of file", "type": "string"}, "... |
2bd23bb88743-5 | https://python.langchain.com/en/latest/use_cases/autonomous_agents/autogpt.html | "speak": "thoughts summary to say to user"
},
"command": {
"name": "command name",
"args": {
"arg name": "value"
}
}
}
Ensure the response can be parsed by Python json.loads
System: The current time and date is Tue Apr 18 21:31:39 2023
System: This reminds you of these e... |
2bd23bb88743-6 | https://python.langchain.com/en/latest/use_cases/autonomous_agents/autogpt.html | "text": "I will start by writing a weather report for San Francisco today. I will use the 'search' command to find the current weather conditions.",
"reasoning": "I need to gather information about the current weather conditions in San Francisco to write an accurate weather report.",
"plan": "- Use the ... |
2bd23bb88743-7 | https://python.langchain.com/en/latest/use_cases/autonomous_agents/autogpt.html | "speak": "I will use the 'write_file' command to write a weather report for San Francisco today."
},
"command": {
"name": "write_file",
"args": {
"file_path": "weather_report.txt",
"text": "Weather Report for San Francisco Today:\n\nThe current weather in San Francisco is... |
2bd23bb88743-8 | https://python.langchain.com/en/latest/use_cases/autonomous_agents/autogpt.html | 2. write_file: Write file to disk, args json schema: {"file_path": {"title": "File Path", "description": "name of file", "type": "string"}, "text": {"title": "Text", "description": "text to write to file", "type": "string"}}
3. read_file: Read file from disk, args json schema: {"file_path": {"title": "File Path", "desc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.