docs: update migration guide with gemini versioning and model availability insights (v2.4)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
import argparse
|
||||
import base64
|
||||
import json
|
||||
@@ -203,7 +202,9 @@ def phase1(payload):
|
||||
|
||||
try:
|
||||
data = json.loads(response)
|
||||
db_manager.save_gtm_result(project_id, 'phase1_result', json.dumps(data))
|
||||
|
||||
# FIX: Save raw dictionary, not stringified JSON, to avoid double encoding
|
||||
db_manager.save_gtm_result(project_id, 'phase1_result', data)
|
||||
|
||||
# WICHTIG: ID zurückgeben, damit Frontend sie speichert
|
||||
data['projectId'] = project_id
|
||||
@@ -213,7 +214,7 @@ def phase1(payload):
|
||||
error_response = {
|
||||
"error": "Die Antwort des KI-Modells war kein gültiges JSON. Das passiert manchmal bei hoher Auslastung. Bitte versuchen Sie es in Kürze erneut.",
|
||||
"details": response,
|
||||
"projectId": project_id # Auch bei Fehler ID zurückgeben? Besser nicht, da noch nichts gespeichert.
|
||||
"projectId": project_id
|
||||
}
|
||||
return error_response
|
||||
|
||||
@@ -239,7 +240,9 @@ def phase2(payload):
|
||||
response = call_gemini_flash(prompt, system_instruction=sys_instr, json_mode=True)
|
||||
log_and_save(project_id, "phase2", "response", response)
|
||||
data = json.loads(response)
|
||||
db_manager.save_gtm_result(project_id, 'phase2_result', json.dumps(data))
|
||||
|
||||
# FIX: Save raw dictionary
|
||||
db_manager.save_gtm_result(project_id, 'phase2_result', data)
|
||||
return data
|
||||
|
||||
def phase3(payload):
|
||||
@@ -263,7 +266,9 @@ def phase3(payload):
|
||||
response = call_gemini_flash(prompt, system_instruction=sys_instr, json_mode=True)
|
||||
log_and_save(project_id, "phase3", "response", response)
|
||||
data = json.loads(response)
|
||||
db_manager.save_gtm_result(project_id, 'phase3_result', json.dumps(data))
|
||||
|
||||
# FIX: Save raw dictionary
|
||||
db_manager.save_gtm_result(project_id, 'phase3_result', data)
|
||||
return data
|
||||
|
||||
def phase4(payload):
|
||||
@@ -294,7 +299,9 @@ def phase4(payload):
|
||||
response = call_gemini_flash(prompt, system_instruction=sys_instr, json_mode=True)
|
||||
log_and_save(project_id, "phase4", "response", response)
|
||||
data = json.loads(response)
|
||||
db_manager.save_gtm_result(project_id, 'phase4_result', json.dumps(data))
|
||||
|
||||
# FIX: Save raw dictionary
|
||||
db_manager.save_gtm_result(project_id, 'phase4_result', data)
|
||||
return data
|
||||
|
||||
def phase5(payload):
|
||||
@@ -365,7 +372,9 @@ def phase5(payload):
|
||||
report = report.strip()
|
||||
|
||||
log_and_save(project_id, "phase5", "response", report)
|
||||
db_manager.save_gtm_result(project_id, 'phase5_result', json.dumps({"report": report}))
|
||||
|
||||
# FIX: Save raw dictionary (no double JSON stringification)
|
||||
db_manager.save_gtm_result(project_id, 'phase5_result', {"report": report})
|
||||
return {"report": report}
|
||||
|
||||
def phase6(payload):
|
||||
@@ -391,7 +400,9 @@ def phase6(payload):
|
||||
response = call_gemini_flash(prompt, system_instruction=sys_instr, json_mode=True)
|
||||
log_and_save(project_id, "phase6", "response", response)
|
||||
data = json.loads(response)
|
||||
db_manager.save_gtm_result(project_id, 'phase6_result', json.dumps(data))
|
||||
|
||||
# FIX: Save raw dictionary
|
||||
db_manager.save_gtm_result(project_id, 'phase6_result', data)
|
||||
return data
|
||||
|
||||
def phase7(payload):
|
||||
@@ -417,7 +428,9 @@ def phase7(payload):
|
||||
response = call_gemini_flash(prompt, system_instruction=sys_instr, json_mode=True)
|
||||
log_and_save(project_id, "phase7", "response", response)
|
||||
data = json.loads(response)
|
||||
db_manager.save_gtm_result(project_id, 'phase7_result', json.dumps(data))
|
||||
|
||||
# FIX: Save raw dictionary
|
||||
db_manager.save_gtm_result(project_id, 'phase7_result', data)
|
||||
return data
|
||||
|
||||
def phase8(payload):
|
||||
@@ -442,7 +455,9 @@ def phase8(payload):
|
||||
response = call_gemini_flash(prompt, system_instruction=sys_instr, json_mode=True)
|
||||
log_and_save(project_id, "phase8", "response", response)
|
||||
data = json.loads(response)
|
||||
db_manager.save_gtm_result(project_id, 'phase8_result', json.dumps(data))
|
||||
|
||||
# FIX: Save raw dictionary
|
||||
db_manager.save_gtm_result(project_id, 'phase8_result', data)
|
||||
return data
|
||||
|
||||
def phase9(payload):
|
||||
@@ -468,7 +483,9 @@ def phase9(payload):
|
||||
response = call_gemini_flash(prompt, system_instruction=sys_instr, json_mode=True)
|
||||
log_and_save(project_id, "phase9", "response", response)
|
||||
data = json.loads(response)
|
||||
db_manager.save_gtm_result(project_id, 'phase9_result', json.dumps(data))
|
||||
|
||||
# FIX: Save raw dictionary
|
||||
db_manager.save_gtm_result(project_id, 'phase9_result', data)
|
||||
return data
|
||||
|
||||
def translate(payload):
|
||||
@@ -571,4 +588,4 @@ def main():
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
Reference in New Issue
Block a user