id stringlengths 14 16 | text stringlengths 36 2.73k | source stringlengths 49 117 |
|---|---|---|
57e8b7a62bd3-6 | """Searches the API for the query."""
return "Results"
search_api
Tool(name='search', description='search(query: str) -> str - Searches the API for the query.', args_schema=<class '__main__.SearchInput'>, return_direct=True, verbose=False, callback_manager=<langchain.callbacks.shared.SharedCallbackManager object at... | https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html |
57e8b7a62bd3-7 | """Use the tool."""
search_wrapper = SerpAPIWrapper(params={"engine": engine, "gl": gl, "hl": hl})
return search_wrapper.run(query)
async def _arun(self, query: str, engine: str = "google", gl: str = "us", hl: str = "en", run_manager: Optional[AsyncCallbackManagerForToolRun] = None) -> str:
... | https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html |
57e8b7a62bd3-8 | """Use the tool asynchronously."""
raise NotImplementedError("custom_search does not support async")
Using the decorator#
The tool decorator creates a structured tool automatically if the signature has multiple arguments.
import requests
from langchain.tools import tool
@tool
def post_message(url: str... | https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html |
57e8b7a62bd3-9 | Action: Google Search
Action Input: "Leo DiCaprio current girlfriend age"
Observation: Leonardo DiCaprio has been linked with 19-year-old model Eden Polani, continuing the rumour that he doesn't date any women over the age of ...
Thought:I need to find out the age of Eden Polani.
Action: Calculator
Action Input: 19^(0.... | https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html |
57e8b7a62bd3-10 | tools = [
Tool(
name = "Search",
func=search.run,
description="useful for when you need to answer questions about current events"
),
Tool(
name="Music Search",
func=lambda x: "'All I Want For Christmas Is You' by Mariah Carey.", #Mock Function
description="A M... | https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html |
57e8b7a62bd3-11 | return_direct=True
)
]
llm = OpenAI(temperature=0)
agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
agent.run("whats 2**.12")
> Entering new AgentExecutor chain...
I need to calculate this
Action: Calculator
Action Input: 2**.12Answer: 1.086734862526058
> Finished cha... | https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html |
33ca39d92aee-0 | .md
.pdf
Getting Started
Contents
List of Tools
Getting Started#
Tools are functions that agents can use to interact with the world.
These tools can be generic utilities (e.g. search), other chains, or even other agents.
Currently, tools can be loaded with the following snippet:
from langchain.agents import load_tool... | https://python.langchain.com/en/latest/modules/agents/tools/getting_started.html |
33ca39d92aee-1 | Requires LLM: No
wolfram-alpha
Tool Name: Wolfram Alpha
Tool Description: A wolfram alpha search engine. Useful for when you need to answer questions about Math, Science, Technology, Culture, Society and Everyday Life. Input should be a search query.
Notes: Calls the Wolfram Alpha API and then parses results.
Requires ... | https://python.langchain.com/en/latest/modules/agents/tools/getting_started.html |
33ca39d92aee-2 | Requires LLM: Yes
open-meteo-api
Tool Name: Open Meteo API
Tool Description: Useful for when you want to get weather information from the OpenMeteo API. The input should be a question in natural language that this API can answer.
Notes: A natural language connection to the Open Meteo API (https://api.open-meteo.com/), ... | https://python.langchain.com/en/latest/modules/agents/tools/getting_started.html |
33ca39d92aee-3 | For more information on this, see this page
searx-search
Tool Name: Search
Tool Description: A wrapper around SearxNG meta search engine. Input should be a search query.
Notes: SearxNG is easy to deploy self-hosted. It is a good privacy friendly alternative to Google Search. Uses the SearxNG API.
Requires LLM: No
Extra... | https://python.langchain.com/en/latest/modules/agents/tools/getting_started.html |
33ca39d92aee-4 | Notes: A connection to the OpenWeatherMap API (https://api.openweathermap.org), specifically the /data/2.5/weather endpoint.
Requires LLM: No
Extra Parameters: openweathermap_api_key (your API key to access this endpoint)
previous
Tools
next
Defining Custom Tools
Contents
List of Tools
By Harrison Chase
... | https://python.langchain.com/en/latest/modules/agents/tools/getting_started.html |
a9c07e34d698-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 |
a9c07e34d698-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 |
a9c07e34d698-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 |
a9c07e34d698-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 |
a9c07e34d698-4 | 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/demo/start -- for this example, can leave all f... | https://python.langchain.com/en/latest/modules/agents/tools/examples/zapier.html |
a9c07e34d698-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 |
a9c07e34d698-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 |
a9c07e34d698-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 |
a9c07e34d698-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 |
3a6c6b1bfd50-0 | .ipynb
.pdf
File System Tools
Contents
The FileManagementToolkit
Selecting File System Tools
File System Tools#
LangChain provides tools for interacting with a local file system out of the box. This notebook walks through some of them.
Note: these tools are not recommended for use outside a sandboxed environment!
Fir... | https://python.langchain.com/en/latest/modules/agents/tools/examples/filesystem.html |
3a6c6b1bfd50-1 | toolkit.get_tools()
[CopyFileTool(name='copy_file', description='Create a copy of a file in a specified location', args_schema=<class 'langchain.tools.file_management.copy.FileCopyInput'>, return_direct=False, verbose=False, callback_manager=<langchain.callbacks.shared.SharedCallbackManager object at 0x1156f4350>, root... | https://python.langchain.com/en/latest/modules/agents/tools/examples/filesystem.html |
3a6c6b1bfd50-2 | MoveFileTool(name='move_file', description='Move or rename a file from one location to another', args_schema=<class 'langchain.tools.file_management.move.FileMoveInput'>, return_direct=False, verbose=False, callback_manager=<langchain.callbacks.shared.SharedCallbackManager object at 0x1156f4350>, root_dir='/var/folders... | https://python.langchain.com/en/latest/modules/agents/tools/examples/filesystem.html |
3a6c6b1bfd50-3 | Selecting File System Tools#
If you only want to select certain tools, you can pass them in as arguments when initializing the toolkit, or you can individually initialize the desired tools.
tools = FileManagementToolkit(root_dir=str(working_directory.name), selected_tools=["read_file", "write_file", "list_directory"]).... | https://python.langchain.com/en/latest/modules/agents/tools/examples/filesystem.html |
3a6c6b1bfd50-4 | write_tool.run({"file_path": "example.txt", "text": "Hello World!"})
'File written successfully to example.txt.'
# List files in the working directory
list_tool.run({})
'example.txt'
previous
DuckDuckGo Search
next
Google Places
Contents
The FileManagementToolkit
Selecting File System Tools
By Harrison Chase
... | https://python.langchain.com/en/latest/modules/agents/tools/examples/filesystem.html |
d45bec462a14-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 |
9f62d71a9a10-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 |
9f62d71a9a10-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 |
9f62d71a9a10-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 |
5a663f6a9b1b-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 |
5a663f6a9b1b-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 |
5a663f6a9b1b-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 |
5a663f6a9b1b-3 | > Finished AgentExecutor chain.
'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%.'
SearxNG Meta Search Engine#
Here we will be using a self hosted SearxNG meta search engine.
tools = load_tools(["searx-search"], se... | https://python.langchain.com/en/latest/modules/agents/tools/examples/search_tools.html |
5a663f6a9b1b-4 | Pomfret, CT ; Current Weather. 1:06 AM. 35°F · RealFeel® 32° ; TODAY'S WEATHER FORECAST. 3/3. 44°Hi. RealFeel® 50° ; TONIGHT'S WEATHER FORECAST. 3/3. 32°Lo.
Pomfret, MD Forecast Today Hourly Daily Morning 41° 1% Afternoon 43° 0% Evening 35° 3% Overnight 34° 2% Don't Miss Finally, Here’s Why We Get More Colds and Flu Wh... | https://python.langchain.com/en/latest/modules/agents/tools/examples/search_tools.html |
5a663f6a9b1b-5 | Thought: I now know the final answer
Final Answer: The current weather in Pomfret is mainly cloudy with snow showers around in the morning. The temperature is around 40F with winds NNW at 5 to 10 mph. Chance of snow is 40%.
> Finished chain.
'The current weather in Pomfret is mainly cloudy with snow showers around in t... | https://python.langchain.com/en/latest/modules/agents/tools/examples/search_tools.html |
b2dbf1cc38bb-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 |
b2dbf1cc38bb-1 | species {
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 ... | https://python.langchain.com/en/latest/modules/agents/tools/examples/graphql.html |
b2dbf1cc38bb-2 | By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/agents/tools/examples/graphql.html |
89b20e1117ad-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 |
89b20e1117ad-1 | loader = apify.call_actor(
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 f... | https://python.langchain.com/en/latest/modules/agents/tools/examples/apify.html |
eab5cc3019a2-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
7c927f70c23a-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 |
31bd9b63b2cd-0 | .ipynb
.pdf
Google Search
Contents
Number of Results
Metadata Results
Google Search#
This notebook goes over how to use the google search component.
First, you need to set up the proper API keys and environment variables. To set it up, create the GOOGLE_API_KEY in the Google Cloud credential console (https://console.... | https://python.langchain.com/en/latest/modules/agents/tools/examples/google_search.html |
31bd9b63b2cd-1 | tool.run("Obama's first name?")
"STATE OF HAWAII. 1 Child's First Name. (Type or print). 2. Sex. BARACK. 3. This Birth. CERTIFICATE OF LIVE BIRTH. FILE. NUMBER 151 le. lb. Middle Name. Barack Hussein Obama II is an American former politician who served as the 44th president of the United States from 2009 to 2017. A mem... | https://python.langchain.com/en/latest/modules/agents/tools/examples/google_search.html |
31bd9b63b2cd-2 | Number of Results#
You can use the k parameter to set the number of results
search = GoogleSearchAPIWrapper(k=1)
tool = Tool(
name = "I'm Feeling Lucky",
description="Search Google and return the first result.",
func=search.run
)
tool.run("python")
'The official home of the Python Programming Language.'
‘Th... | https://python.langchain.com/en/latest/modules/agents/tools/examples/google_search.html |
dea6d38147f3-0 | .ipynb
.pdf
DuckDuckGo Search
DuckDuckGo Search#
This notebook goes over how to use the duck-duck-go search component.
# !pip install duckduckgo-search
from langchain.tools import DuckDuckGoSearchRun
search = DuckDuckGoSearchRun()
search.run("Obama's first name?") | https://python.langchain.com/en/latest/modules/agents/tools/examples/ddg.html |
dea6d38147f3-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 |
dea6d38147f3-2 | previous
ChatGPT Plugins
next
File System Tools
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/agents/tools/examples/ddg.html |
9e0149aa7c51-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 |
9e0149aa7c51-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 |
9e0149aa7c51-2 | × Hunter was adapted into a 62-episode anime television series produced by Nippon Animation and directed by Kazuhiro Furuhashi, which ran on Fuji Television from October 1999 to March 2001. Three separate original video animations (OVAs) totaling 30 episodes were subsequently produced by Nippon Animation and released i... | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
9e0149aa7c51-3 | × Hunter has been a huge critical and financial success and has become one of the best-selling manga series of all time, having over 84 million copies in circulation by July 2022.\n\nPage: Hunter × Hunter (2011 TV series)\nSummary: Hunter × Hunter is an anime television series that aired from 2011 to 2014 based on Yosh... | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
9e0149aa7c51-4 | new Hunter × Hunter anime was announced on July 24, 2011. It is a complete reboot of the anime adaptation starting from the beginning of the manga, with no connections to the first anime from 1999. Produced by Nippon TV, VAP, Shueisha and Madhouse, the series is directed by Hiroshi Kōjina, with Atsushi Maekawa and Tsut... | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
9e0149aa7c51-5 | On television, the series began airing on Adult Swim\'s Toonami programming block on April 17, 2016, and ended on June 23, 2019.The anime series\' opening theme is alternated between the song "Departure!" and an alternate version titled "Departure! -Second Version-" both sung by Galneryus\' vocalist Masatoshi Ono. Five... | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
9e0149aa7c51-6 | The background music and soundtrack for the series was composed by Yoshihisa Hirano.\n\n\n\nPage: List of Hunter × Hunter characters\nSummary: The Hunter × Hunter manga series, created by Yoshihiro Togashi, features an extensive cast of characters. It takes place in a fictional universe where licensed specialists known... | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
9e0149aa7c51-7 | previous
Twilio
next
Wolfram Alpha
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/agents/tools/examples/wikipedia.html |
13980ba5ee30-0 | .ipynb
.pdf
AWS Lambda API
AWS Lambda API#
This notebook goes over how to use the AWS Lambda Tool component.
AWS Lambda is a serverless computing service provided by Amazon Web Services (AWS), designed to allow developers to build and run applications and services without the need for provisioning or managing servers. ... | https://python.langchain.com/en/latest/modules/agents/tools/examples/awslambda.html |
13980ba5ee30-1 | agent.run("Send an email to test@testing123.com saying hello world.")
previous
ArXiv API Tool
next
Shell Tool
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/agents/tools/examples/awslambda.html |
a18cca5b5b6f-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 |
a18cca5b5b6f-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 |
a18cca5b5b6f-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 |
a18cca5b5b6f-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 |
a18cca5b5b6f-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 |
a18cca5b5b6f-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,2058... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-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,599422... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-7 | ,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 |
a18cca5b5b6f-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 |
a18cca5b5b6f-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 |
a18cca5b5b6f-10 | a}a=!1}a&&b.preventDefault()},!0);}).call(this);</script><style>#gbar,#guser{font-size:13px;padding-top:1px !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:... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-11 | a{color:#1558d6}a:visited{color:#4b11a8}.sblc{padding-top:5px}.sblc 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... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-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 |
a18cca5b5b6f-13 | bgcolor="#fff"><script 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... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-14 | id=gbn class=gbi></span><span id=gbf class=gbf></span><span id=gbe></span><a href="http://www.google.com/history/optout?hl=en" 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... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-15 | name="bih" type="hidden"><div class="ds" style="height:32px;margin:4px 0"><input class="lst" style="margin:0;padding:5px 8px 0 6px;vertical-align:top;color:#000" autocomplete="off" value="" title="Google Search" maxlength="2048" name="q" size="57"></div><br style="line-height:0"><span class="ds"><span class="lsbb"><inp... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-16 | search</a></td></tr></table><input id="gbv" name="gbv" type="hidden" value="1"><script nonce="MXrF0nnIBPkxBza4okrgPA">(function(){var a,b="1";if(document&&document.getElementById)if("undefined"!=typeof XMLHttpRequest)b="2";else if("undefined"!=typeof ActiveXObject){var c,d,e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-17 | class="NKcBbd" href="https://www.google.com/url?q=https://blog.google/outreach-initiatives/diversity/asian-pacific-american-heritage-month-2023/%3Futm_source%3Dhpp%26utm_medium%3Downed%26utm_campaign%3Dapahm&source=hpp&id=19035152&ct=3&usg=AOvVaw1zrN82vzhoWl4hz1zZ4gLp&sa=X&ved=0ahUKEwjmj7fr6dT-A... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-18 | a=window.innerWidth,b=window.innerHeight;if(!a||!b){var c=window.document,d="CSS1Compat"==c.compatMode?c.documentElement:c.body;a=d.clientWidth;b=d.clientHeight}a&&b&&(a!=google.cdo.width||b!=google.cdo.height)&&google.log("","","/client_204?&atyp=i&biw="+a+"&bih="+b+"&ei="+google.kEI);}).call(this);})();</script> <scr... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-19 | a=document;var b="SCRIPT";"application/xhtml+xml"===a.contentType&&(b=b.toLowerCase());b=a.createElement(b);a=null===c?"null":void 0===c?"undefined":c;if(void 0===h){var d=null;var m=e.trustedTypes;if(m&&m.createPolicy){try{d=m.createPolicy("goog#html",{createHTML:f,createScript:f,createScriptURL:f})}catch(r){e.console... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-20 | || {};_qs._DumpException = _._DumpException;function _F_installCss(c){}\n(function(){google.jl={blt:\'none\',chnk:0,dw:false,dwu:true,emtn:0,end:0,ico:false,ikb:0,ine:false,injs:\'none\',injt:0,injth:0,injv2:false,lls:\'default\',pdt:0,rep:0,snet:true,strt:0,ubm:false,uwp:true};})();(function(){var pmc=\'{\\x22d\\x22:{... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-21 | href\\x3d\\\\\\x22/history\\\\\\x22\\\\u003EWeb History\\\\u003C/a\\\\u003E\\x22,\\x22psrl\\x22:\\x22Remove\\x22,\\x22sbit\\x22:\\x22Search by image\\x22,\\x22srch\\x22:\\x22Google Search\\x22},\\x22ovr\\x22:{},\\x22pq\\x22:\\x22\\x22,\\x22rfs\\x22:[],\\x22sbas\\x22:\\x220 3px 8px 0 rgba(0,0,0,0.2),0 0 0 1px rgba(0,0,0... | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
a18cca5b5b6f-22 | previous
Python REPL
next
SceneXplain
Contents
Inside the tool
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html |
38e6892a330a-0 | .ipynb
.pdf
Google Places
Google Places#
This notebook goes through how to use Google Places API
#!pip install googlemaps
import os
os.environ["GPLACES_API_KEY"] = ""
from langchain.tools import GooglePlacesTool
places = GooglePlacesTool()
places.run("al fornos")
"1. Delfina Restaurant\nAddress: 3621 18th St, San Franc... | https://python.langchain.com/en/latest/modules/agents/tools/examples/google_places.html |
bb8e985ccde9-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 |
bb8e985ccde9-1 | Follow up: Where is Carlos Alcaraz from?
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 ... | https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html |
bb8e985ccde9-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 |
bb8e985ccde9-3 | "Apple is the world's largest technology company by "
'revenue, ...',
'attributes': {'Products': 'AirPods; Apple Watch; iPad; iPhone; '
'Mac; Full list',
'Founders': 'Steve Jobs; Steve Wozniak; Ronald '
... | https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html |
bb8e985ccde9-4 | 'attributes': {'Related People': 'Steve Jobs Steve Wozniak Jony '
'Ive Tim Cook Angela Ahrendts',
'Date': '1976 - present'},
'imageUrl': 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS3liELlhrMz3Wpsox29U8jJ3L8qETR0hBWHXbF... | 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.