From c5e0579a1b2ea11d6fe9598b81236cd4e89b364a Mon Sep 17 00:00:00 2001 From: elizabethtrykin <72474571+elizabethtrykin@users.noreply.github.com> Date: Fri, 8 Nov 2024 17:56:44 -0800 Subject: [PATCH] Add Exa tool to agentstack. --- .DS_Store | Bin 0 -> 6148 bytes agentstack/.DS_Store | Bin 0 -> 6148 bytes agentstack/templates/.DS_Store | Bin 0 -> 6148 bytes agentstack/templates/crewai/.DS_Store | Bin 0 -> 6148 bytes agentstack/templates/crewai/tools/.DS_Store | Bin 0 -> 6148 bytes agentstack/templates/crewai/tools/exa_tool.py | 35 ++++++++++++++++++ agentstack/tools/.DS_Store | Bin 0 -> 6148 bytes agentstack/tools/exa.json | 7 ++++ agentstack/tools/tools.json | 9 +++++ 9 files changed, 51 insertions(+) create mode 100644 .DS_Store create mode 100644 agentstack/.DS_Store create mode 100644 agentstack/templates/.DS_Store create mode 100644 agentstack/templates/crewai/.DS_Store create mode 100644 agentstack/templates/crewai/tools/.DS_Store create mode 100644 agentstack/templates/crewai/tools/exa_tool.py create mode 100644 agentstack/tools/.DS_Store create mode 100644 agentstack/tools/exa.json diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4129138ac8e3c7d0420560eb86ed80a36780d24a GIT binary patch literal 6148 zcmeHK%Wl&^6upzA#A!sy0wh=9wK6`nO7&O5Rru-u&|BKB__&6ShJkY z*#R_a7bfkAsttf0ErNh6795b&con8Iel`Id!ICz{4@h1@{KE=>_f6AstYU zTJ#dJ9@0;#N+;xHBdC&3VVac_BTlwbrU_aYVX;i<3=GjG4*U%3M~1Zn z))~SS-XFjof?q}8P%B7t^X&|`1dY4sX$Sr7g0-e^{@WVkVj;tSf~B3&LN4epi3Pod zzKrDZ&&&ylxl4K$Wv@S?UT8&ry6pBA?dqyZE)hQ vwGrMU2oruQg_44gzK&%?T*bE$q@m0f5nxl}N+EJ!=0`xvU_M5HzpB6=K3VR8 literal 0 HcmV?d00001 diff --git a/agentstack/.DS_Store b/agentstack/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f03cb10cf9758080d4cb6443af9e609dbc130fad GIT binary patch literal 6148 zcmeHKO=}ZD7=9<&n%xE=2L(L{3tmf20@{O@HLVA)uIND}W}BrBZg)bmX^;@ez5OrZ z(I2A!#gjho%m~RO#aqxa?=thu$NS93lihbRL?n9CVTY(iL?IGmu#aquaX+UGtJ#*@ zK%vKwR8b$#A&oY?eS=rPEAX!=z~63Df3uQGTK#@MzbMpcR;Uaf93Gw_9sbgW5>cH_ zsUYcieQ~_@>5OuWoYR;Fhz^nzmFpbwz~Mv~SAoaOv5qCqTEwNpXwW%E=N)k5alL;! z-VxT3gE7K9yr!Hc>np0A{hg7`CL^oPw`^3%N!4!u5Vd-+cdHRL!e;nB{itSXHK?YO z-eCNeYp;|lvOncP_FCq%e(TP$DyxAk^RXt#VGfsfZ)7=Cv!0rk!-?jmrX!5PsNcFj zpLd@;K8U;Rqs2iy?{wR!9Cf;jMHJqB_~_}&{-@%+R4fxrAUJE|AA8lVP}w5JMLI4E zRk8@o42(onIU;>W-|7po2S0_UaOJEYU+;NSWL(+2BVR~U2qRgRZEt7&t0NAoJ2LxP zgv}kz=cn-scm@6+1voy$NQ{Zar9mA!km)M`FhH|5l=;sBb7G5$#ic>?z=WX!4OQ4H zhA?!r$JQ^gxHM?!B<$rw*qMdBp$I)Y#*ei-iNv7Ky#ii=bp`6C+T!#7`Sthzb&{`n z1-t?`N&yj^q$fRW$)2qno8z-KM*4un#(qnKnu5$8$GX5r@jWDM=!>}kOe`)9q6Oyv O2xu96<`vkf0>1%6aQ>hG literal 0 HcmV?d00001 diff --git a/agentstack/templates/.DS_Store b/agentstack/templates/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a838d61695952ec0cffb5c088c7932ddacec8316 GIT binary patch literal 6148 zcmeHKL2uJA6n^fyHC2Vw14wX~6p8CJ+Dfnkm#iCyU6*MbHdKM1%n@tL-_u8Yp4-5D4`kV+t4+Q zNIziTK49O{2pT~vco%;#Wn3i1 zY}!vI7u-5CCQq03Bt6eY<)Hoe$mk-;^k`xevf&7n%eR>xnzC(}M93S^_OMY)%yE)!#L->0*8}llMKT=S! hTQRu26+eYrLpJ`x>Qp=$iH>HPOaRmp8QX5C$V!TmoH;2fQ@9JN&oo=otIIXPv<5fO{NI>a+KzY zUW|2>CxyukZG+eIdXxUk<#P1)&5l1B?A1H|ayS~GvNs&nbh-&W$whXV>nron zr0{VX*>ZRX*DzYI^gW#Cnaae(<4; zfy2h4nL1FIBLI-Mkw#$ieui^=hk?V!B3dBIrUGrMaz_kh)8Y4BT;Q;=Xwyl#!-sM` zD|bRsrgz-mH{qlLi&6>$!oWiY)@-%U>;K2c&;JjTq$Ugq1OF8Rs=FWVkMT-wZC!ae vUTb~mS11d|H5TtvV3?&CvAh&-Lyf@ivjGeoHWuN5$VR}>AcZjSM;Z79Keu!+ literal 0 HcmV?d00001 diff --git a/agentstack/templates/crewai/tools/.DS_Store b/agentstack/templates/crewai/tools/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b6a8294190b16c9103f23fa4c8bfac789ca6d6bf GIT binary patch literal 6148 zcmeHKO-=$a7<~m6M2MosgpJ9ZfancI#D!}QfWv@DGB5=3Z#R4I;1!IA@i4CReP0^` zgAR!cV@N;JzP2;(wevciQUIoX+dl>x0IE!al`Ur9gj|=j5+&DCCmPk5ql*|RCj9yE z4tNLty92Uz4-jF90oUx}`WH9jg$-Z%wbNip?YH~q#VtNc`^Sf$KOMr zEa_FADq<vFC)`u0DOlkrXPFhPi&Nf;bmbA>zy= zYZTsc3N?;lPVWl)EuZFCb&T2P7)NV(uQ^_mvoj@gLf$XtUf;+?2e)xY9XsoyS@br` zd$`DDb)$oOwnVjN(dXU)?|^sU%K`a51WbaV!_1<7I+*DZfLLL(2FvotKsbTJ&|zkg zR~W`piI!^I5yMzI+XHuB=rFTr=`il_VO-C~oluPSPW?b{hY2nE+&kbMSazUns}0%z z&wf7tFOz)DJK!DIC2iknOtycS4- V7&^=>vW4OQ2&fG{^A7x}1D_fd*n$86 literal 0 HcmV?d00001 diff --git a/agentstack/templates/crewai/tools/exa_tool.py b/agentstack/templates/crewai/tools/exa_tool.py new file mode 100644 index 0000000..9eb2e19 --- /dev/null +++ b/agentstack/templates/crewai/tools/exa_tool.py @@ -0,0 +1,35 @@ +from crewai_tools import tool +from exa_py import Exa +from dotenv import load_dotenv +import os + +load_dotenv() + +# Check out our docs for more info! https://docs.exa.ai/ +@tool("Exa search and get contents") +def search_and_contents(question: str) -> str: + """ + Tool using Exa's Python SDK to run semantic search and return result highlights. + Args: + question: The search query or question to find information about + Returns: + Formatted string containing titles, URLs, and highlights from the search results + """ + exa = Exa(api_key=os.getenv('EXA_API_KEY')) + + response = exa.search_and_contents( + question, + type="neural", + use_autoprompt=True, + num_results=3, + highlights=True + ) + + parsedResult = ''.join([ + f'{eachResult.title}' + f'{eachResult.url}' + f'{"".join(eachResult.highlights)}' + for (idx, eachResult) in enumerate(response.results) + ]) + + return parsedResult diff --git a/agentstack/tools/.DS_Store b/agentstack/tools/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1f7dd4b24f507ddc88fd36dbf2166904a98069f3 GIT binary patch literal 6148 zcmeHKK~BRk5L~xClvafbsS+2Yyr6;~gi;Qic|b|hP(W!@l@>VW&L6n&0K{W>3@4af zTPRKOfeS*g8`lznVk~Jy3FS1y zp{5F`0>51Wp1Zpg(S%aW+4B5NF_V|nr)#?58GV}NNu1>|{P|;XgwlT(LyP-jTEOoP z-YHr!VsgvJf3EO*^4%DNF`_FO2}hZuq!i z6>bxGmr%!(tA1SZ-=Zn15pI!??`G?NE$lNBltC$%GcQRs~dn zbp`77w9D)NiGTmUPSP_~Ko$5?3Yf<5Y&gIzxwUoU=6J0QP|i`<*sriC6jW|GmIg1y cdnjVK7H|U?IxH-r2c|y)B7;_{z>g~M0c9K4N&o-= literal 0 HcmV?d00001 diff --git a/agentstack/tools/exa.json b/agentstack/tools/exa.json new file mode 100644 index 0000000..45690ac --- /dev/null +++ b/agentstack/tools/exa.json @@ -0,0 +1,7 @@ +{ + "name": "exa", + "package": "poetry add exa_py", + "env": "EXA_API_KEY=...", + "tools": ["search_and_contents"], + "cta": "Get your Exa API key at https://dashboard.exa.ai/api-keys" +} \ No newline at end of file diff --git a/agentstack/tools/tools.json b/agentstack/tools/tools.json index 4a917cb..6f405f0 100644 --- a/agentstack/tools/tools.json +++ b/agentstack/tools/tools.json @@ -6,6 +6,11 @@ "name": "firecrawl", "url": "https://www.firecrawl.dev/" }], + "sandboxing": [ + { + "name":"e2b", + "url": "https://e2b.dev/" + }], "storage": [{ "name": "mem0", "url": "https://github.com/mem0ai/mem0" @@ -38,5 +43,9 @@ "vision": [{ "name": "vision", "url": "AgentStack core tool" + }], + "web-retrieval": [{ + "name": "exa", + "url": "https://exa.ai" }] }