Martín Santillán Cooper commited on
Commit
324e397
1 Parent(s): d717a69

fix show prompt

Browse files
Files changed (1) hide show
  1. src/app.py +8 -4
src/app.py CHANGED
@@ -61,13 +61,17 @@ def on_submit(criteria, context, user_message, assistant_message, state):
61
  return gr.update(value=html_str)
62
 
63
  def on_show_prompt_click(criteria, context, user_message, assistant_message, state):
64
- prompt = get_prompt({
65
- 'name': state['selected_criteria_name'],
 
66
  'criteria': criteria,
67
  'context': context,
68
  'user_message': user_message,
69
- 'assistant_message': assistant_message,
70
- }, state['selected_sub_catalog'])
 
 
 
71
  prompt = json.dumps(prompt, indent=4)
72
  return gr.Markdown(prompt)
73
 
 
61
  return gr.update(value=html_str)
62
 
63
  def on_show_prompt_click(criteria, context, user_message, assistant_message, state):
64
+ criteria_name = state['selected_criteria_name']
65
+ test_case = {
66
+ 'name': criteria_name,
67
  'criteria': criteria,
68
  'context': context,
69
  'user_message': user_message,
70
+ 'assistant_message': assistant_message
71
+ }
72
+
73
+ messages = get_messages(test_case=test_case, sub_catalog_name=state['selected_sub_catalog'])
74
+ prompt = get_prompt(messages, criteria_name)
75
  prompt = json.dumps(prompt, indent=4)
76
  return gr.Markdown(prompt)
77