bstraehle commited on
Commit
bc8a44c
·
1 Parent(s): 4413f03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -46,7 +46,9 @@ def invoke(openai_api_key, prompt, agent_option):
46
  handle_parsing_errors = True,
47
  verbose = True)
48
  else:
49
- agent = initialize_agent([time],
 
 
50
  llm,
51
  agent = AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,
52
  handle_parsing_errors = True,
@@ -74,7 +76,8 @@ demo = gr.Interface(fn = invoke,
74
  outputs = [gr.Textbox(label = "Completion", lines = 1)],
75
  title = "Generative AI - LLM & Agent",
76
  description = description,
77
- examples = [["sk-", "What is today's date?", AGENT_ON]],
 
78
  cache_examples = False)
79
 
80
  demo.launch()
 
46
  handle_parsing_errors = True,
47
  verbose = True)
48
  else:
49
+ tools = load_tools(["openweathermap-api"], llm)
50
+
51
+ agent = initialize_agent(tools + [time],
52
  llm,
53
  agent = AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,
54
  handle_parsing_errors = True,
 
76
  outputs = [gr.Textbox(label = "Completion", lines = 1)],
77
  title = "Generative AI - LLM & Agent",
78
  description = description,
79
+ examples = [["sk-", "What is today's date?", AGENT_ON],
80
+ ["sk-", "What is the weather like in Irvine, CA?", AGENT_ON]],
81
  cache_examples = False)
82
 
83
  demo.launch()