Martin Bär commited on
Commit
8ea3490
·
1 Parent(s): d91012e

Change agent to react agent

Browse files
Files changed (1) hide show
  1. basic_agent.py +2 -2
basic_agent.py CHANGED
@@ -4,7 +4,7 @@ from llama_index.tools.duckduckgo import DuckDuckGoSearchToolSpec
4
  from llama_index.tools.wikipedia import WikipediaToolSpec
5
  from langfuse.llama_index import LlamaIndexInstrumentor
6
  from llama_index.llms.ollama import Ollama
7
- from llama_index.core.agent.workflow import FunctionAgent
8
 
9
  from multimodality_tools import get_image_qa_tool, get_transcription_tool, \
10
  get_excel_analysis_tool, get_excel_tool, get_csv_analysis_tool, get_csv_tool
@@ -36,7 +36,7 @@ class BasicAgent:
36
  # TODO this does not work so well. We need to make the retriever return the top 5 chunks or sth.
37
  # wiki_search_tool_las = LoadAndSearchToolSpec.from_defaults(wiki_search_tool).to_tool_list()
38
 
39
- self.agent = FunctionAgent(
40
  tools=[search_tool, wiki_search_tool, get_image_qa_tool(),
41
  get_transcription_tool(), get_excel_analysis_tool(), get_excel_tool(),
42
  get_csv_analysis_tool(), get_csv_tool()],
 
4
  from llama_index.tools.wikipedia import WikipediaToolSpec
5
  from langfuse.llama_index import LlamaIndexInstrumentor
6
  from llama_index.llms.ollama import Ollama
7
+ from llama_index.core.agent.workflow import FunctionAgent, ReActAgent
8
 
9
  from multimodality_tools import get_image_qa_tool, get_transcription_tool, \
10
  get_excel_analysis_tool, get_excel_tool, get_csv_analysis_tool, get_csv_tool
 
36
  # TODO this does not work so well. We need to make the retriever return the top 5 chunks or sth.
37
  # wiki_search_tool_las = LoadAndSearchToolSpec.from_defaults(wiki_search_tool).to_tool_list()
38
 
39
+ self.agent = ReActAgent(
40
  tools=[search_tool, wiki_search_tool, get_image_qa_tool(),
41
  get_transcription_tool(), get_excel_analysis_tool(), get_excel_tool(),
42
  get_csv_analysis_tool(), get_csv_tool()],