AbenzaFran commited on
Commit
ee499cd
·
verified ·
1 Parent(s): daa002e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
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 A1": os.getenv('ASSISTANT_ID_SOLUTION_SPECIFIER_A1'),
 
 
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
- def app_interface():
50
- dropdown = gr.Dropdown(choices=list(extractor_agents.keys()), value="Solution Specifier A", label="Choose Extractor Agent")
51
- chat = gr.ChatInterface(
52
- fn=lambda message, history, selected_agent: predict(message, history, selected_agent),
53
- inputs=[dropdown],
54
- title="Solution Specifier Chat",
55
- description="Test with different solution specifiers"
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)