GattoNero commited on
Commit
93a9346
·
verified ·
1 Parent(s): 583f174

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -15,6 +15,7 @@ from llama_index.core import (
15
  set_global_handler
16
  )
17
  from llama_index.llms.openai import OpenAI as OpenAIChat
 
18
  from llama_index.core.tools import FunctionTool
19
  from llama_index.agent.openai import OpenAIAgent
20
 
@@ -56,6 +57,12 @@ class BasicAgent:
56
 
57
  # Registra il tool
58
  Settings.tools = [ingredient_tool]
 
 
 
 
 
 
59
 
60
  # Prepara l'agente
61
  self.agent = OpenAIAgent.from_tools([ingredient_tool], llm=llm, verbose=True)
 
15
  set_global_handler
16
  )
17
  from llama_index.llms.openai import OpenAI as OpenAIChat
18
+ from llama_index.llms import OpenAI as LlamaOpenAI
19
  from llama_index.core.tools import FunctionTool
20
  from llama_index.agent.openai import OpenAIAgent
21
 
 
57
 
58
  # Registra il tool
59
  Settings.tools = [ingredient_tool]
60
+
61
+ llm = LlamaOpenAI(
62
+ model="gpt-4o",
63
+ temperature=0.0,
64
+ api_key=openai_api_key
65
+ )
66
 
67
  # Prepara l'agente
68
  self.agent = OpenAIAgent.from_tools([ingredient_tool], llm=llm, verbose=True)