Alexandre Gazola commited on
Commit
0a14de5
·
1 Parent(s): c56ba85
Files changed (1) hide show
  1. langchain_agent.py +6 -2
langchain_agent.py CHANGED
@@ -23,7 +23,7 @@ class LangChainAgent:
23
  llm = ChatGoogleGenerativeAI(
24
  model=constants.MODEL,
25
  api_key=constants.API_KEY,
26
- temperature=0.1,
27
  timeout=20)
28
 
29
  tools = [
@@ -46,7 +46,11 @@ class LangChainAgent:
46
  ])
47
 
48
  agent = create_tool_calling_agent(llm, tools, prompt=prompt)
49
- self.executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
 
 
 
 
50
 
51
  def __call__(self, question: str) -> str:
52
  print(f"LangChain agent received: {question[:50]}...")
 
23
  llm = ChatGoogleGenerativeAI(
24
  model=constants.MODEL,
25
  api_key=constants.API_KEY,
26
+ temperature=0.0,
27
  timeout=20)
28
 
29
  tools = [
 
46
  ])
47
 
48
  agent = create_tool_calling_agent(llm, tools, prompt=prompt)
49
+ self.executor = AgentExecutor(
50
+ agent=agent,
51
+ tools=tools,
52
+ verbose=True,
53
+ max_iterations=3)
54
 
55
  def __call__(self, question: str) -> str:
56
  print(f"LangChain agent received: {question[:50]}...")