Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,9 @@ import gradio as gr
|
|
12 |
api_key = os.getenv('OPENAI_API_KEY')
|
13 |
extractor_agents = {
|
14 |
"Solution Specifier A": os.getenv('ASSISTANT_ID_SOLUTION_SPECIFIER_A'),
|
15 |
-
"Solution Specifier
|
|
|
|
|
16 |
}
|
17 |
|
18 |
# Function to create a new extractor LLM instance
|
@@ -46,16 +48,14 @@ def predict(message, history, selected_agent):
|
|
46 |
return non_cited_output
|
47 |
|
48 |
# Define the Gradio interface
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
return chat
|
58 |
|
59 |
# Launch the app
|
60 |
-
chat_interface = app_interface()
|
61 |
chat_interface.launch(share=True)
|
|
|
12 |
api_key = os.getenv('OPENAI_API_KEY')
|
13 |
extractor_agents = {
|
14 |
"Solution Specifier A": os.getenv('ASSISTANT_ID_SOLUTION_SPECIFIER_A'),
|
15 |
+
"Solution Specifier B": os.getenv('ASSISTANT_ID_SOLUTION_SPECIFIER_B'),
|
16 |
+
"Solution Specifier C": os.getenv('ASSISTANT_ID_SOLUTION_SPECIFIER_C'),
|
17 |
+
"Solution Specifier D": os.getenv('ASSISTANT_ID_SOLUTION_SPECIFIER_D'),
|
18 |
}
|
19 |
|
20 |
# Function to create a new extractor LLM instance
|
|
|
48 |
return non_cited_output
|
49 |
|
50 |
# Define the Gradio interface
|
51 |
+
dropdown = gr.Dropdown(choices=list(extractor_agents.keys()), value="Solution Specifier A", label="Choose Extractor Agent")
|
52 |
+
|
53 |
+
chat_interface = gr.ChatInterface(
|
54 |
+
fn=predict,
|
55 |
+
additional_inputs=[dropdown],
|
56 |
+
title="Solution Specifier Chat",
|
57 |
+
description="Test with different solution specifiers"
|
58 |
+
)
|
|
|
59 |
|
60 |
# Launch the app
|
|
|
61 |
chat_interface.launch(share=True)
|