fix/various fixes

This commit is contained in:
Kevin
2026-03-20 15:15:35 +08:00
parent 7f57f96c25
commit 7317bf10cd
112 changed files with 3790 additions and 2242 deletions

View File

@@ -7,12 +7,12 @@ from __future__ import annotations
from typing import Any, Dict, Optional
from app.core.logging import get_logger
from app.agents.memoir.prompts import (
get_creative_title_prompt,
get_narrative_json_prompt,
)
from app.core.langchain_llm import bind_json_object_mode
from app.core.logging import get_logger
logger = get_logger(__name__)
@@ -70,10 +70,7 @@ class NarrativeAgent:
user_profile=user_profile,
birth_year=birth_year,
)
json_llm = llm.bind(
model_kwargs={"response_format": {"type": "json_object"}},
max_tokens=4096,
)
json_llm = bind_json_object_mode(llm, max_tokens=4096)
response = json_llm.invoke(prompt)
return (response.content or "").strip()
except Exception as e: