Update app.py
Browse files
app.py
CHANGED
|
@@ -53,9 +53,9 @@ def ask(question, openai_api_key, gemini_api_key, anthropic_api_key, file_name =
|
|
| 53 |
file_name = f"files/{file_name}"
|
| 54 |
|
| 55 |
try:
|
| 56 |
-
os.environ["OPENAI_API_KEY"] = openai_api_key
|
| 57 |
-
os.environ["GEMINI_API_KEY"] = gemini_api_key
|
| 58 |
-
os.environ["MODEL_API_KEY"] = anthropic_api_key
|
| 59 |
|
| 60 |
return run_crew(question, file_name)
|
| 61 |
except Exception as e:
|
|
@@ -160,20 +160,20 @@ with gr.Blocks(elem_classes=["full-width-app"]) as gaia:
|
|
| 160 |
label="OpenAI API Key *",
|
| 161 |
type="password",
|
| 162 |
placeholder="sk‑...",
|
| 163 |
-
value="*", #
|
| 164 |
interactive=True
|
| 165 |
)
|
| 166 |
gemini_api_key = gr.Textbox(
|
| 167 |
label="Gemini API Key *",
|
| 168 |
type="password",
|
| 169 |
-
value="*", #
|
| 170 |
interactive=True
|
| 171 |
)
|
| 172 |
anthropic_api_key = gr.Textbox(
|
| 173 |
label="Anthropic API Key *",
|
| 174 |
type="password",
|
| 175 |
placeholder="sk-ant-...",
|
| 176 |
-
value="*", #
|
| 177 |
interactive=True
|
| 178 |
)
|
| 179 |
with gr.Row():
|
|
|
|
| 53 |
file_name = f"files/{file_name}"
|
| 54 |
|
| 55 |
try:
|
| 56 |
+
os.environ["OPENAI_API_KEY"] = os.environ.get("OPENAI_API_KEY") # API keys are provided thanks to sponsor credit openai_api_key
|
| 57 |
+
os.environ["GEMINI_API_KEY"] = os.environ.get("GEMINI_API_KEY") # API keys are provided thanks to sponsor credit gemini_api_key
|
| 58 |
+
os.environ["MODEL_API_KEY"] = os.environ.get("MODEL_API_KEY") # API keys are provided thanks to sponsor credit anthropic_api_key
|
| 59 |
|
| 60 |
return run_crew(question, file_name)
|
| 61 |
except Exception as e:
|
|
|
|
| 160 |
label="OpenAI API Key *",
|
| 161 |
type="password",
|
| 162 |
placeholder="sk‑...",
|
| 163 |
+
value="*", # API keys are provided thanks to sponsor credit
|
| 164 |
interactive=True
|
| 165 |
)
|
| 166 |
gemini_api_key = gr.Textbox(
|
| 167 |
label="Gemini API Key *",
|
| 168 |
type="password",
|
| 169 |
+
value="*", # API keys are provided thanks to sponsor credit
|
| 170 |
interactive=True
|
| 171 |
)
|
| 172 |
anthropic_api_key = gr.Textbox(
|
| 173 |
label="Anthropic API Key *",
|
| 174 |
type="password",
|
| 175 |
placeholder="sk-ant-...",
|
| 176 |
+
value="*", # API keys are provided thanks to sponsor credit
|
| 177 |
interactive=True
|
| 178 |
)
|
| 179 |
with gr.Row():
|