Skip to content

Commit bcb033f

Browse files
committed
update 3rd party
1 parent 0ea457a commit bcb033f

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

3rd_party/llamaindex_agentic.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
)
1111
from llama_index.core.agent.workflow import ReActAgent
1212
from llama_index.core.workflow import Context
13-
from llama_index.core.tools import QueryEngineTool, ToolMetadata
13+
from llama_index.core.tools import QueryEngineTool
1414
from llama_index.embeddings.bedrock import BedrockEmbedding
1515
from llama_index.llms.bedrock_converse import BedrockConverse
1616

@@ -71,9 +71,10 @@ def create_query_engine_tool(query_engine, name, description):
7171
Returns:
7272
QueryEngineTool: A tool that can be used by the ReActAgent.
7373
"""
74-
return QueryEngineTool(
74+
return QueryEngineTool.from_defaults(
7575
query_engine=query_engine,
76-
metadata=ToolMetadata(name=name, description=description),
76+
name=name,
77+
description=description,
7778
)
7879

7980

@@ -109,22 +110,20 @@ async def main():
109110
]
110111

111112
# Create a ReActAgent with the query engine tools
112-
# Using ReActAgent from workflow module
113113
agent = ReActAgent(
114114
tools=query_engine_tools,
115115
llm=Settings.llm,
116116
verbose=True,
117117
)
118118

119-
# Create a context to store the conversation history/session state
119+
# Create a context to hold this session/state
120120
ctx = Context(agent)
121121

122122
# Use the agent to answer a question
123123
print("Starting agent query...")
124124
print("=" * 60)
125-
response = await agent.run(
126-
"Compare revenue growth of Uber and Lyft from 2020 to 2021", ctx=ctx
127-
)
125+
handler = agent.run("Compare revenue growth of Uber and Lyft from 2020 to 2021", ctx=ctx)
126+
response = await handler
128127
print(str(response))
129128

130129

requirements_langchain.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
langchain>=1.0.0
2-
langchain-core>=1.0.0
3-
langchain-community>=1.0.0
4-
langgraph>=1.0.0
5-
langchain_aws>=1.0.0
6-
duckduckgo-search>=6.0.0
7-
matplotlib>=3.8.0
8-
boto3>=1.34.0
1+
langchain
2+
langchain-core
3+
langchain-community
4+
langgraph
5+
langchain_aws
6+
duckduckgo-search
7+
matplotlib
8+
boto3
9+
ddgs

requirements_llama_index.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
llama-index
22
llama-index-llms-bedrock-converse
33
llama-index-embeddings-bedrock
4-
# Ensure compatible versions of boto libraries
5-
aiobotocore>=2.13.0
6-
botocore>=1.34.0
4+
llama-index-workflows==2.8.3
5+
aiobotocore
6+
botocore

0 commit comments

Comments
 (0)