fix/various fixes
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user