jpfearnworks commited on
Commit
279a6d2
1 Parent(s): 4598894

Shift key inputs

Browse files
modules/knowledge_retrieval/component.py CHANGED
@@ -13,8 +13,8 @@ def determine_and_execute(api_key, question: str, temperature: float):
13
  examples = [["""When is my grandmothers birthday?""", 0.6], ["What was my tax burden last year?", 0.6 ], ["What is the most recent magic the gathering card set released?", 0.6], ["What products are the most popular with my small business customers?", 0.6]]
14
 
15
  def create_knowledge_router_ui(cache_examples=False):
16
- api_key = gr.Textbox(label="You OpenAI API key", type="password")
17
  with gr.Row():
 
18
  question = gr.Textbox(label="Enter your question here:")
19
  temperature = gr.Slider(minimum=0, maximum=2, default=.7, label="Temperature")
20
  with gr.Column():
 
13
  examples = [["""When is my grandmothers birthday?""", 0.6], ["What was my tax burden last year?", 0.6 ], ["What is the most recent magic the gathering card set released?", 0.6], ["What products are the most popular with my small business customers?", 0.6]]
14
 
15
  def create_knowledge_router_ui(cache_examples=False):
 
16
  with gr.Row():
17
+ api_key = gr.Textbox(label="You OpenAI API key", type="password")
18
  question = gr.Textbox(label="Enter your question here:")
19
  temperature = gr.Slider(minimum=0, maximum=2, default=.7, label="Temperature")
20
  with gr.Column():
modules/reasoning/component.py CHANGED
@@ -19,8 +19,8 @@ He puts the cup down in the garden, then walks to the garage.
19
  Where is the ball?""", 0.6], ["Given the task of building a house in the middle of a river, what are three strategies I could use to mitigate risk of flooding?", 0.6 ]]
20
 
21
  def create_reasoning_router_ui(cache_examples=False):
22
- api_key = gr.Textbox(label="You OpenAI API key", type="password")
23
  with gr.Row():
 
24
  question = gr.Textbox(label="Enter your question here:")
25
  temperature = gr.Slider(minimum=0, maximum=2, default=.7, label="Temperature")
26
  with gr.Column():
@@ -29,5 +29,5 @@ def create_reasoning_router_ui(cache_examples=False):
29
 
30
  generate_button = gr.Button(label="Generate")
31
  generate_button.click(determine_and_execute, outputs=[reasoning_strategy, reasoning], inputs=[api_key, question, temperature])
32
- gr.Examples(examples=examples, fn=determine_and_execute, cache_examples=cache_examples, inputs=[api_key, question, temperature], outputs=[reasoning_strategy, reasoning])
33
 
 
19
  Where is the ball?""", 0.6], ["Given the task of building a house in the middle of a river, what are three strategies I could use to mitigate risk of flooding?", 0.6 ]]
20
 
21
  def create_reasoning_router_ui(cache_examples=False):
 
22
  with gr.Row():
23
+ api_key = gr.Textbox(label="You OpenAI API key", type="password")
24
  question = gr.Textbox(label="Enter your question here:")
25
  temperature = gr.Slider(minimum=0, maximum=2, default=.7, label="Temperature")
26
  with gr.Column():
 
29
 
30
  generate_button = gr.Button(label="Generate")
31
  generate_button.click(determine_and_execute, outputs=[reasoning_strategy, reasoning], inputs=[api_key, question, temperature])
32
+ gr.Examples(examples=examples, fn=determine_and_execute, cache_examples=cache_examples, inputs=[question, temperature], outputs=[reasoning_strategy, reasoning])
33