yxmnjxzx commited on
Commit
aaf8578
·
verified ·
1 Parent(s): 951a6c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -368,10 +368,15 @@ class GradioInterface:
368
 
369
  def refine_prompt(self, prompt: str, meta_prompt_choice: str) -> tuple:
370
  input_data = PromptInput(text=prompt, meta_prompt_choice=meta_prompt_choice)
371
- # Since result is a tuple with 4 elements based on the return value of prompt_refiner.refine_prompt
372
- initial_prompt_evaluation, refined_prompt, explanation_refinements, full_response = self.prompt_refiner.refine_prompt(input_data)
 
 
 
 
 
 
373
 
374
- analysis_evaluation = f"\n\n{initial_prompt_evaluation}"
375
  return (
376
  analysis_evaluation,
377
  refined_prompt,
 
368
 
369
  def refine_prompt(self, prompt: str, meta_prompt_choice: str) -> tuple:
370
  input_data = PromptInput(text=prompt, meta_prompt_choice=meta_prompt_choice)
371
+ # Get the RefinementOutput object
372
+ result = self.prompt_refiner.refine_prompt(input_data)
373
+
374
+ # Now properly extract values from the RefinementOutput object
375
+ analysis_evaluation = f"\n\n{result.initial_prompt_evaluation}" if result.initial_prompt_evaluation else ""
376
+ refined_prompt = result.refined_prompt if result.refined_prompt else ""
377
+ explanation_refinements = result.explanation_of_refinements if result.explanation_of_refinements else ""
378
+ full_response = result.raw_content if result.raw_content else {}
379
 
 
380
  return (
381
  analysis_evaluation,
382
  refined_prompt,