Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ from assistants import (
|
|
25 |
extract_content_values,
|
26 |
)
|
27 |
|
28 |
-
def chat(message, history, openai_api_key):
|
29 |
if not message:
|
30 |
raise gr.Error("Message is required.")
|
31 |
|
@@ -33,6 +33,7 @@ def chat(message, history, openai_api_key):
|
|
33 |
raise gr.Error("OpenAI API key is required.")
|
34 |
|
35 |
print(openai_api_key)
|
|
|
36 |
|
37 |
global assistant, thread
|
38 |
|
@@ -82,8 +83,9 @@ gr.ChatInterface(
|
|
82 |
["1. Execute with tools: Create a plot showing stock gain QTD for NVDA and AMD, x-axis is \"Day\" and y-axis is \"Gain %\". 2. Show the code."],
|
83 |
["1. Execute with tools: Get key announcements from latest OpenAI Dev Day. 2. Show the web references."]
|
84 |
],
|
85 |
-
cache_examples=
|
86 |
additional_inputs=[
|
87 |
gr.Textbox(label="OpenAI API Key", type="password"),
|
|
|
88 |
],
|
89 |
).launch()
|
|
|
25 |
extract_content_values,
|
26 |
)
|
27 |
|
28 |
+
def chat(message, history, openai_api_key, tavily_api_key):
|
29 |
if not message:
|
30 |
raise gr.Error("Message is required.")
|
31 |
|
|
|
33 |
raise gr.Error("OpenAI API key is required.")
|
34 |
|
35 |
print(openai_api_key)
|
36 |
+
print(tavily_api_key)
|
37 |
|
38 |
global assistant, thread
|
39 |
|
|
|
83 |
["1. Execute with tools: Create a plot showing stock gain QTD for NVDA and AMD, x-axis is \"Day\" and y-axis is \"Gain %\". 2. Show the code."],
|
84 |
["1. Execute with tools: Get key announcements from latest OpenAI Dev Day. 2. Show the web references."]
|
85 |
],
|
86 |
+
cache_examples=False,
|
87 |
additional_inputs=[
|
88 |
gr.Textbox(label="OpenAI API Key", type="password"),
|
89 |
+
gr.Textbox(label="Tavily API Key", type="password"),
|
90 |
],
|
91 |
).launch()
|