id
stringlengths
14
16
text
stringlengths
29
2.73k
source
stringlengths
49
117
37be64708a5c-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
37be64708a5c-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
37be64708a5c-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
37be64708a5c-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
37be64708a5c-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
37be64708a5c-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
37be64708a5c-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
37be64708a5c-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
37be64708a5c-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&amp;source=hpp&amp;id=19035152&amp;ct=3&amp;usg=AOvVaw1zrN82vzhoWl4hz1zZ4gLp&amp;sa=X&amp;ved=0ahUKEwjmj7fr6dT-A...
https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html
37be64708a5c-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
37be64708a5c-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
37be64708a5c-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
37be64708a5c-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
37be64708a5c-22
previous Python REPL next SceneXplain Contents Inside the tool By Harrison Chase © Copyright 2023, Harrison Chase. Last updated on May 29, 2023.
https://python.langchain.com/en/latest/modules/agents/tools/examples/requests.html
13a8d2b3761f-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
fdb2acb0ba42-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
fdb2acb0ba42-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
fdb2acb0ba42-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
fdb2acb0ba42-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
fdb2acb0ba42-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
fdb2acb0ba42-5
'link': 'https://finance.yahoo.com/quote/AAPL', 'snippet': 'Find the latest Apple Inc. (AAPL) stock quote, ' 'history, news and other vital information to help ' 'you with your stock trading and investing.', 'position': 6}], 'peopleAlsoAsk':...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-6
'iPad, Mac, iPod, Apple Watch, and\n' 'Apple TV.', 'title': 'Apple Inc Company Profile - Apple Inc Overview - ' 'GlobalData', 'link': 'https://www.globaldata.com/company-profile/apple-inc/'}, {'questio...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-7
'hl': 'en', 'num': 10, 'type': 'images'}, 'images': [{'title': 'Lion - Wikipedia', 'imageUrl': 'https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Lion_waiting_in_Namibia.jpg/1200px-Lion_waiting_in_Namibia.jpg', 'imageWidth': 1200, ...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-8
'domain': 'www.britannica.com', 'link': 'https://www.britannica.com/animal/lion', 'position': 2}, {'title': 'African lion, facts and photos', 'imageUrl': 'https://i.natgeofe.com/n/487a0d69-8202-406f-a6a0-939ed3704693/african-lion.JPG', 'imageWidth': 3072, ...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-9
'imageWidth': 1200, 'imageHeight': 1200, 'thumbnailUrl': 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTlewcJ5SwC7yKup6ByaOjTnAFDeoOiMxyJTQaph2W_I3dnks4&amp;s', 'thumbnailWidth': 225, 'thumbnailHeight': 225, 'source': 'St. Louis Zoo', ...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-10
{'title': 'Lion | Characteristics, Habitat, & Facts | Britannica', 'imageUrl': 'https://cdn.britannica.com/29/150929-050-547070A1/lion-Kenya-Masai-Mara-National-Reserve.jpg', 'imageWidth': 1600, 'imageHeight': 1085, 'thumbnailUrl': 'https://encrypted-tbn0.gstatic.com/...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-11
'imageWidth': 1365, 'imageHeight': 768, 'thumbnailUrl': 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTc_4vCHscgvFvYy3PSrtIOE81kNLAfhDK8F3mfOuotL0kUkbs&amp;s', 'thumbnailWidth': 299, 'thumbnailHeight': 168, 'source': 'USA Today', 'do...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-12
{'title': "Lion | Smithsonian's National Zoo", 'imageUrl': 'https://nationalzoo.si.edu/sites/default/files/styles/1400_scale/public/animals/exhibit/africanlion-005.jpg?itok=6wA745g_', 'imageWidth': 1400, 'imageHeight': 845, 'thumbnailUrl': 'https://encrypted-tbn0.gsta...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-13
'source': 'Virginia Zoo', 'domain': 'virginiazoo.org', 'link': 'https://virginiazoo.org/zoos-new-male-lion-explores-habitat-for-thefirst-time/', 'position': 10}]} Searching for Google News# We can also query Google News using this wrapper. For example: search = GoogleSerperAPIWrap...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-14
{'title': 'Global companies by market cap: Tesla fell most in April', 'link': 'https://www.reuters.com/markets/global-companies-by-market-cap-tesla-fell-most-april-2023-05-02/', 'snippet': 'Tesla Inc was the biggest loser among top companies by ' 'market capitalisation in Apr...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-15
'position': 3}, {'title': 'Joby Aviation to get investment from Tesla shareholder ' 'Baillie Gifford', 'link': 'https://finance.yahoo.com/news/joby-aviation-investment-tesla-shareholder-204450712.html', 'snippet': 'This comes days after Joby clinched a $55 million ' ...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-16
'position': 5}, {'title': 'The Tesla Model 3 Long Range AWD Is Now Available in the ' 'U.S. With 325 Miles of Range', 'link': 'https://www.notateslaapp.com/news/1393/tesla-reopens-orders-for-model-3-long-range-after-months-of-unavailability', 'snippet': 'Tesla has reo...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-17
'date': '14 hours ago', 'source': 'Tesla Oracle', 'imageUrl': 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRO7M5ZLQE-Zo4-_5dv9hNAQZ3wSqfvYCuKqzxHG-M6CgLpwPMMG_ssebdcMg&s', 'position': 7}, {'title': 'Tesla putting facility in new part of country - Austin ' ...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-18
'Long Range edition with a starting price of $47240, ' 'according to its website.', 'date': '5 hours ago', 'source': 'Bloomberg.com', 'imageUrl': 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTWWIC4VpMTfRvSyqiomODOoLg0xhoBf-Tc1qweKnSuaiTk-Y1wMJZM3jct0w&s',...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-19
'date': '53 mins ago', 'source': 'Reuters', 'imageUrl': 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSSTcsXeenqmEKdiekvUgAmqIPR4nlAmgjTkBqLpza-lLfjX1CwB84MoNVj0Q&s', 'position': 1}, {'title': 'Ryder lanza solución llave en mano para vehículos ' 'e...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-20
'Sanders tells American Billionaires.', 'link': 'https://thebharatexpressnews.com/i-think-people-can-get-by-with-999-million-bernie-sanders-tells-american-billionaires-heres-how-the-ultra-rich-can-pay-less-income-tax-than-you-legally/', 'snippet': 'The report noted that in 2007 and 2011, Amazon.co...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-21
Searching for Google Places# We can also query Google Places using this wrapper. For example: search = GoogleSerperAPIWrapper(type="places") results = search.results("Italian restaurants in Upper East Side") pprint.pp(results) {'searchParameters': {'q': 'Italian restaurants in Upper East Side', 'g...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-22
{'position': 3, 'title': 'Caravaggio', 'address': '23 E 74th St', 'latitude': 40.773412799999996, 'longitude': -73.96473379999999, 'thumbnailUrl': 'https://lh5.googleusercontent.com/p/AF1QipPDGchokDvppoLfmVEo6X_bWd3Fz0HyxIHTEe9V=w92-h92-n-k-no', ...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-23
'rating': 4.5, 'ratingCount': 344, 'category': 'Italian'}, {'position': 6, 'title': 'Come Prima', 'address': '903 Madison Ave', 'latitude': 40.772124999999996, 'longitude': -73.965012, 'thumbnailUrl': 'https://lh5.goo...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-24
'longitude': -73.9689825, 'thumbnailUrl': 'https://lh5.googleusercontent.com/p/AF1QipPifIgzOCD5SjgzzqBzGkdZCBp0MQsK5k7M7znn=w92-h92-n-k-no', 'rating': 4.6, 'ratingCount': 941, 'category': 'Italian'}, {'position': 9, 'title': 'Pinocchio Restaur...
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
fdb2acb0ba42-25
previous Google Search next Gradio Tools 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 By Harrison Chase © Copyright 2023, Harrison Chase. Last updated on May 29, 2023.
https://python.langchain.com/en/latest/modules/agents/tools/examples/google_serper.html
018886630a51-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
8a7237c1f33a-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
8a7237c1f33a-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
8a7237c1f33a-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
8a7237c1f33a-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
8a7237c1f33a-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
8a7237c1f33a-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
1d426df559a9-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
1d426df559a9-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
1d426df559a9-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
1d426df559a9-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
3b3b6b9c4baf-0
.ipynb .pdf YouTubeSearchTool YouTubeSearchTool# This notebook shows how to use a tool to search YouTube Adapted from venuv/langchain_yt_tools #! pip install youtube_search from langchain.tools import YouTubeSearchTool tool = YouTubeSearchTool() tool.run("lex friedman") "['/watch?v=VcVfceTsD0A&pp=ygUMbGV4IGZyaWVkbWFu',...
https://python.langchain.com/en/latest/modules/agents/tools/examples/youtube.html
ca6d7a99bbce-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
ca6d7a99bbce-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
ca6d7a99bbce-2
By Harrison Chase © Copyright 2023, Harrison Chase. Last updated on May 29, 2023.
https://python.langchain.com/en/latest/modules/agents/tools/examples/sceneXplain.html
e33c17be984c-0
.ipynb .pdf OpenWeatherMap API Contents Use the wrapper Use the tool 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 w...
https://python.langchain.com/en/latest/modules/agents/tools/examples/openweathermap.html
e33c17be984c-1
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True ) agent_chain.run("What's the weather like in London?") > Entering new AgentExecutor chain... I need to find out the current weather in London. Action: OpenWeatherMap Action Input: London,GB Observation: In London,GB, the current weather is as follows: Deta...
https://python.langchain.com/en/latest/modules/agents/tools/examples/openweathermap.html
b16e4c9e2348-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
b16e4c9e2348-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
de1e8fdc5029-0
.ipynb .pdf Metaphor Search Contents Metaphor Search Call the API Use Metaphor as a tool Metaphor Search# This notebook goes over how to use Metaphor search. First, you need to set up the proper API keys and environment variables. Request an API key [here](Sign up for early access here). Then enter your API key as an...
https://python.langchain.com/en/latest/modules/agents/tools/examples/metaphor_search.html
de1e8fdc5029-1
{'results': [{'url': 'https://www.anthropic.com/index/core-views-on-ai-safety', 'title': 'Core Views on AI Safety: When, Why, What, and How', 'dateCreated': '2023-03-08', 'author': None, 'score': 0.1998831331729889}, {'url': 'https://aisafety.wordpress.com/', 'title': 'Extinction Risk from Artificial Intelligence', 'da...
https://python.langchain.com/en/latest/modules/agents/tools/examples/metaphor_search.html
de1e8fdc5029-2
'title': 'So You Want to Save the World - LessWrong', 'dateCreated': '2012-01-01', 'author': 'Lukeprog', 'score': 0.18853715062141418}, {'url': 'https://openai.com/blog/planning-for-agi-and-beyond', 'title': 'Planning for AGI and beyond', 'dateCreated': '2023-02-24', 'author': 'Authors', 'score': 0.18665121495723724}, ...
https://python.langchain.com/en/latest/modules/agents/tools/examples/metaphor_search.html
de1e8fdc5029-3
'title': 'The Proof of Doom - LessWrong', 'dateCreated': '2022-03-09', 'author': 'Johnlawrenceaspden', 'score': 0.18159329891204834}, {'url': 'https://intelligence.org/why-ai-safety/', 'title': 'Why AI Safety? - Machine Intelligence Research Institute', 'dateCreated': '2017-03-01', 'author': None, 'score': 0.1814115345...
https://python.langchain.com/en/latest/modules/agents/tools/examples/metaphor_search.html
de1e8fdc5029-4
[{'title': 'Core Views on AI Safety: When, Why, What, and How', 'url': 'https://www.anthropic.com/index/core-views-on-ai-safety', 'author': None, 'date_created': '2023-03-08'}, {'title': 'Extinction Risk from Artificial Intelligence', 'url': 'https://aisafety.wordpress.com/', 'author': None, 'date_created'...
https://python.langchain.com/en/latest/modules/agents/tools/examples/metaphor_search.html
de1e8fdc5029-5
'date_created': '2023-02-24'}, {'title': 'The Artificial Intelligence Revolution: Part 1 - Wait But Why', 'url': 'https://waitbutwhy.com/2015/01/artificial-intelligence-revolution-1.html', 'author': 'Tim Urban', 'date_created': '2015-01-22'}, {'title': 'Anthropic: Core Views on AI Safety: When, Why, What, and H...
https://python.langchain.com/en/latest/modules/agents/tools/examples/metaphor_search.html
de1e8fdc5029-6
) async_browser = create_async_playwright_browser() toolkit = PlayWrightBrowserToolkit.from_browser(async_browser=async_browser) tools = toolkit.get_tools() tools_by_name = {tool.name: tool for tool in tools} print(tools_by_name.keys()) navigate_tool = tools_by_name["navigate_browser"] extract_text = tools_by_name["ext...
https://python.langchain.com/en/latest/modules/agents/tools/examples/metaphor_search.html
de1e8fdc5029-7
Thought:I need to navigate to the URL provided in the search results to find the tweet. > Finished chain. 'I need to navigate to the URL provided in the search results to find the tweet.' previous IFTTT WebHooks next OpenWeatherMap API Contents Metaphor Search Call the API Use Metaphor as a tool By Harrison Chase ...
https://python.langchain.com/en/latest/modules/agents/tools/examples/metaphor_search.html
b62982dd2c51-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
b62982dd2c51-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
b1f9e4e20483-0
.ipynb .pdf Human as a tool Contents Configuring the Input Function 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. from langchain.chat_models import ChatOpenAI from langchain.llms import OpenAI from langchain.agents import load_tools, initialize_agent ...
https://python.langchain.com/en/latest/modules/agents/tools/examples/human_tools.html
b1f9e4e20483-1
def get_input() -> str: print("Insert your text. Enter 'q' or press Ctrl-D (or Ctrl-Z on Windows) to end.") contents = [] while True: try: line = input() except EOFError: break if line == "q": break contents.append(line) return "\n".joi...
https://python.langchain.com/en/latest/modules/agents/tools/examples/human_tools.html
b1f9e4e20483-2
oh who said it q Observation: oh who said it Thought:I can use DuckDuckGo Search to find out who said the quote Action: DuckDuckGo Search Action Input: "Who said 'Veni, vidi, vici'?"
https://python.langchain.com/en/latest/modules/agents/tools/examples/human_tools.html
b1f9e4e20483-3
Observation: Updated on September 06, 2019. "Veni, vidi, vici" is a famous phrase said to have been spoken by the Roman Emperor Julius Caesar (100-44 BCE) in a bit of stylish bragging that impressed many of the writers of his day and beyond. The phrase means roughly "I came, I saw, I conquered" and it could be pronounc...
https://python.langchain.com/en/latest/modules/agents/tools/examples/human_tools.html
b1f9e4e20483-4
Caesar ve· ni, vi· di, vi· ci ˌwā-nē ˌwē-dē ˈwē-kē ˌvā-nē ˌvē-dē ˈvē-chē : I came, I saw, I conquered Articles Related to veni, vidi, vici 'In Vino Veritas' and Other Latin... Dictionary Entries Near veni, vidi, vici Venite veni, vidi, vici Venizélos See More Nearby Entries Cite this Entry Style The simplest explanatio...
https://python.langchain.com/en/latest/modules/agents/tools/examples/human_tools.html
b1f9e4e20483-5
expression of triumph. The words are said to have been used by Caesar as he was enjoying a triumph.
https://python.langchain.com/en/latest/modules/agents/tools/examples/human_tools.html
b1f9e4e20483-6
Thought:I now know the final answer Final Answer: Julius Caesar said the quote "Veni, vidi, vici" which means "I came, I saw, I conquered". > Finished chain. 'Julius Caesar said the quote "Veni, vidi, vici" which means "I came, I saw, I conquered".' previous HuggingFace Tools next IFTTT WebHooks Contents Configurin...
https://python.langchain.com/en/latest/modules/agents/tools/examples/human_tools.html
16928afcdfed-0
.ipynb .pdf HuggingFace Tools HuggingFace Tools# Huggingface Tools supporting text I/O can be loaded directly using the load_huggingface_tool function. # Requires transformers>=4.29.0 and huggingface_hub>=0.14.1 !pip install --upgrade transformers huggingface_hub > /dev/null from langchain.agents import load_huggingfac...
https://python.langchain.com/en/latest/modules/agents/tools/examples/huggingface_tools.html
10fedccd10b5-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
10fedccd10b5-1
Thought:The paper is about heat-bath random walks with Markov bases on graphs of lattice points. 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 lattic...
https://python.langchain.com/en/latest/modules/agents/tools/examples/arxiv.html
10fedccd10b5-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
10fedccd10b5-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
a66230b799d3-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
a66230b799d3-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
a66230b799d3-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
a66230b799d3-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
a66230b799d3-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
a66230b799d3-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
a66230b799d3-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
0bbb040e0033-0
.ipynb .pdf Custom LLM Agent Contents Set up environment Set up tool Prompt Template Output Parser Set up LLM Define the stop sequence Set up the Agent Use the Agent Adding Memory Custom LLM Agent# This notebook goes through how to create your own custom LLM agent. An LLM agent consists of three parts: PromptTemplate...
https://python.langchain.com/en/latest/modules/agents/agents/custom_llm_agent.html
0bbb040e0033-1
from langchain.prompts import StringPromptTemplate from langchain import OpenAI, SerpAPIWrapper, LLMChain from typing import List, Union from langchain.schema import AgentAction, AgentFinish import re Set up tool# Set up any tools the agent may want to use. This may be necessary to put in the prompt (so that the agent ...
https://python.langchain.com/en/latest/modules/agents/agents/custom_llm_agent.html
0bbb040e0033-2
Question: {input} {agent_scratchpad}""" # Set up a prompt template class CustomPromptTemplate(StringPromptTemplate): # The template to use template: str # The list of tools available tools: List[Tool] def format(self, **kwargs) -> str: # Get the intermediate steps (AgentAction, Observat...
https://python.langchain.com/en/latest/modules/agents/agents/custom_llm_agent.html
0bbb040e0033-3
class CustomOutputParser(AgentOutputParser): def parse(self, llm_output: str) -> Union[AgentAction, AgentFinish]: # Check if agent should finish if "Final Answer:" in llm_output: return AgentFinish( # Return values is generally always a dictionary with a single `outp...
https://python.langchain.com/en/latest/modules/agents/agents/custom_llm_agent.html
0bbb040e0033-4
# LLM chain consisting of the LLM and a prompt llm_chain = LLMChain(llm=llm, prompt=prompt) tool_names = [tool.name for tool in tools] agent = LLMSingleActionAgent( llm_chain=llm_chain, output_parser=output_parser, stop=["\nObservation:"], allowed_tools=tool_names ) Use the Agent# Now we can use it! a...
https://python.langchain.com/en/latest/modules/agents/agents/custom_llm_agent.html
0bbb040e0033-5
Question: the input question you must answer Thought: you should always think about what to do Action: the action to take, should be one of [{tool_names}] Action Input: the input to the action Observation: the result of the action ... (this Thought/Action/Action Input/Observation can repeat N times) Thought: I now know...
https://python.langchain.com/en/latest/modules/agents/agents/custom_llm_agent.html
0bbb040e0033-6
Thought: I need to find out the population of Canada in 2023 Action: Search Action Input: Population of Canada in 2023 Observation:The current population of Canada is 38,658,314 as of Wednesday, April 12, 2023, based on Worldometer elaboration of the latest United Nations data. I now know the final answer Final Answer:...
https://python.langchain.com/en/latest/modules/agents/agents/custom_llm_agent.html
5cdd547648d3-0
.ipynb .pdf Custom LLM Agent (with a ChatModel) Contents Set up environment Set up tool Prompt Template Output Parser Set up LLM Define the stop sequence Set up the Agent Use the Agent Custom LLM Agent (with a ChatModel)# This notebook goes through how to create your own custom agent based on a chat model. An LLM cha...
https://python.langchain.com/en/latest/modules/agents/agents/custom_llm_chat_agent.html
5cdd547648d3-1
!pip install langchain !pip install google-search-results !pip install openai from langchain.agents import Tool, AgentExecutor, LLMSingleActionAgent, AgentOutputParser from langchain.prompts import BaseChatPromptTemplate from langchain import SerpAPIWrapper, LLMChain from langchain.chat_models import ChatOpenAI from ty...
https://python.langchain.com/en/latest/modules/agents/agents/custom_llm_chat_agent.html
5cdd547648d3-2
Action Input: the input to the action Observation: the result of the action ... (this Thought/Action/Action Input/Observation can repeat N times) Thought: I now know the final answer Final Answer: the final answer to the original input question These were previous tasks you completed: Begin! Question: {input} {agent_sc...
https://python.langchain.com/en/latest/modules/agents/agents/custom_llm_chat_agent.html
5cdd547648d3-3
# This includes the `intermediate_steps` variable because that is needed input_variables=["input", "intermediate_steps"] ) Output Parser# The output parser is responsible for parsing the LLM output into AgentAction and AgentFinish. This usually depends heavily on the prompt used. This is where you can change the pa...
https://python.langchain.com/en/latest/modules/agents/agents/custom_llm_chat_agent.html