Skip to content

Commit

Permalink
Merge pull request #231 from valory-xyz/feat/langchain-tool
Browse files Browse the repository at this point in the history
Feat/langchain tool
  • Loading branch information
dvilelaf authored May 29, 2024
2 parents 861474b + 5673461 commit 56ecf18
Show file tree
Hide file tree
Showing 31 changed files with 714 additions and 416 deletions.
5 changes: 4 additions & 1 deletion .gitleaksignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,7 @@ a8dd503580f9dee27828d954000e5195a8231685:packages/valory/skills/task_submission_
a8dd503580f9dee27828d954000e5195a8231685:packages/valory/skills/task_submission_abci/skill.yaml:generic-api-key:1574
a8dd503580f9dee27828d954000e5195a8231685:packages/valory/skills/task_submission_abci/skill.yaml:generic-api-key:1575
cefa30e1c946a42089bed80891eff51bad6b39a9:packages/valory/protocols/websocket_client/protocol.yaml:generic-api-key:18
c73b5d88fe1a364d7b1168b3ad171da59e7a2eac:packages/valory/protocols/websocket_client/protocol.yaml:generic-api-key:18
c73b5d88fe1a364d7b1168b3ad171da59e7a2eac:packages/valory/protocols/websocket_client/protocol.yaml:generic-api-key:18c0dee637e3d520b9706e91db197e859ca5fce23a:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15
3a080091883863f5b62d1dcfe030ec7577889f8c:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15
eecbf34a242377fb07d28230cf11ea43fb07de8d:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15
d7f9fd6ad8bcf9ea2bf14bf3de221971ddb56268:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ dependencies:
faiss-cpu:
version: ==1.7.4
tiktoken:
version: ==0.5.1
version: ==0.7.0
markdownify:
version: ==0.11.6
openai:
version: ==1.11.0
version: ==1.30.2
docstring-parser:
version: ==0.15
readability-lxml:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ dependencies:
anthropic:
version: ==0.21.3
tiktoken:
version: ==0.5.1
version: ==0.7.0
pydantic:
version: '>=1.9.0,<3'
faiss-cpu:
version: ==1.7.4
openai:
version: ==1.11.0
version: ==1.30.2
docstring-parser:
version: ==0.15
pypdf2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ dependencies:
anthropic:
version: ==0.21.3
tiktoken:
version: ==0.5.1
version: ==0.7.0
pydantic:
version: '>=1.9.0,<3'
faiss-cpu:
version: ==1.7.4
openai:
version: ==1.11.0
version: ==1.30.2
docstring-parser:
version: ==0.15
pypdf2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ dependencies:
readability-lxml:
version: ==0.8.1
openai:
version: ==1.11.0
version: ==1.30.2
tiktoken:
version: ==0.5.1
version: ==0.7.0
pypdf2:
version: ==3.0.1
numpy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies:
anthropic:
version: ==0.21.3
tiktoken:
version: ==0.5.1
version: ==0.7.0
pypdf2:
version: ==3.0.1
numpy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ dependencies:
faiss-cpu:
version: ==1.7.4
tiktoken:
version: ==0.5.1
version: ==0.7.0
markdownify:
version: ==0.11.6
openai:
version: ==1.11.0
version: ==1.30.2
docstring-parser:
version: ==0.15
readability-lxml:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ dependencies:
googlesearch-python:
version: ==1.2.3
tiktoken:
version: ==0.5.1
version: ==0.7.0
readability-lxml:
version: ==0.8.1
markdownify:
version: ==0.11.6
openai:
version: ==1.11.0
version: ==1.30.2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ entry_point: sme_generation_request.py
callable: run
dependencies:
openai:
version: ==1.11.0
version: ==1.30.2
requests: {}
tiktoken:
version: ==0.5.1
version: ==0.7.0
47 changes: 24 additions & 23 deletions packages/packages.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
{
"dev": {
"custom/valory/native_transfer_request/0.1.0": "bafybeic54urmlqx5p4qyiol3k5hwrqo2ppdqn5ndh3uctp7t4a5so2lome",
"custom/valory/native_transfer_request/0.1.0": "bafybeiaw7u67djaigj6im76nkkmowxmuu6a53grojetgotkexqivmkzzym",
"custom/valory/prediction_request_claude/0.1.0": "bafybeia74qg6simxsc5qdoi3brfu3slo3fjbkto4x2t4pv7hx4tyc7qrfa",
"custom/valory/openai_request/0.1.0": "bafybeicyxa7u6uco6dww53vv5psyiuh4kpb6m2nv2wf2ule6cdfxgvynsu",
"custom/valory/prediction_request_embedding/0.1.0": "bafybeigdniwz4sfr5nkgymsiccjbynhxnwx6y2kjlz3jxbl6mhh32hzfsq",
"custom/valory/resolve_market/0.1.0": "bafybeidbxclxlilit4afqpynj4vcrzn4ho4bnesipa2daoia7ducjkdtly",
"custom/valory/prediction_request/0.1.0": "bafybeigi6bt4zqse43mtg7pzwufn3j7slwib6tqb47o7slk3booz5hb7wy",
"custom/valory/stability_ai_request/0.1.0": "bafybeiaplvtpxnvfic6qcj4foayvdb6zvqpajs2yul3iqu2rqckvhy4aay",
"custom/polywrap/prediction_with_research_report/0.1.0": "bafybeigc2ezri2h7r7gskclqerrqrjyjtu7nqo3u3ltgh53wozqk3eincu",
"custom/jhehemann/prediction_sum_url_content/0.1.0": "bafybeiarzzhs3k2ki3d3lvvg6newthvfln2z62cgpcien6aihixwyso5au",
"custom/psouranis/optimization_by_prompting/0.1.0": "bafybeiaaewlb3tyaewxs44bnqyftxibgazk52uwpwhtdw7tfpa2rs2jwym",
"custom/nickcom007/sme_generation_request/0.1.0": "bafybeic54tcrywxp7nhtgimfuqlrcxulmc7x3lwafbrl5hains4nbtbk4a",
"custom/nickcom007/prediction_request_sme/0.1.0": "bafybeic2hbuabyrwpno7tv2lfbmbtpfynxs5jrj3jxqy2bchgpn225duo4",
"custom/napthaai/resolve_market_reasoning/0.1.0": "bafybeiefgrafi4wsdcr76fk5efowiow2fr7xfs46cmk2k6eellij7qrvpi",
"custom/napthaai/prediction_request_rag/0.1.0": "bafybeih6242jgwsc6mzbckg4uyyrcrobhwlavfkrplsmnxbdp6opp7bl5u",
"custom/napthaai/prediction_request_reasoning/0.1.0": "bafybeielv5npp5zcpuyqencsldfl3beqs77xkfgzdcywkxinkjrhqdrpbm",
"custom/valory/prepare_tx/0.1.0": "bafybeia6mkr6wu6b3w745prvttcighe4nh2z3obtvubqdzavuppfyexhkq",
"custom/valory/openai_request/0.1.0": "bafybeieqmhtwnfsed36ew6jx7t7v6xjdplasq64xezxkuitocekcypl2tu",
"custom/valory/prediction_request_embedding/0.1.0": "bafybeiawgll4kiydec3432z3gljw62lkpcsqynrpymnjg6ihjxetapfc34",
"custom/valory/resolve_market/0.1.0": "bafybeidkrbhhvepls6rd3lnq227raeao2m46fdnpczzqboxk5qrlyxxnne",
"custom/valory/prediction_request/0.1.0": "bafybeid5khedagfvqjoktiz453k66cpfqrb6sqj2gc5vcxlj5m3bvi5ns4",
"custom/valory/stability_ai_request/0.1.0": "bafybeihkgiz7brwnfcindpxsnwiockxiayx5hb6spoc26kj5kg7e3si55e",
"custom/polywrap/prediction_with_research_report/0.1.0": "bafybeigkukdsmzxcfwdvcskyghojybgtv2wtqcfhjql6s5tpzcnciw4xne",
"custom/jhehemann/prediction_sum_url_content/0.1.0": "bafybeid7hov4vqshjofbatr4m3bzcvxw72pzjoru3kxq73epjjeb7kkcbe",
"custom/psouranis/optimization_by_prompting/0.1.0": "bafybeidsv6v5sba77uxcy3qb2q5dr7p7z7qxscvxrkwa6ir2yvrhkxj56a",
"custom/nickcom007/sme_generation_request/0.1.0": "bafybeianztb2iopvrorjwpbhja4bvgevihviac3iuzw3kdwyggdci6a62y",
"custom/nickcom007/prediction_request_sme/0.1.0": "bafybeifls2i3p72ylu7ujfikvacveedbtzjykkl3ksm4et426eejyw7ygu",
"custom/napthaai/resolve_market_reasoning/0.1.0": "bafybeic43zq6xjkkc3o2gitxelr6v3nn6p2nctg6kf56tagrqvb6afxa6u",
"custom/napthaai/prediction_request_rag/0.1.0": "bafybeie4z76wbnbvbsvborhrgeerbedtwxi3p2by7z3wyjhauwxwfgdaoa",
"custom/napthaai/prediction_request_reasoning/0.1.0": "bafybeienoldwps2x4qwrpuah5aaxkvk7zqwzmyhyvyl7ktmiosbcpsuki4",
"custom/valory/prepare_tx/0.1.0": "bafybeidkghsricym5777edw3tvkuuzxkvmeai2r6phx43adfqwt3s5qwta",
"custom/valory/short_maker/0.1.0": "bafybeif63rt4lkopu3rc3l7sg6tebrrwg2lxqufjx6dx4hoda5yzax43fa",
"custom/napthaai/prediction_url_cot/0.1.0": "bafybeibasb3rwn5xsta577vjcwaxm5t3jsaidzzeboibh2oeuwdpxn2evi",
"custom/napthaai/prediction_url_cot/0.1.0": "bafybeidu65l6abhfnxmeite6magzf6rqhmyyj427g3rtwms2oh5u5sc2eq",
"custom/napthaai/prediction_url_cot_claude/0.1.0": "bafybeicbjywni5hx5ssoiv6tnnjbqzsck6cmtsdpr6m562z6afogz5eh44",
"custom/napthaai/prediction_request_reasoning_claude/0.1.0": "bafybeihtx2cejxoy42jwk2i5m4evfzz537aic5njuawxnzdzwlo63kdduq",
"custom/napthaai/prediction_request_rag_claude/0.1.0": "bafybeickr32t7nmapuoymjyo3cf5rr2v2zapksxcivuqsgjr2gn6zo6y7y",
"custom/napthaai/prediction_request_rag_cohere/0.1.0": "bafybeicrpk5oktsmr4bnk5flpkfqfwbcttq6n2oo742334d2iaixu6w5qa",
"custom/napthaai/prediction_request_rag_cohere/0.1.0": "bafybeihh26kwgqkzojd4zastto5mgod7o7esll4f4icurvwumvwuzmosrm",
"custom/valory/prediction_langchain/0.1.0": "bafybeihhii7veepp6ovkmqjnkp6euhkwm52obabgdltdj34ikisfd7yvqi",
"protocol/valory/acn_data_share/0.1.0": "bafybeih5ydonnvrwvy2ygfqgfabkr47s4yw3uqxztmwyfprulwfsoe7ipq",
"protocol/valory/websocket_client/0.1.0": "bafybeifjk254sy65rna2k32kynzenutujwqndap2r222afvr3zezi27mx4",
"contract/valory/agent_mech/0.1.0": "bafybeiah6b5epo2hlvzg5rr2cydgpp2waausoyrpnoarf7oa7bw33rex34",
"contract/valory/agent_registry/0.1.0": "bafybeiarzhzs2wm2sl47qg37tqoc3qok54enxlcj6vx3hldozg537uslnq",
"contract/valory/hash_checkpoint/0.1.0": "bafybeicbycr6rxods7sg3f2qlhgkjqrbh7kymmy2yw7bewxdwjyp7ibtg4",
"connection/valory/websocket_client/0.1.0": "bafybeic4ag3gqc7kd3k2o3pucddj2odck5yrfbgmwh5veqny7zao5qayli",
"skill/valory/contract_subscription/0.1.0": "bafybeiefuemlp75obgpxrp6iuleb3hn6vcviwh5oetk5djbuprf4xsmgjy",
"skill/valory/mech_abci/0.1.0": "bafybeicyyz3nq6zs4ovns5jwlhr7nszusdivh32pxzxnpsa3i4mbxsm25i",
"skill/valory/task_submission_abci/0.1.0": "bafybeiaa6fby75jusdz55ufy6x3td7bz2feh5bpwyipfy2nrnzpzrqrb3y",
"skill/valory/task_execution/0.1.0": "bafybeifhxjsvzwbb3zrfvx5orczapkzxq2kh5sa3w6ptq2dfs6ooinm5me",
"skill/valory/mech_abci/0.1.0": "bafybeicvbtbmtdps7lsbsutojiic4sam3jmi3prev5u22tps6pxy4du7nq",
"skill/valory/task_submission_abci/0.1.0": "bafybeihvvp6ovstb7po7kx6o7dno6kvjmffnmlerfw6qxhhzyrxmktd67e",
"skill/valory/task_execution/0.1.0": "bafybeic27brlpaamu3gfmdribywjvjyzxz2evqneh3e2kb3karubllz6xi",
"skill/valory/websocket_client/0.1.0": "bafybeif7rrvsu6z4evqkhblxj3u6wwv2eqou576hgkyoehxuj7cntw7o2m",
"skill/valory/subscription_abci/0.1.0": "bafybeig2vey5dxykpsojovlxw6f5o333f7kgmjyghmlu3yc5or5m4twqey",
"agent/valory/mech/0.1.0": "bafybeihlred6ux6ilhc2eevz5z4qmbgtehs2n3eg5homcmnqzbu7byzy3u",
"service/valory/mech/0.1.0": "bafybeie4ilpbm4mdd2k7h4efladnlmiveeqrkp5t2vkuqhftsloto2pr7y"
"skill/valory/subscription_abci/0.1.0": "bafybeihtortmv4fqua5wrnshpnvqsbpaf52frwynrmpuv2uw5j7wkauhze",
"agent/valory/mech/0.1.0": "bafybeid2hlmwtoze3xhhqqayisdg6xzxzgf42zw7hccdaszur7qfgp5vu4",
"service/valory/mech/0.1.0": "bafybeibr425raoxalifrnspyph4r2u2ilijlvdm3yexxuzsmwzyx7vlica"
},
"third_party": {
"protocol/valory/default/1.0.0": "bafybeifqcqy5hfbnd7fjv4mqdjrtujh2vx3p2xhe33y67zoxa6ph7wdpaq",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ dependencies:
version: ==0.0.303
requests: {}
tiktoken:
version: ==0.5.1
version: ==0.7.0
tavily-python:
version: ==0.3.0
version: ==0.3.3
pydantic:
version: '>=1.9.0,<3'
beautifulsoup4:
version: ==4.12.2
markdownify:
version: ==0.11.6
openai:
version: ==1.11.0
version: ==1.30.2
chromadb:
version: ==0.4.13
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ dependencies:
faiss-cpu:
version: ==1.7.4
tiktoken:
version: ==0.5.1
version: ==0.7.0
markdownify:
version: ==0.11.6
openai:
version: ==1.11.0
version: ==1.30.2
docstring-parser:
version: ==0.15
readability-lxml:
Expand Down
24 changes: 16 additions & 8 deletions packages/valory/agents/mech/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ skills:
- valory/abstract_abci:0.1.0:bafybeihat4giyc4bz6zopvahcj4iw53356pbtwfn7p4d5yflwly2qhahum
- valory/abstract_round_abci:0.1.0:bafybeih3enhagoql7kzpeyzzu2scpkif6y3ubakpralfnwxcvxexdyvy5i
- valory/contract_subscription:0.1.0:bafybeiefuemlp75obgpxrp6iuleb3hn6vcviwh5oetk5djbuprf4xsmgjy
- valory/mech_abci:0.1.0:bafybeicyyz3nq6zs4ovns5jwlhr7nszusdivh32pxzxnpsa3i4mbxsm25i
- valory/mech_abci:0.1.0:bafybeicvbtbmtdps7lsbsutojiic4sam3jmi3prev5u22tps6pxy4du7nq
- valory/registration_abci:0.1.0:bafybeiek7zcsxbucjwzgqfftafhfrocvc7q4yxllh2q44jeemsjxg3rcfm
- valory/reset_pause_abci:0.1.0:bafybeidw4mbx3os3hmv7ley7b3g3gja7ydpitr7mxbjpwzxin2mzyt5yam
- valory/subscription_abci:0.1.0:bafybeig2vey5dxykpsojovlxw6f5o333f7kgmjyghmlu3yc5or5m4twqey
- valory/task_execution:0.1.0:bafybeifhxjsvzwbb3zrfvx5orczapkzxq2kh5sa3w6ptq2dfs6ooinm5me
- valory/task_submission_abci:0.1.0:bafybeiaa6fby75jusdz55ufy6x3td7bz2feh5bpwyipfy2nrnzpzrqrb3y
- valory/subscription_abci:0.1.0:bafybeihtortmv4fqua5wrnshpnvqsbpaf52frwynrmpuv2uw5j7wkauhze
- valory/task_execution:0.1.0:bafybeic27brlpaamu3gfmdribywjvjyzxz2evqneh3e2kb3karubllz6xi
- valory/task_submission_abci:0.1.0:bafybeihvvp6ovstb7po7kx6o7dno6kvjmffnmlerfw6qxhhzyrxmktd67e
- valory/termination_abci:0.1.0:bafybeihq6qtbwt6i53ayqym63vhjexkcppy26gguzhhjqywfmiuqghvv44
- valory/transaction_settlement_abci:0.1.0:bafybeigtzlk4uakmd54rxnznorcrstsr52kta474lgrnvx5ovr546vj7sq
- valory/websocket_client:0.1.0:bafybeif7rrvsu6z4evqkhblxj3u6wwv2eqou576hgkyoehxuj7cntw7o2m
Expand Down Expand Up @@ -89,8 +89,6 @@ dependencies:
version: ==1.2.3
hypothesis:
version: ==6.21.6
langchain:
version: ==0.0.303
open-aea-ledger-ethereum:
version: ==1.50.0
pandas:
Expand All @@ -102,7 +100,7 @@ dependencies:
spacy:
version: ==3.7.2
tiktoken:
version: ==0.5.1
version: ==0.7.0
fastapi:
version: ==0.110.3
typer:
Expand All @@ -118,7 +116,7 @@ dependencies:
pypdf2:
version: ==3.0.1
tavily-python:
version: ==0.3.0
version: ==0.3.3
chromadb:
version: ==0.4.13
markdownify:
Expand All @@ -127,6 +125,16 @@ dependencies:
version: ==1.0.3
replicate:
version: ==0.15.7
langchain:
version: ==0.2.1
langchain-core:
version: ==0.2.1
langchain-openai:
version: ==0.1.7
langgraph:
version: ==0.0.55
langchain-community:
version: ==0.2.1
default_connection: null
---
public_id: valory/websocket_client:0.1.0:bafybeiexove4oqyhoae5xmk2hilskthosov5imdp65olpgj3cfrepbouyy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ entry_point: native_transfer_request.py
callable: run
dependencies:
tiktoken:
version: ==0.5.1
version: ==0.7.0
openai:
version: ==1.11.0
version: ==1.30.2
4 changes: 2 additions & 2 deletions packages/valory/customs/openai_request/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ entry_point: openai_request.py
callable: run
dependencies:
openai:
version: ==1.11.0
version: ==1.30.2
tiktoken:
version: ==0.5.1
version: ==0.7.0
20 changes: 20 additions & 0 deletions packages/valory/customs/prediction_langchain/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2024 Valory AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ------------------------------------------------------------------------------

"""This module contains a tool that integrates langchain."""
28 changes: 28 additions & 0 deletions packages/valory/customs/prediction_langchain/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: prediction_langchain
author: valory
version: 0.1.0
type: custom
description: A mech tool that integrates langchain and langgraph
license: Apache-2.0
aea_version: '>=1.0.0, <2.0.0'
fingerprint:
__init__.py: bafybeid2llyk4lr55nmq3aubhnjy4pwskzb3dmvcn5z57geyy3lmua6fue
prediction_langchain.py: bafybeibg6giebyxjpqch2jvtvrwufp3n75n55xmqjgu3rlc4rfopnfcxlm
fingerprint_ignore_patterns: []
entry_point: prediction_langchain.py
callable: run
dependencies:
langchain:
version: ==0.1.20
langchain-core:
version: ==0.1.52
langchain-openai:
version: ==0.1.6
langgraph:
version: ==0.0.55
langchain_community:
version: ==0.2.1
openai:
version: ==1.30.2
anthropic:
version: ==0.21.3
Loading

0 comments on commit 56ecf18

Please sign in to comment.