Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
|
|
|
|
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()
|