AntonVoronko commited on
Commit
69fc2e5
·
verified ·
1 Parent(s): af2cd3a

react agent

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ import asyncio
8
  from llama_index.core import SimpleDirectoryReader
9
 
10
  from llama_index.llms.groq import Groq
11
- from llama_index.core.agent.workflow import FunctionAgent
12
 
13
  from llama_index.tools.duckduckgo import DuckDuckGoSearchToolSpec
14
  from llama_index.tools.wikipedia import WikipediaToolSpec
@@ -30,7 +30,7 @@ class BasicAgent:
30
  arxiv_spec = ArxivToolSpec()
31
  arxiv_tool = FunctionTool.from_defaults(arxiv_spec.arxiv_query)
32
  llm = Groq(model="deepseek-r1-distill-llama-70b", api_key=api_key)
33
- self.agent = FunctionAgent(tools=[search_tool, wiki_tool, arxiv_tool], llm=llm, system_prompt='''
34
  You are a general AI assistant.
35
  I will ask you a question. You can use the tools at your disposal to help you with an answer.
36
  Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER].
 
8
  from llama_index.core import SimpleDirectoryReader
9
 
10
  from llama_index.llms.groq import Groq
11
+ from llama_index.core.agent.workflow import ReActAgent
12
 
13
  from llama_index.tools.duckduckgo import DuckDuckGoSearchToolSpec
14
  from llama_index.tools.wikipedia import WikipediaToolSpec
 
30
  arxiv_spec = ArxivToolSpec()
31
  arxiv_tool = FunctionTool.from_defaults(arxiv_spec.arxiv_query)
32
  llm = Groq(model="deepseek-r1-distill-llama-70b", api_key=api_key)
33
+ self.agent = ReActAgent(tools=[search_tool, wiki_tool, arxiv_tool], llm=llm, system_prompt='''
34
  You are a general AI assistant.
35
  I will ask you a question. You can use the tools at your disposal to help you with an answer.
36
  Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER].