Ubik80 commited on
Commit
7699c4a
·
verified ·
1 Parent(s): f326d8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -45,13 +45,17 @@ final_answer = FinalAnswerTool()
45
  model = OpenAIServerModel(
46
  max_tokens=2096,
47
  temperature=0.5,
48
- model_id="gpt-4", # Puoi anche usare "gpt-3.5-turbo" se vuoi
49
- api_key=os.getenv("OPENAI_API_KEY"), # 🔒 Usa la tua API Key in modo sicuro
 
 
 
50
  custom_role_conversions=None,
51
  )
52
 
53
 
54
 
 
55
  # Import tool from Hub
56
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
57
 
@@ -60,7 +64,7 @@ with open("prompts.yaml", 'r') as stream:
60
 
61
  agent = CodeAgent(
62
  model=model,
63
- tools=[final_answer], ## add your tools here (don't remove final answer)
64
  max_steps=6,
65
  verbosity_level=1,
66
  grammar=None,
 
45
  model = OpenAIServerModel(
46
  max_tokens=2096,
47
  temperature=0.5,
48
+ model_id="gpt-4",
49
+ api_key=os.getenv("OPENAI_API_KEY"),
50
+ system_prompt="You are an AI assistant with access to several tools. "
51
+ "Always use the available tools to answer questions instead of generating Python code. "
52
+ "If a user asks for the current time in a location, call the appropriate tool instead of calculating it manually.",
53
  custom_role_conversions=None,
54
  )
55
 
56
 
57
 
58
+
59
  # Import tool from Hub
60
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
61
 
 
64
 
65
  agent = CodeAgent(
66
  model=model,
67
+ tools=[final_answer, get_current_time_in_timezone],
68
  max_steps=6,
69
  verbosity_level=1,
70
  grammar=None,