id
stringlengths
14
16
text
stringlengths
44
2.73k
source
stringlengths
49
114
4a295188908e-16
Sat May 15 21:45:02 2021 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id ...
https://python.langchain.com/en/latest/modules/agents/agent_executors/examples/chatgpt_clone.html
4a295188908e-17
``` Human: curl -fsSL "https://api.github.com/repos/pytorch/pytorch/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g' Assistant: > Finished LLMChain chain. ``` $ curl -fsSL "https://api.github.com/repos/pytorch/pytorch/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g' 1.8.1 ``` output = chatgpt_...
https://python.langchain.com/en/latest/modules/agents/agent_executors/examples/chatgpt_clone.html
4a295188908e-18
Human: ping bbc.com AI: ``` $ ping bbc.com PING bbc.com (151.101.65.81): 56 data bytes 64 bytes from 151.101.65.81: icmp_seq=0 ttl=53 time=14.945 ms 64 bytes from 151.101.65.81: icmp_seq=1 ttl=53 time=14.945 ms 64 bytes from 151.101.65.81: icmp_seq=2 ttl=53 time=14.945 ms --- bbc.com ping statistics --- 3 packets tran...
https://python.langchain.com/en/latest/modules/agents/agent_executors/examples/chatgpt_clone.html
4a295188908e-19
Explore our current openings and apply today. We look forward to hearing from you. ``` output = chatgpt_chain.predict(human_input="curl https://chat.openai.com/chat") print(output) > Entering new LLMChain chain... Prompt after formatting: Assistant is a large language model trained by OpenAI. Assistant is designed to b...
https://python.langchain.com/en/latest/modules/agents/agent_executors/examples/chatgpt_clone.html
4a295188908e-20
``` Human: lynx https://www.deepmind.com/careers AI: ``` $ lynx https://www.deepmind.com/careers DeepMind Careers Welcome to DeepMind Careers. We are a world-leading artificial intelligence research and development company, and we are looking for talented people to join our team. We offer a range of exciting opportuni...
https://python.langchain.com/en/latest/modules/agents/agent_executors/examples/chatgpt_clone.html
4a295188908e-21
Prompt after formatting: Assistant is a large language model trained by OpenAI. Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-li...
https://python.langchain.com/en/latest/modules/agents/agent_executors/examples/chatgpt_clone.html
4a295188908e-22
``` $ curl https://chat.openai.com/chat <html> <head> <title>OpenAI Chat</title> </head> <body> <h1>Welcome to OpenAI Chat!</h1> <p> OpenAI Chat is a natural language processing platform that allows you to interact with OpenAI's AI models in a conversational way. </p> <p> To get st...
https://python.langchain.com/en/latest/modules/agents/agent_executors/examples/chatgpt_clone.html
4a295188908e-23
} ``` output = chatgpt_chain.predict(human_input="""curl --header "Content-Type:application/json" --request POST --data '{"message": "I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique cod...
https://python.langchain.com/en/latest/modules/agents/agent_executors/examples/chatgpt_clone.html
4a295188908e-24
Human: curl https://chat.openai.com/chat AI: ``` $ curl https://chat.openai.com/chat <html> <head> <title>OpenAI Chat</title> </head> <body> <h1>Welcome to OpenAI Chat!</h1> <p> OpenAI Chat is a natural language processing platform that allows you to interact with OpenAI's AI models in a conve...
https://python.langchain.com/en/latest/modules/agents/agent_executors/examples/chatgpt_clone.html
4a295188908e-25
} ``` Human: curl --header "Content-Type:application/json" --request POST --data '{"message": "I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write...
https://python.langchain.com/en/latest/modules/agents/agent_executors/examples/chatgpt_clone.html
cfc75aa8c555-0
.ipynb .pdf Defining Custom Tools Contents Completely New Tools Tool dataclass Subclassing the BaseTool class Using the tool decorator Modify existing tools Defining the priorities among Tools Using tools to return directly Multi-argument tools Defining Custom Tools# When constructing your own agent, you will need to...
https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html
cfc75aa8c555-1
tools = [ Tool( name = "Search", func=search.run, description="useful for when you need to answer questions about current events" ), ] # You can also define an args_schema to provide more information about inputs from pydantic import BaseModel, Field class CalculatorInput(BaseModel): ...
https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html
cfc75aa8c555-2
Final Answer: 3.991298452658078 > Finished chain. '3.991298452658078' Subclassing the BaseTool class# from typing import Type class CustomSearchTool(BaseTool): name = "Search" description = "useful for when you need to answer questions about current events" def _run(self, query: str) -> str: """Use ...
https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html
cfc75aa8c555-3
I need to find out Leo DiCaprio's girlfriend's name and her age Action: Search Action Input: "Leo DiCaprio girlfriend"DiCaprio broke up with girlfriend Camila Morrone, 25, in the summer of 2022, after dating for four years.I need to find out Camila Morrone's current age Action: Calculator Action Input: 25^(0.43) > Ente...
https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html
cfc75aa8c555-4
return f"Results for query {query}" search_api Tool(name='search_api', description='search_api(query: str) -> str - Searches the API for the query.', args_schema=<class 'pydantic.main.SearchApi'>, return_direct=False, verbose=False, callback_manager=<langchain.callbacks.shared.SharedCallbackManager object at 0x12748c4c...
https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html
cfc75aa8c555-5
"""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
cfc75aa8c555-6
Final Answer: Camila Morrone's current age raised to the 0.43 power is approximately 3.99. > Finished chain. "Camila Morrone's current age raised to the 0.43 power is approximately 3.99." Defining the priorities among Tools# When you made a Custom tool, you may want the Agent to use the custom tool more than normal too...
https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html
cfc75aa8c555-7
) ] agent = initialize_agent(tools, OpenAI(temperature=0), agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True) agent.run("what is the most famous song of christmas") > Entering new AgentExecutor chain... I should use a music search engine to find the answer Action: Music Search Action Input: most famous song of...
https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html
cfc75aa8c555-8
'Answer: 1.086734862526058' Multi-argument tools# Many functions expect structured inputs. These can also be supported using the Tool decorator or by directly subclassing BaseTool! We have to modify the LLM’s OutputParser to map its string output to a dictionary to pass to the action, however. from typing import Option...
https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html
cfc75aa8c555-9
# Check if agent should finish if "Final Answer:" in llm_output: return AgentFinish( # Return values is generally always a dictionary with a single `output` key # It is not recommended to try anything else at the moment :) return_values={"output": llm_...
https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html
cfc75aa8c555-10
> Finished chain. 'The results of the custom search for k=1, query=me, other_arg=None.' previous Getting Started next Multi-Input Tools Contents Completely New Tools Tool dataclass Subclassing the BaseTool class Using the tool decorator Modify existing tools Defining the priorities among Tools Using tools to return...
https://python.langchain.com/en/latest/modules/agents/tools/custom_tools.html
f3b31789e86c-0
.ipynb .pdf Multi-Input Tools Multi-Input Tools# This notebook shows how to use a tool that requires multiple inputs with an agent. The difficulty in doing so comes from the fact that an agent decides its next step from a language model, which outputs a string. So if that step requires multiple inputs, they need to be ...
https://python.langchain.com/en/latest/modules/agents/tools/multi_input_tool.html
f3b31789e86c-1
) ] mrkl = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True) mrkl.run("What is 3 times 4") > Entering new AgentExecutor chain... I need to multiply two numbers Action: Multiplier Action Input: 3,4 Observation: 12 Thought: I now know the final answer Final Answer: 3 times 4 is 12 >...
https://python.langchain.com/en/latest/modules/agents/tools/multi_input_tool.html
b2c4e84dc481-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
b2c4e84dc481-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
b2c4e84dc481-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
b2c4e84dc481-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
b2c4e84dc481-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
76564a0ee633-0
.ipynb .pdf Tool Input Schema Tool Input Schema# By default, tools infer the argument schema by inspecting the function signature. For more strict requirements, custom input schema can be specified, along with custom validation logic. from typing import Any, Dict from langchain.agents import AgentType, initialize_agent...
https://python.langchain.com/en/latest/modules/agents/tools/tool_input_validation.html
76564a0ee633-1
answer = agent.run("What's the main title on langchain.com?") print(answer) The main title of langchain.com is "LANG CHAIN 🦜️🔗 Official Home Page" agent.run("What's the main title on google.com?") --------------------------------------------------------------------------- ValidationError Tra...
https://python.langchain.com/en/latest/modules/agents/tools/tool_input_validation.html
76564a0ee633-2
112 try: --> 113 outputs = self._call(inputs) 114 except (KeyboardInterrupt, Exception) as e: 115 self.callback_manager.on_chain_error(e, verbose=self.verbose) File ~/code/lc/lckg/langchain/agents/agent.py:792, in AgentExecutor._call(self, inputs) 790 # We now enter the agent loop (until it returns ...
https://python.langchain.com/en/latest/modules/agents/tools/tool_input_validation.html
76564a0ee633-3
103 tool_input: Union[str, Dict], (...) 107 **kwargs: Any, 108 ) -> str: 109 """Run the tool.""" --> 110 run_input = self._parse_input(tool_input) 111 if not self.verbose and verbose is not None: 112 verbose_ = verbose File ~/code/lc/lckg/langchain/tools/base.py:71, in...
https://python.langchain.com/en/latest/modules/agents/tools/tool_input_validation.html
6302cf910f73-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
6302cf910f73-1
%autoreload 2 import os # get from https://platform.openai.com/ 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 ...
https://python.langchain.com/en/latest/modules/agents/tools/examples/zapier.html
6302cf910f73-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
6302cf910f73-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
6302cf910f73-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
6302cf910f73-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
6302cf910f73-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
6302cf910f73-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
6302cf910f73-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
101ebeff403b-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
dec1d815deb4-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
807d002d7bc9-0
.ipynb .pdf Google Serper API Contents As part of a Self Ask With Search Chain Google Serper API# This notebook goes over how to use the Google Serper component to search the web. First you need to sign up for a free account at serper.dev and get your api key. import os os.environ["SERPER_API_KEY"] = "" from langchai...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
807d002d7bc9-1
'El Palmar, Spain' previous Google Search next Gradio Tools Contents As part of a Self Ask With Search Chain By Harrison Chase © Copyright 2023, Harrison Chase. Last updated on Apr 25, 2023.
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
5384eaee2f94-0
.ipynb .pdf Bing Search Contents Number of results Metadata Results Bing Search# This notebook goes over how to use the bing search component. First, you need to set up the proper API keys and environment variables. To set it up, follow the instructions found here. Then we will need to set some environment variables....
https://python.langchain.com/en/latest/modules/agents/tools/examples/bing_search.html
5384eaee2f94-1
'Thanks to the flexibility of <b>Python</b> and the powerful ecosystem of packages, the Azure CLI supports features such as autocompletion (in shells that support it), persistent credentials, JMESPath result parsing, lazy initialization, network-less unit tests, and more. Building an open-source and cross-platform Azur...
https://python.langchain.com/en/latest/modules/agents/tools/examples/bing_search.html
5384eaee2f94-2
assignment operator.It adds two values and assigns the sum to a variable (left operand). W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, <b>Python</b>, SQL, Java, and many, many more. This tutorial introduces t...
https://python.langchain.com/en/latest/modules/agents/tools/examples/bing_search.html
5384eaee2f94-3
To install <b>Python</b> using the Microsoft Store: Go to your Start menu (lower left Windows icon), type &quot;Microsoft Store&quot;, select the link to open the store. Once the store is open, select Search from the upper-right menu and enter &quot;<b>Python</b>&quot;. Select which version of <b>Python</b> you would l...
https://python.langchain.com/en/latest/modules/agents/tools/examples/bing_search.html
5384eaee2f94-4
Number of results# You can use the k parameter to set the number of results search = BingSearchAPIWrapper(k=1) search.run("python") 'Thanks to the flexibility of <b>Python</b> and the powerful ecosystem of packages, the Azure CLI supports features such as autocompletion (in shells that support it), persistent credentia...
https://python.langchain.com/en/latest/modules/agents/tools/examples/bing_search.html
5384eaee2f94-5
{'snippet': '<b>Apples</b> boast many vitamins and minerals, though not in high amounts. However, <b>apples</b> are usually a good source of vitamin C. Vitamin C. Also called ascorbic acid, this vitamin is a common ...', 'title': 'Apples 101: Nutrition Facts and Health Benefits', 'link': 'https://www.healthline.com...
https://python.langchain.com/en/latest/modules/agents/tools/examples/bing_search.html
c74e743598f3-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
c74e743598f3-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
32f73cdc15e1-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 DuckDuckGoSearchTool search = DuckDuckGoSearchTool() search.run("Obama's first name?")
https://python.langchain.com/en/latest/modules/agents/tools/examples/ddg.html
32f73cdc15e1-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
32f73cdc15e1-2
previous ChatGPT Plugins next Google Places By Harrison Chase © Copyright 2023, Harrison Chase. Last updated on Apr 25, 2023.
https://python.langchain.com/en/latest/modules/agents/tools/examples/ddg.html
8d67297d8ff5-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
8d67297d8ff5-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
344beeb5c294-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
344beeb5c294-1
display(im) Using within an agent# from langchain.agents import initialize_agent from langchain.llms import OpenAI from gradio_tools.tools import (StableDiffusionTool, ImageCaptioningTool, StableDiffusionPromptGeneratorTool, TextToVideoTool) from langchain.memory import ConversationBuffe...
https://python.langchain.com/en/latest/modules/agents/tools/examples/gradio_tools.html
344beeb5c294-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
344beeb5c294-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
a2d3d4578a5e-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
4bda2df2bf05-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
7aedd0bc1dc9-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
7d6e977f9eb6-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
7d6e977f9eb6-1
'1 Child\'s First Name. 2. 6. 7d. Street Address. 71. (Type or print). BARACK. Sex. 3. This Birth. 4. If Twin or Triplet,. Was Child Born. Barack Hussein Obama II is an American retired politician who served as the 44th president of the United States from 2009 to 2017. His full name is Barack Hussein Obama II. Since th...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_search.html
7d6e977f9eb6-2
Number of Results# You can use the k parameter to set the number of results search = GoogleSearchAPIWrapper(k=1) search.run("python") 'The official home of the Python Programming Language.' ‘The official home of the Python Programming Language.’ Metadata Results# Run query through GoogleSearch and return snippet, title...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_search.html
7d6e977f9eb6-3
'title': 'Apples: Benefits, nutrition, and tips', 'link': 'https://www.medicalnewstoday.com/articles/267290'}, {'snippet': "An apple is a crunchy, bright-colored fruit, one of the most popular in the United States. You've probably heard the age-old saying, “An apple a day keeps\xa0...", 'title': 'Apples: Nutrition...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_search.html
0d42d204122d-0
.ipynb .pdf OpenWeatherMap API OpenWeatherMap API# This notebook goes over how to use the OpenWeatherMap component to fetch weather information. First, you need to sign up for an OpenWeatherMap API key: Go to OpenWeatherMap and sign up for an API key here pip install pyowm Then we will need to set some environment vari...
https://python.langchain.com/en/latest/modules/agents/tools/examples/openweathermap.html
cc2d057ad4ae-0
.ipynb .pdf Bash Bash# It can often be useful to have an LLM generate bash commands, and then run them. A common use case for this is letting the LLM interact with your local file system. We provide an easy util to execute bash commands. from langchain.utilities import BashProcess bash = BashProcess() print(bash.run("l...
https://python.langchain.com/en/latest/modules/agents/tools/examples/bash.html
6d972d74facc-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
6d972d74facc-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
6d972d74facc-2
{'schema': {'$ref': '#/components/schemas/ProductResponse'}}}}, '503': {'description': 'one or more services are unavailable'}}, 'deprecated': False}}}, 'components': {'schemas': {'Product': {'type': 'object', 'properties': {'attributes': {'type': 'array', 'items': {'type': 'string'}}, 'name': {'type': 'string'}, 'pric...
https://python.langchain.com/en/latest/modules/agents/tools/examples/chatgpt_plugins.html
6d972d74facc-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
6d972d74facc-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
6d972d74facc-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
6d972d74facc-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
b1ed7b95bf98-0
.ipynb .pdf Human as a tool Human as a tool# Human are AGI so they can certainly be used as a tool to help out AI agent when it is confused. import sys from langchain.chat_models import ChatOpenAI from langchain.llms import OpenAI from langchain.agents import load_tools, initialize_agent from langchain.agents import Ag...
https://python.langchain.com/en/latest/modules/agents/tools/examples/human_tools.html
b1ed7b95bf98-1
Action: Calculator Action Input: "Is 2021 a leap year?" Observation: Answer: False Thought:I have all the information I need to answer the original question. Final Answer: Eric Zhu's birthday is on August 1st and it is not a leap year in 2021. > Finished chain. "Eric Zhu's birthday is on August 1st and it is not a leap...
https://python.langchain.com/en/latest/modules/agents/tools/examples/human_tools.html
48cd10205821-0
.ipynb .pdf Requests 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.utilities import TextRequestsWrapper...
https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html
48cd10205821-1
'<!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
48cd10205821-2
nonce="skA52jTjrFARNMkurZZTjQ">(function(){window.google={kEI:\'5dkIZP3HJ4WPur8PmJ23iAc\',kEXPI:\'0,18168,772936,568305,6059,206,4804,2316,383,246,5,1129120,1197787,614,165,379924,16115,28684,22431,1361,12313,17586,4998,13228,37471,4820,887,1985,2891,3926,7828,606,29842,826,19390,10632,15324,432,3,346,1244,1,5444,149,1...
https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html
48cd10205821-3
7428,5821,2536,4094,7596,1,42154,2,14022,2373,342,23024,5679,1021,31121,4569,6258,23418,1252,5835,14967,4333,7484,445,2,2,1,24626,2006,8155,7381,2,3,15965,872,9626,10008,7,1922,5784,3995,19130,2261,14763,6304,2008,18192,927,14678,4531,14,82,16514,3692,109,1513,899,879,2226,2751,1854,1931,156,8524,2426,721,1021,904,1423...
https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html
48cd10205821-4
974,9,184,26,469,2238,5,1648,109,1127,450,6708,5318,1002,258,3392,1991,4,29,212,2,375,537,1046,314,1720,78,890,1861,1,1172,2275,129,29,632,274,599,731,1305,392,307,536,592,87,113,762,845,2552,3788,220,669,3,750,1174,601,310,611,27,54,49,398,51,238,1079,67,3232,710,1652,82,5,667,2077,544,3,15,2,24,497,977,40,338,224,119...
https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html
48cd10205821-5
393,1137,781,4,81,1558,241,104,5232351,297,152,8798692,3311,141,795,19735,302,46,23950484,553,4041590,1964,1008,15665,2893,512,5738,12560,1540,1218,146,1415332\',kBL:\'Td3a\'};google.sn=\'webhp\';google.kHL=\'en\';})();(function(){\nvar
https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html
48cd10205821-6
f=this||self;var h,k=[];function l(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||h}function m(a){for(var b=null;a&&(!a.getAttribute||!(b=a.getAttribute("leid")));)a=a.parentNode;return b}\nfunction n(a,b,c,d,g){var e="";c||-1!==b.search("&ei=")||(e="&ei="+l(d),-1===b.search("&l...
https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html