id stringlengths 14 16 | text stringlengths 29 2.73k | source stringlengths 49 117 |
|---|---|---|
ada135c29afc-1 | 'Barack Obama, in full Barack Hussein Obama II, (born August 4, 1961, Honolulu, Hawaii, U.S.), 44th president of the United States (2009-17) and the first African American to hold the office. Before winning the presidency, Obama represented Illinois in the U.S. Senate (2005-08). Barack Hussein Obama II (/ b ə ˈ r ɑː k ... | https://python.langchain.com/en/latest/modules/agents/tools/examples/ddg.html |
ada135c29afc-2 | previous
ChatGPT Plugins
next
File System Tools
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 02, 2023. | https://python.langchain.com/en/latest/modules/agents/tools/examples/ddg.html |
a0afa9b10a50-0 | .ipynb
.pdf
SearxNG Search API
Contents
Custom Parameters
Obtaining results with metadata
SearxNG Search API#
This notebook goes over how to use a self hosted SearxNG search API to search the web.
You can check this link for more informations about Searx API parameters.
import pprint
from langchain.utilities import S... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-1 | search.run("large language model ", engines=['wiki'])
'Large language models (LLMs) represent a major advancement in AI, with the promise of transforming domains through learned knowledge. LLM sizes have been increasing 10X every year for the last few years, and as these models grow in complexity and size, so do their ... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-2 | search.run("deep learning", language='es', engines=['wiki'])
'Aprendizaje profundo (en inglés, deep learning) es un conjunto de algoritmos de aprendizaje automático (en inglés, machine learning) que intenta modelar abstracciones de alto nivel en datos usando arquitecturas computacionales que admiten transformaciones no... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-3 | 'title': 'Promptchainer: Chaining large language model prompts through '
'visual programming',
'link': 'https://dl.acm.org/doi/abs/10.1145/3491101.3519729',
'engines': ['google scholar'],
'category': 'science'},
{'snippet': '… can introspect the large prompt model. We derive the view '
'ϕ... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-4 | 'link': 'https://arxiv.org/abs/2204.02329',
'engines': ['google scholar'],
'category': 'science'}]
Get papers from arxiv
results = search.results("Large Language Model prompt", num_results=5, engines=['arxiv'])
pprint.pp(results)
[{'snippet': 'Thanks to the advanced improvement of large pre-trained language '
... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-5 | 'development of real-world AES systems, yet it remains an '
'under-explored area of research. Models designed for '
'prompt-specific AES rely heavily on prompt-specific knowledge '
'and perform poorly in the cross-prompt setting, whereas current '
'approaches to cross... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-6 | 'example selection. We further explore the use of monolingual '
'data and the feasibility of cross-lingual, cross-domain, and '
'sentence-to-document transfer learning in prompting. Extensive '
'experiments with GLM-130B (Zeng et al., 2022) as the testbed '
'show that... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-7 | 'effective, especially when the prompts are natural language. In '
'this paper, we investigate common attributes shared by effective '
'prompts. We first propose a human readable prompt tuning method '
'(F LUENT P ROMPT) based on Langevin dynamics that incorporates a '
... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-8 | 'In this work, we discuss methods of prompt programming, '
'emphasizing the usefulness of considering prompts through the '
'lens of natural language. We explore techniques for exploiting '
'the capacity of narratives and cultural anchors to encode '
'nuanced intentio... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-9 | 'scripts and screenplays.',
'title': 'dramatron',
'link': 'https://github.com/deepmind/dramatron',
'engines': ['github'],
'category': 'it'}]
We could also directly query for results from github and other source forges.
results = search.results("large language model", num_results = 20, engines=['github', 'gitlab... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-10 | 'engines': ['github'],
'category': 'it'},
{'snippet': 'Code for loralib, an implementation of "LoRA: Low-Rank '
'Adaptation of Large Language Models"',
'title': 'LoRA',
'link': 'https://github.com/microsoft/LoRA',
'engines': ['github'],
'category': 'it'},
{'snippet': 'Code for the paper "Evalua... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-11 | 'engines': ['github'],
'category': 'it'},
{'snippet': 'Optimus: the first large-scale pre-trained VAE language model',
'title': 'Optimus',
'link': 'https://github.com/ChunyuanLI/Optimus',
'engines': ['github'],
'category': 'it'},
{'snippet': 'Seminar on Large Language Models (COMP790-101 at UNC Chapel '
... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-12 | 'link': 'https://github.com/bigscience-workshop/biomedical',
'engines': ['github'],
'category': 'it'},
{'snippet': 'ChatGPT @ Home: Large Language Model (LLM) chatbot application, '
'written by ChatGPT',
'title': 'ChatGPT-at-Home',
'link': 'https://github.com/Sentdex/ChatGPT-at-Home',
'engines':... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
a0afa9b10a50-13 | 'engines': ['github'],
'category': 'it'},
{'snippet': 'This repository contains the code, data, and models of the paper '
'titled "XL-Sum: Large-Scale Multilingual Abstractive '
'Summarization for 44 Languages" published in Findings of the '
'Association for Computational Lingu... | https://python.langchain.com/en/latest/modules/agents/tools/examples/searx_search.html |
d7e0f0a922f6-0 | .ipynb
.pdf
SerpAPI
Contents
Custom Parameters
SerpAPI#
This notebook goes over how to use the SerpAPI component to search the web.
from langchain.utilities import SerpAPIWrapper
search = SerpAPIWrapper()
search.run("Obama's first name?")
'Barack Hussein Obama II'
Custom Parameters#
You can also customize the SerpAPI... | https://python.langchain.com/en/latest/modules/agents/tools/examples/serpapi.html |
d7e0f0a922f6-1 | repl_tool = Tool(
name="python_repl",
description="A Python shell. Use this to execute python commands. Input should be a valid python command. If you want to see the output of a value, you should print it out with `print(...)`.",
func=search.run,
)
previous
SearxNG Search API
next
Twilio
Contents
Custo... | https://python.langchain.com/en/latest/modules/agents/tools/examples/serpapi.html |
eb9fcbdfef27-0 | .ipynb
.pdf
ChatGPT Plugins
ChatGPT Plugins#
This example shows how to use ChatGPT Plugins within LangChain abstractions.
Note 1: This currently only works for plugins with no auth.
Note 2: There are almost certainly other ways to do this, this is just a first pass. If you have better ideas, please open a PR!
from lang... | https://python.langchain.com/en/latest/modules/agents/tools/examples/chatgpt_plugins.html |
eb9fcbdfef27-1 | OpenAPI Spec: {'openapi': '3.0.1', 'info': {'version': 'v0', 'title': 'Open AI Klarna product Api'}, 'servers': [{'url': 'https://www.klarna.com/us/shopping'}], 'tags': [{'name': 'open-ai-product-endpoint', 'description': 'Open AI Product Endpoint. Query for products.'}], 'paths': {'/public/openai/v0/products': {'get':... | https://python.langchain.com/en/latest/modules/agents/tools/examples/chatgpt_plugins.html |
eb9fcbdfef27-2 | 'title': 'Product'}, 'ProductResponse': {'type': 'object', 'properties': {'products': {'type': 'array', 'items': {'$ref': '#/components/schemas/Product'}}}, 'title': 'ProductResponse'}}}} | https://python.langchain.com/en/latest/modules/agents/tools/examples/chatgpt_plugins.html |
eb9fcbdfef27-3 | Thought:I need to use the Klarna Shopping API to search for t shirts.
Action: requests_get
Action Input: https://www.klarna.com/us/shopping/public/openai/v0/products?q=t%20shirts | https://python.langchain.com/en/latest/modules/agents/tools/examples/chatgpt_plugins.html |
eb9fcbdfef27-4 | Observation: {"products":[{"name":"Lacoste Men's Pack of Plain T-Shirts","url":"https://www.klarna.com/us/shopping/pl/cl10001/3202043025/Clothing/Lacoste-Men-s-Pack-of-Plain-T-Shirts/?utm_source=openai","price":"$26.60","attributes":["Material:Cotton","Target Group:Man","Color:White,Black"]},{"name":"Hanes Men's Ultima... | https://python.langchain.com/en/latest/modules/agents/tools/examples/chatgpt_plugins.html |
eb9fcbdfef27-5 | Comfort T-shirts Men's 3-pack","url":"https://www.klarna.com/us/shopping/pl/cl10001/3202640533/Clothing/adidas-Comfort-T-shirts-Men-s-3-pack/?utm_source=openai","price":"$14.99","attributes":["Material:Cotton","Target Group:Man","Color:White,Black","Neckline:Round"]}]} | https://python.langchain.com/en/latest/modules/agents/tools/examples/chatgpt_plugins.html |
eb9fcbdfef27-6 | Thought:The available t shirts in Klarna are Lacoste Men's Pack of Plain T-Shirts, Hanes Men's Ultimate 6pk. Crewneck T-Shirts, Nike Boy's Jordan Stretch T-shirts, Polo Classic Fit Cotton V-Neck T-Shirts 3-Pack, and adidas Comfort T-shirts Men's 3-pack.
Final Answer: The available t shirts in Klarna are Lacoste Men's P... | https://python.langchain.com/en/latest/modules/agents/tools/examples/chatgpt_plugins.html |
0ec6dfed857b-0 | .ipynb
.pdf
Brave Search
Brave Search#
This notebook goes over how to use the Brave Search tool.
from langchain.tools import BraveSearch
api_key = "..."
tool = BraveSearch.from_api_key(api_key=api_key, search_kwargs={"count": 3})
tool.run("obama middle name") | https://python.langchain.com/en/latest/modules/agents/tools/examples/brave_search.html |
0ec6dfed857b-1 | '[{"title": "Barack Obama - Wikipedia", "link": "https://en.wikipedia.org/wiki/Barack_Obama", "snippet": "Outside of politics, <strong>Obama</strong> has published three bestselling books: Dreams from My Father (1995), The Audacity of Hope (2006) and A Promised Land (2020). Rankings by scholars and historians, in which... | https://python.langchain.com/en/latest/modules/agents/tools/examples/brave_search.html |
0ec6dfed857b-2 | Hussein, Obama\\u2019s middle name, is a very common Arabic name, meaning "good," "handsome," or "beautiful.""}]' | https://python.langchain.com/en/latest/modules/agents/tools/examples/brave_search.html |
0ec6dfed857b-3 | previous
Bing Search
next
ChatGPT Plugins
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 02, 2023. | https://python.langchain.com/en/latest/modules/agents/tools/examples/brave_search.html |
2ae97cb9c0c8-0 | .ipynb
.pdf
ArXiv API Tool
Contents
The ArXiv API Wrapper
ArXiv API Tool#
This notebook goes over how to use the arxiv component.
First, you need to install arxiv python package.
!pip install arxiv
from langchain.chat_models import ChatOpenAI
from langchain.agents import load_tools, initialize_agent, AgentType
llm = ... | https://python.langchain.com/en/latest/modules/agents/tools/examples/arxiv.html |
2ae97cb9c0c8-1 | Final Answer: The paper 1605.08386 is about heat-bath random walks with Markov bases on graphs of lattice points.
> Finished chain.
'The paper 1605.08386 is about heat-bath random walks with Markov bases on graphs of lattice points.'
The ArXiv API Wrapper#
The tool wraps the API Wrapper. Below, we can explore some of t... | https://python.langchain.com/en/latest/modules/agents/tools/examples/arxiv.html |
2ae97cb9c0c8-2 | docs = arxiv.run("Caprice Stanley")
docs
'Published: 2017-10-10\nTitle: On Mixing Behavior of a Family of Random Walks Determined by a Linear Recurrence\nAuthors: Caprice Stanley, Seth Sullivant\nSummary: We study random walks on the integers mod $G_n$ that are determined by an\ninteger sequence $\\{ G_n \\}_{n \\geq 1... | https://python.langchain.com/en/latest/modules/agents/tools/examples/arxiv.html |
2ae97cb9c0c8-3 | Now, we are trying to find information about non-existing article. In this case, the response is “No good Arxiv Result was found”
docs = arxiv.run("1605.08386WWW")
docs
'No good Arxiv Result was found'
previous
Apify
next
AWS Lambda API
Contents
The ArXiv API Wrapper
By Harrison Chase
© Copyright 2023, H... | https://python.langchain.com/en/latest/modules/agents/tools/examples/arxiv.html |
4a958f7d2b5a-0 | .ipynb
.pdf
Python REPL
Python REPL#
Sometimes, for complex calculations, rather than have an LLM generate the answer directly, it can be better to have the LLM generate code to calculate the answer, and then run that code to get the answer. In order to easily do that, we provide a simple Python REPL to execute command... | https://python.langchain.com/en/latest/modules/agents/tools/examples/python.html |
35020e7a7e77-0 | .ipynb
.pdf
Wolfram Alpha
Wolfram Alpha#
This notebook goes over how to use the wolfram alpha component.
First, you need to set up your Wolfram Alpha developer account and get your APP ID:
Go to wolfram alpha and sign up for a developer account here
Create an app and get your APP ID
pip install wolframalpha
Then we wil... | https://python.langchain.com/en/latest/modules/agents/tools/examples/wolfram_alpha.html |
94312ba89cfe-0 | .ipynb
.pdf
Apify
Apify#
This notebook shows how to use the Apify integration for LangChain.
Apify is a cloud platform for web scraping and data extraction,
which provides an ecosystem of more than a thousand
ready-made apps called Actors for various web scraping, crawling, and data extraction use cases.
For example, y... | https://python.langchain.com/en/latest/modules/agents/tools/examples/apify.html |
94312ba89cfe-1 | actor_id="apify/website-content-crawler",
run_input={"startUrls": [{"url": "https://python.langchain.com/en/latest/"}]},
dataset_mapping_function=lambda item: Document(
page_content=item["text"] or "", metadata={"source": item["url"]}
),
)
Initialize the vector index from the crawled documents:
inde... | https://python.langchain.com/en/latest/modules/agents/tools/examples/apify.html |
5234c0ac6b96-0 | .ipynb
.pdf
Zapier Natural Language Actions API
Contents
Zapier Natural Language Actions API
Example with Agent
Example with SimpleSequentialChain
Zapier Natural Language Actions API#
Full docs here: https://nla.zapier.com/api/v1/docs
Zapier Natural Language Actions gives you access to the 5k+ apps, 20k+ actions on Z... | https://python.langchain.com/en/latest/modules/agents/tools/examples/zapier.html |
5234c0ac6b96-1 | os.environ["OPENAI_API_KEY"] = os.environ.get("OPENAI_API_KEY", "")
# get from https://nla.zapier.com/demo/provider/debug (under User Information, after logging in):
os.environ["ZAPIER_NLA_API_KEY"] = os.environ.get("ZAPIER_NLA_API_KEY", "")
Example with Agent#
Zapier tools can be used with an agent. See the example b... | https://python.langchain.com/en/latest/modules/agents/tools/examples/zapier.html |
5234c0ac6b96-2 | Action: Gmail: Find Email
Action Input: Find the latest email from Silicon Valley Bank
Observation: {"from__name": "Silicon Valley Bridge Bank, N.A.", "from__email": "sreply@svb.com", "body_plain": "Dear Clients, After chaotic, tumultuous & stressful days, we have clarity on path for SVB, FDIC is fully insuring all dep... | https://python.langchain.com/en/latest/modules/agents/tools/examples/zapier.html |
5234c0ac6b96-3 | Observation: {"message__text": "Silicon Valley Bank has announced that Tim Mayopoulos is the new CEO. FDIC is fully insuring all deposits and they have an ask for clients and partners as they rebuild.", "message__permalink": "https://langchain.slack.com/archives/C04TSGU0RA7/p1678859932375259", "channel": "C04TSGU0RA7",... | https://python.langchain.com/en/latest/modules/agents/tools/examples/zapier.html |
5234c0ac6b96-4 | from langchain.prompts import PromptTemplate
from langchain.tools.zapier.tool import ZapierNLARunAction
from langchain.utilities.zapier import ZapierNLAWrapper
## step 0. expose gmail 'find email' and slack 'send direct message' actions
# first go here, log in, expose (enable) the two actions: https://nla.zapier.com/de... | https://python.langchain.com/en/latest/modules/agents/tools/examples/zapier.html |
5234c0ac6b96-5 | SLACK_HANDLE = "@Ankush Gola"
def nla_slack(inputs):
action = next((a for a in actions if a["description"].startswith("Slack: Send Direct Message")), None)
instructions = f'Send this to {SLACK_HANDLE} in Slack: {inputs["draft_reply"]}'
return {"slack_data": ZapierNLARunAction(action_id=action["id"], zapier_... | https://python.langchain.com/en/latest/modules/agents/tools/examples/zapier.html |
5234c0ac6b96-6 | overall_chain.run(GMAIL_SEARCH_INSTRUCTIONS)
> Entering new SimpleSequentialChain chain...
{"from__name": "Silicon Valley Bridge Bank, N.A.", "from__email": "sreply@svb.com", "body_plain": "Dear Clients, After chaotic, tumultuous & stressful days, we have clarity on path for SVB, FDIC is fully insuring all deposits & h... | https://python.langchain.com/en/latest/modules/agents/tools/examples/zapier.html |
5234c0ac6b96-7 | Best regards,
[Your Name]
{"message__text": "Dear Silicon Valley Bridge Bank, \n\nThank you for your email and the update regarding your new CEO Tim Mayopoulos. We appreciate your dedication to keeping your clients and partners informed and we look forward to continuing our relationship with you. \n\nBest regards, \n[... | https://python.langchain.com/en/latest/modules/agents/tools/examples/zapier.html |
5234c0ac6b96-8 | > Finished chain.
'{"message__text": "Dear Silicon Valley Bridge Bank, \\n\\nThank you for your email and the update regarding your new CEO Tim Mayopoulos. We appreciate your dedication to keeping your clients and partners informed and we look forward to continuing our relationship with you. \\n\\nBest regards, \\n[You... | https://python.langchain.com/en/latest/modules/agents/tools/examples/zapier.html |
4b2eb3561dc5-0 | .ipynb
.pdf
Requests
Contents
Inside the tool
Requests#
The web contains a lot of information that LLMs do not have access to. In order to easily let LLMs interact with that information, we provide a wrapper around the Python Requests module that takes in a URL and fetches data from that URL.
from langchain.agents im... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-1 | RequestsPatchTool(name='requests_patch', description='Use this when you want to PATCH to a website.\n Input should be a json string with two keys: "url" and "data".\n The value of "url" should be a string, and the value of "data" should be a dictionary of \n key-value pairs you want to PATCH to the url.\n B... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-2 | Each requests tool contains a requests wrapper. You can work with these wrappers directly below
# Each tool wrapps a requests wrapper
requests_tools[0].requests_wrapper
TextRequestsWrapper(headers=None, aiosession=None)
from langchain.utilities import TextRequestsWrapper
requests = TextRequestsWrapper()
requests.get("h... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-3 | '<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en"><head><meta content="Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for." name="description"><meta content="noodp" name="robots"... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-4 | nonce="MXrF0nnIBPkxBza4okrgPA">(function(){window.google={kEI:\'TA9QZOa5EdTakPIPuIad-Ac\',kEXPI:\'0,1359409,6059,206,4804,2316,383,246,5,1129120,1197768,626,380097,16111,28687,22431,1361,12319,17581,4997,13228,37471,7692,2891,3926,213,7615,606,50058,8228,17728,432,3,346,1244,1,16920,2648,4,1528,2304,29062,9871,3194,136... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-5 | ,342,23024,6699,31123,4568,6258,23418,1252,5835,14967,4333,4239,3245,445,2,2,1,26632,239,7916,7321,60,2,3,15965,872,7830,1796,10008,7,1922,9779,36154,6305,2007,17765,427,20136,14,82,2730,184,13600,3692,109,2412,1548,4308,3785,15175,3888,1515,3030,5628,478,4,9706,1804,7734,2738,1853,1032,9480,2995,576,1041,5648,3722,205... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-6 | ,1439,1128,7343,426,249,517,95,1102,14,696,1270,750,400,2208,274,2776,164,89,119,204,139,129,1710,2505,320,3,631,439,2,300,1645,172,1783,784,169,642,329,401,50,479,614,238,757,535,717,102,2,739,738,44,232,22,442,961,45,214,383,567,500,487,151,120,256,253,179,673,2,102,2,10,535,123,135,1685,5206695,190,2,20,50,198,59942... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-7 | 9,1,5,1,16,7,2,41,247,4,9,7,9,15,4,4,121,24,23944834,4042142,1964,16672,2894,6250,15739,1726,647,409,837,1411438,146986,23612960,7,84,93,33,101,816,57,532,163,1,441,86,1,951,73,31,2,345,178,243,472,2,148,962,455,167,178,29,702,1856,288,292,805,93,137,68,416,177,292,399,55,95,2566\',kBL:\'hw1A\',kOPI:89978449};google.sn... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-8 | h=this||self;function l(){return void 0!==window.google&&void 0!==window.google.kOPI&&0!==window.google.kOPI?window.google.kOPI:null};var m,n=[];function p(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||m}function q(a){for(var b=null;a&&(!a.getAttribute||!(b=a.getAttribute("leid... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-9 | null};google.log=function(a,b,c,d,k,e){e=void 0===e?l:e;c||(c=t(a,b,e,d,k));if(c=r(c)){a=new Image;var g=n.length;n[g]=a;a.onerror=a.onload=a.onabort=function(){delete n[g]};a.src=c}};google.logUrl=function(a,b){b=void 0===b?l:b;return t("",a,b)};}).call(this);(function(){google.y={};google.sy=[];google.x=function(a,b)... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-10 | !important;}#gbar{height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-11 | a{display:block;margin:2px 0;margin-left:13px;font-size:11px}.lsbb{background:#f8f9fa;border:solid 1px;border-color:#dadce0 #70757a #70757a #dadce0;height:30px}.lsbb{display:block}#WqQANb a{display:inline-block;margin:0 12px}.lsb{background:url(/images/nav_logo229.png) 0 -261px repeat-x;border:none;color:#000;cursor:po... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-12 | null;q++;d=d||{};b=encodeURIComponent;var c="/gen_204?atyp=i&ei="+b(google.kEI);google.kEXPI&&(c+="&jexpid="+b(google.kEXPI));c+="&srcpg="+b(google.sn)+"&jsr="+b(t.jsr)+"&bver="+b(t.bv);var f=a.lineNumber;void 0!==f&&(c+="&line="+f);var g=\na.fileName;g&&(0<g.indexOf("-extension:/")&&(e=3),c+="&script="+b(g),f&&g===win... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-13 | nonce="MXrF0nnIBPkxBza4okrgPA">(function(){var src=\'/images/nav_logo229.png\';var iesg=false;document.body.onload = function(){window.n && window.n();if (document.images){new Image().src=src;}\nif (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();}\n}\n})();</script><div id="mngb"><div id... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-14 | class=gb4>Web History</a> | <a href="/preferences?hl=en" class=gb4>Settings</a> | <a target=_top id=gb_70 href="https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/&ec=GAZAAQ" class=gb4>Sign in</a></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div>... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-15 | class="ds"><span class="lsbb"><input class="lsb" value="Google Search" name="btnG" type="submit"></span></span><span class="ds"><span class="lsbb"><input class="lsb" id="tsuid_1" value="I\'m Feeling Lucky" name="btnI" type="submit"><script nonce="MXrF0nnIBPkxBza4okrgPA">(function(){var id=\'tsuid_1\';document.getElemen... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-16 | ActiveXObject(d),b="2"}catch(h){}}a=b;if("2"==a&&-1==location.search.indexOf("&gbv=2")){var f=google.gbvu,g=document.getElementById("gbv");g&&(g.value=a);f&&window.setTimeout(function(){location.href=f},0)};}).call(this);</script></form><div id="gac_scont"></div><div style="font-size:83%;min-height:3.5em"><br><div id="... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-17 | Asian Pacific American Heritage Month with Google</a></div></div></div><span id="footer"><div style="font-size:10pt"><div style="margin:19px auto;text-align:center" id="WqQANb"><a href="/intl/en/ads/">Advertising</a><a href="/services/">Business Solutions</a><a href="/intl/en/about.html">About Google</a></div></div><p ... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-18 | nonce="MXrF0nnIBPkxBza4okrgPA">(function(){var u=\'/xjs/_/js/k\\x3dxjs.hp.en.q0lHXBfs9JY.O/am\\x3dAAAA6AQAUABgAQ/d\\x3d1/ed\\x3d1/rs\\x3dACT90oE3ek6-fjkab6CsTH0wUEUUPhnExg/m\\x3dsb_he,d\';var amd=0;\nvar e=this||self,f=function(c){return c};var h;var n=function(c,g){this.g=g===l?c:""};n.prototype.toString=function(){re... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-19 | 0:q.call(k,"script[nonce]"))?a.nonce||a.getAttribute("nonce")||"":"")&&b.setAttribute("nonce",k);document.body.appendChild(b);google.psa=!0;google.lx=g};google.bx||google.lx()};google.xjsu=u;e._F_jsUrl=u;setTimeout(function(){0<amd?google.caft(function(){return p()},amd):p()},0);})();window._ = window._ || {};window._D... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-20 | Search\\x22,\\x22dym\\x22:\\x22Did you mean:\\x22,\\x22lcky\\x22:\\x22I\\\\u0026#39;m Feeling Lucky\\x22,\\x22lml\\x22:\\x22Learn more\\x22,\\x22psrc\\x22:\\x22This search was removed from your \\\\u003Ca href\\x3d\\\\\\x22/history\\\\\\x22\\\\u003EWeb History\\\\u003C/a\\\\u003E\\x22,\\x22psrl\\x22:\\x22Remove\\x22,\\... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
4b2eb3561dc5-21 | previous
Python REPL
next
SceneXplain
Contents
Inside the tool
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 02, 2023. | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
84a132010cfb-0 | .ipynb
.pdf
SceneXplain
Contents
Usage in an Agent
SceneXplain#
SceneXplain is an ImageCaptioning service accessible through the SceneXplain Tool.
To use this tool, you’ll need to make an account and fetch your API Token from the website. Then you can instantiate the tool.
import os
os.environ["SCENEX_API_KEY"] = "<Y... | https://python.langchain.com/en/latest/modules/agents/tools/examples/sceneXplain.html |
84a132010cfb-1 | Observation: In a charmingly whimsical scene, a young girl is seen braving the rain alongside her furry companion, the lovable Totoro. The two are depicted standing on a bustling street corner, where they are sheltered from the rain by a bright yellow umbrella. The girl, dressed in a cheerful yellow frock, holds onto t... | https://python.langchain.com/en/latest/modules/agents/tools/examples/sceneXplain.html |
84a132010cfb-2 | By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 02, 2023. | https://python.langchain.com/en/latest/modules/agents/tools/examples/sceneXplain.html |
1f0b57e82a0a-0 | .ipynb
.pdf
IFTTT WebHooks
Contents
Creating a webhook
Configuring the “If This”
Configuring the “Then That”
Finishing up
IFTTT WebHooks#
This notebook shows how to use IFTTT Webhooks.
From https://github.com/SidU/teams-langchain-js/wiki/Connecting-IFTTT-Services.
Creating a webhook#
Go to https://ifttt.com/create
Co... | https://python.langchain.com/en/latest/modules/agents/tools/examples/ifttt.html |
1f0b57e82a0a-1 | service, and you’re ready to start receiving data and triggering actions 🎉
Finishing up#
To get your webhook URL go to https://ifttt.com/maker_webhooks/settings
Copy the IFTTT key value from there. The URL is of the form
https://maker.ifttt.com/use/YOUR_IFTTT_KEY. Grab the YOUR_IFTTT_KEY value.
from langchain.tools.if... | https://python.langchain.com/en/latest/modules/agents/tools/examples/ifttt.html |
c6278ab55150-0 | .ipynb
.pdf
Twilio
Contents
Setup
Sending a message
Twilio#
This notebook goes over how to use the Twilio API wrapper to send a text message.
Setup#
To use this tool you need to install the Python Twilio package twilio
# !pip install twilio
You’ll also need to set up a Twilio account and get your credentials. You’ll ... | https://python.langchain.com/en/latest/modules/agents/tools/examples/twilio.html |
38b2d512f83e-0 | .ipynb
.pdf
Shell Tool
Contents
Use with Agents
Shell Tool#
Giving agents access to the shell is powerful (though risky outside a sandboxed environment).
The LLM can use it to execute any shell commands. A common use case for this is letting the LLM interact with your local file system.
from langchain.tools import Sh... | https://python.langchain.com/en/latest/modules/agents/tools/examples/bash.html |
38b2d512f83e-1 | Action:
```
{
"action": "shell",
"action_input": {
"commands": [
"curl -s https://langchain.com | grep -o 'http[s]*://[^\" ]*' | sort"
]
}
}
```
/Users/wfh/code/lc/lckg/langchain/tools/shell/tool.py:34: UserWarning: The shell tool has no safeguards by default. Use at your own risk.
warnings.warn(
... | https://python.langchain.com/en/latest/modules/agents/tools/examples/bash.html |
38b2d512f83e-2 | > Finished chain.
'["https://blog.langchain.dev/", "https://discord.gg/6adMQxSpJS", "https://docs.langchain.com/docs/", "https://github.com/hwchase17/chat-langchain", "https://github.com/hwchase17/langchain", "https://github.com/hwchase17/langchainjs", "https://github.com/sullivan-sean/chat-langchainjs", "https://js.la... | https://python.langchain.com/en/latest/modules/agents/tools/examples/bash.html |
0db0cb2ffdd5-0 | .ipynb
.pdf
Wikipedia
Wikipedia#
Wikipedia is a multilingual free online encyclopedia written and maintained by a community of volunteers, known as Wikipedians, through open collaboration and using a wiki-based editing system called MediaWiki. Wikipedia is the largest and most-read reference work in history.
First, you... | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
0db0cb2ffdd5-1 | 'Page: Hunter × Hunter\nSummary: Hunter × Hunter (stylized as HUNTER×HUNTER and pronounced "hunter hunter") is a Japanese manga series written and illustrated by Yoshihiro Togashi. It has been serialized in Shueisha\'s shōnen manga magazine Weekly Shōnen Jump since March 1998, although the manga has frequently gone on ... | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
0db0cb2ffdd5-2 | by Viz Media, with the first series having aired on the Funimation Channel in 2009 and the second series broadcast on Adult Swim\'s Toonami programming block from April 2016 to June 2019.\nHunter × Hunter has been a huge critical and financial success and has become one of the best-selling manga series of all time, hav... | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
0db0cb2ffdd5-3 | cast to voice the characters. The new series premiered airing weekly on Nippon TV and the nationwide Nippon News Network from October 2, 2011. The series started to be collected in both DVD and Blu-ray format on January 25, 2012. Viz Media has licensed the anime for a DVD/Blu-ray release in North America with an Engli... | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
0db0cb2ffdd5-4 | on special jobs ranging from treasure hunting to assassination. The story initially focuses on Gon Freecss and his quest to become a Hunter in order to find his father, Ging, who is himself a famous Hunter. On the way, Gon meets and becomes close friends with Killua Zoldyck, Kurapika and Leorio Paradinight.\nAlthough m... | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
0db0cb2ffdd5-5 | previous
Twilio
next
Wolfram Alpha
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 02, 2023. | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
537ea39b0486-0 | .ipynb
.pdf
GraphQL tool
GraphQL tool#
This Jupyter Notebook demonstrates how to use the BaseGraphQLTool component with an Agent.
GraphQL is a query language for APIs and a runtime for executing those queries against your data. GraphQL provides a complete and understandable description of the data in your API, gives cl... | https://python.langchain.com/en/latest/modules/agents/tools/examples/graphql.html |
537ea39b0486-1 | name
classification
homeworld {
name
}
}
}
}
}
"""
suffix = "Search for the titles of all the stawars films stored in the graphql database that has this schema "
agent.run(suffix + graphql_fields)
> Entering new AgentExecutor chain...
I need to query the gr... | https://python.langchain.com/en/latest/modules/agents/tools/examples/graphql.html |
537ea39b0486-2 | By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 02, 2023. | https://python.langchain.com/en/latest/modules/agents/tools/examples/graphql.html |
4f0213801ddf-0 | .ipynb
.pdf
Gradio Tools
Contents
Using a tool
Using within an agent
Gradio Tools#
There are many 1000s of Gradio apps on Hugging Face Spaces. This library puts them at the tips of your LLM’s fingers 🦾
Specifically, gradio-tools is a Python library for converting Gradio apps into tools that can be leveraged by a lar... | https://python.langchain.com/en/latest/modules/agents/tools/examples/gradio_tools.html |
4f0213801ddf-1 | from langchain.agents import initialize_agent
from langchain.llms import OpenAI
from gradio_tools.tools import (StableDiffusionTool, ImageCaptioningTool, StableDiffusionPromptGeneratorTool,
TextToVideoTool)
from langchain.memory import ConversationBufferMemory
llm = OpenAI(temperature=0)... | https://python.langchain.com/en/latest/modules/agents/tools/examples/gradio_tools.html |
4f0213801ddf-2 | Thought: Do I need to use a tool? Yes
Action: StableDiffusion
Action Input: A dog riding a skateboard, digital painting, artstation, concept art, smooth, sharp focus, illustration, art by artgerm and greg rutkowski and alphonse mucha
Job Status: Status.STARTING eta: None
Job Status: Status.PROCESSING eta: None
Observat... | https://python.langchain.com/en/latest/modules/agents/tools/examples/gradio_tools.html |
4f0213801ddf-3 | Job Status: Status.IN_QUEUE eta: 42.49370198879602
Job Status: Status.IN_QUEUE eta: 21.314297944849187
Observation: /var/folders/bm/ylzhm36n075cslb9fvvbgq640000gn/T/tmp5snj_nmzf20_cb3m.mp4
Thought: Do I need to use a tool? No
AI: Here is a video of a painting of a dog sitting on a skateboard.
> Finished chain.
previous... | https://python.langchain.com/en/latest/modules/agents/tools/examples/gradio_tools.html |
b4b909cbd0fa-0 | .ipynb
.pdf
Search Tools
Contents
Google Serper API Wrapper
SerpAPI
GoogleSearchAPIWrapper
SearxNG Meta Search Engine
Search Tools#
This notebook shows off usage of various search tools.
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents import AgentType
from l... | https://python.langchain.com/en/latest/modules/agents/tools/examples/search_tools.html |
b4b909cbd0fa-1 | Action: Search
Action Input: "weather in Pomfret"
Observation: Partly cloudy skies during the morning hours will give way to cloudy skies with light rain and snow developing in the afternoon. High 42F. Winds WNW at 10 to 15 ...
Thought: I now know the current weather in Pomfret.
Final Answer: Partly cloudy skies during... | https://python.langchain.com/en/latest/modules/agents/tools/examples/search_tools.html |
b4b909cbd0fa-2 | Action: Google Search
Action Input: "weather in Pomfret"
Observation: Showers early becoming a steady light rain later in the day. Near record high temperatures. High around 60F. Winds SW at 10 to 15 mph. Chance of rain 60%. Pomfret, CT Weather Forecast, with current conditions, wind, air quality, and what to expect fo... | https://python.langchain.com/en/latest/modules/agents/tools/examples/search_tools.html |
b4b909cbd0fa-3 | Thought: I now know the current weather conditions in Pomfret.
Final Answer: Showers early becoming a steady light rain later in the day. Near record high temperatures. High around 60F. Winds SW at 10 to 15 mph. Chance of rain 60%.
> Finished AgentExecutor chain.
'Showers early becoming a steady light rain later in the... | https://python.langchain.com/en/latest/modules/agents/tools/examples/search_tools.html |
b4b909cbd0fa-4 | 10 Day Weather - Pomfret, VT As of 3:51 am EST Special Weather Statement Today 39°/ 32° 37% Wed 01 | Day 39° 37% NE 4 mph Cloudy with snow showers developing for the afternoon. High 39F....
Pomfret, CT ; Current Weather. 1:06 AM. 35°F · RealFeel® 32° ; TODAY'S WEATHER FORECAST. 3/3. 44°Hi. RealFeel® 50° ; TONIGHT'S WEA... | https://python.langchain.com/en/latest/modules/agents/tools/examples/search_tools.html |
b4b909cbd0fa-5 | 12:00 pm · Feels Like36° · WindN 5 mph · Humidity43% · UV Index3 of 10 · Cloud Cover65% · Rain Amount0 in ...
Pomfret Center, CT Weather Conditions | Weather Underground star Popular Cities San Francisco, CA 49 °F Clear Manhattan, NY 37 °F Fair Schiller Park, IL (60176) warning39 °F Mostly Cloudy...
Thought: I now know... | https://python.langchain.com/en/latest/modules/agents/tools/examples/search_tools.html |
66457d097e58-0 | .ipynb
.pdf
Google Serper API
Contents
As part of a Self Ask With Search Chain
Obtaining results with metadata
Searching for Google Images
Searching for Google News
Searching for Google Places
Google Serper API#
This notebook goes over how to use the Google Serper component to search the web. First you need to sign u... | https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html |
66457d097e58-1 | Intermediate answer: El Palmar, Spain
So the final answer is: El Palmar, Spain
> Finished chain.
'El Palmar, Spain'
Obtaining results with metadata#
If you would also like to obtain the results in a structured way including metadata. For this we will be using the results method of the wrapper.
search = GoogleSerperAPIW... | https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html |
66457d097e58-2 | 'CEO': 'Tim Cook (Aug 24, 2011–)',
'Headquarters': 'Cupertino, CA',
'Founded': 'April 1, 1976, Los Altos, CA',
'Founders': 'Steve Jobs, Steve Wozniak, '
'Ronald Wayne, ... | https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html |
66457d097e58-3 | 'revenue, ...',
'attributes': {'Products': 'AirPods; Apple Watch; iPad; iPhone; '
'Mac; Full list',
'Founders': 'Steve Jobs; Steve Wozniak; Ronald '
'Wayne; Mike Markkula'},
'siteli... | https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.