|
from questions import questions |
|
from chain_reports import generate_short_report_for_session |
|
from chain_problems import analyze_problems_with_chain |
|
from chain_recommendations import generate_recommendations |
|
from chain_summary import generate_final_summary, shorten_summary |
|
from typing import Dict |
|
|
|
def process_answers_pipeline(responses: Dict[str, str]) -> Dict[str, any]: |
|
""" |
|
Orchestrates the entire pipeline: |
|
1. Generates a short wellness report based on responses. |
|
2. Analyzes problems using the generated report. |
|
3. Generates package recommendations. |
|
4. Creates a final summary for video narration. |
|
5. Shortens the final summary for concise video creation. |
|
|
|
Returns a dictionary containing all outputs. |
|
""" |
|
|
|
report = generate_short_report_for_session(responses) |
|
|
|
|
|
problems = analyze_problems_with_chain(responses, report) |
|
|
|
|
|
recommendation = generate_recommendations(problems) |
|
|
|
|
|
final_summary = generate_final_summary(report, problems, recommendation) |
|
|
|
|
|
shortened_summary = shorten_summary(final_summary) |
|
|
|
|
|
return { |
|
"report": report, |
|
"problems": problems, |
|
"recommendation": recommendation, |
|
"final_summary": final_summary, |
|
"shortened_summary": shortened_summary |
|
} |
|
|