MartinHummel commited on
Commit
68c4cd8
·
1 Parent(s): a27e9c7

agent optimisation

Browse files
Files changed (1) hide show
  1. agent/gaia_agent.py +10 -1
agent/gaia_agent.py CHANGED
@@ -12,7 +12,7 @@ from langchain_community.chat_models import ChatOpenAI
12
 
13
  def create_langchain_agent() -> AgentExecutor:
14
  llm = ChatOpenAI(
15
- model_name="gpt-4", # Or "gpt-3.5-turbo"
16
  temperature=0.3,
17
  openai_api_key=os.getenv("OPENAI_API_KEY"),
18
  )
@@ -24,7 +24,15 @@ def create_langchain_agent() -> AgentExecutor:
24
  Tool(name="Chess Image Solver", func=solve_chess_image, description="Use this to solve a chess puzzle from an image."),
25
  Tool(name="File Parser", func=parse_file_and_summarize, description="Use this to process Excel or CSV files for analytics."),
26
  ]
 
 
 
 
 
 
 
27
 
 
28
  agent = initialize_agent(
29
  tools=tools,
30
  llm=llm,
@@ -46,4 +54,5 @@ def create_langchain_agent() -> AgentExecutor:
46
  ),
47
  }
48
  )
 
49
  return agent
 
12
 
13
  def create_langchain_agent() -> AgentExecutor:
14
  llm = ChatOpenAI(
15
+ model_name="gpt-4o", # Or "gpt-3.5-turbo"
16
  temperature=0.3,
17
  openai_api_key=os.getenv("OPENAI_API_KEY"),
18
  )
 
24
  Tool(name="Chess Image Solver", func=solve_chess_image, description="Use this to solve a chess puzzle from an image."),
25
  Tool(name="File Parser", func=parse_file_and_summarize, description="Use this to process Excel or CSV files for analytics."),
26
  ]
27
+
28
+ agent = initialize_agent(
29
+ tools=tools,
30
+ llm=llm,
31
+ agent=AgentType.OPENAI_FUNCTIONS,
32
+ verbose=True
33
+ )
34
 
35
+ '''
36
  agent = initialize_agent(
37
  tools=tools,
38
  llm=llm,
 
54
  ),
55
  }
56
  )
57
+ '''
58
  return agent