Spaces:
Running
Running
Update app.py
Browse files
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 |
-
#
|
372 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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,
|