Update app.py
Browse files
app.py
CHANGED
@@ -120,6 +120,14 @@ def generate_pdf_report():
|
|
120 |
pdf.cell(200, 10, txt=f"MBTI Type (Classic): {output_data['mbti_type_classic']}", ln=True)
|
121 |
pdf.cell(200, 10, txt=f"MBTI Type (AI Prediction): {output_data['mbti_type_llm']}", ln=True)
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
# Save the PDF to a file
|
124 |
pdf_file_path = 'flex_temp_personality_report.pdf'
|
125 |
pdf.output(pdf_file_path)
|
@@ -166,7 +174,7 @@ def show_mbti_quiz():
|
|
166 |
"""
|
167 |
try:
|
168 |
response = openai.ChatCompletion.create(
|
169 |
-
model="gpt-
|
170 |
messages=[{"role": "system", "content": "You are a helpful assistant."},
|
171 |
{"role": "user", "content": prompt}]
|
172 |
)
|
|
|
120 |
pdf.cell(200, 10, txt=f"MBTI Type (Classic): {output_data['mbti_type_classic']}", ln=True)
|
121 |
pdf.cell(200, 10, txt=f"MBTI Type (AI Prediction): {output_data['mbti_type_llm']}", ln=True)
|
122 |
|
123 |
+
# Add full Output.json content (including AI prediction and all data)
|
124 |
+
pdf.ln(10)
|
125 |
+
pdf.cell(200, 10, txt="Full Output Information:", ln=True)
|
126 |
+
|
127 |
+
# Break the full AI prediction into lines to avoid overflow
|
128 |
+
full_output = json.dumps(output_data, indent=4)
|
129 |
+
pdf.multi_cell(0, 10, full_output)
|
130 |
+
|
131 |
# Save the PDF to a file
|
132 |
pdf_file_path = 'flex_temp_personality_report.pdf'
|
133 |
pdf.output(pdf_file_path)
|
|
|
174 |
"""
|
175 |
try:
|
176 |
response = openai.ChatCompletion.create(
|
177 |
+
model="gpt-4",
|
178 |
messages=[{"role": "system", "content": "You are a helpful assistant."},
|
179 |
{"role": "user", "content": prompt}]
|
180 |
)
|