Merge feat/multi-agent into development

- Resolved conflict in api/app/agents/memoir/prompts.py: kept archived_section for get_narrative_prompt compatibility
- Resolved conflict in api/app/tasks/memoir_tasks.py: use MemoirOrchestrator flow (feat/multi-agent)
- Multi-agent architecture: ChatOrchestrator, MemoirOrchestrator, ImagePromptOrchestrator
This commit is contained in:
Kevin
2026-03-19 14:20:57 +08:00
42 changed files with 2096 additions and 893 deletions

View File

@@ -57,7 +57,11 @@ class MemoirImagePromptService:
if self.llm:
raw_response = None
try:
response = self.llm.invoke(
json_llm = self.llm.bind(
model_kwargs={"response_format": {"type": "json_object"}},
max_tokens=512,
)
response = json_llm.invoke(
"Return JSON only with keys prompt, style, size. "
"Convert the memoir scene into an image-generation prompt.\n"
+ json.dumps(llm_input, ensure_ascii=False)
@@ -113,7 +117,11 @@ class MemoirImagePromptService:
if self.llm:
try:
response = self.llm.invoke(
json_llm = self.llm.bind(
model_kwargs={"response_format": {"type": "json_object"}},
max_tokens=512,
)
response = json_llm.invoke(
"Return JSON only with keys prompt, style, size. "
"Create an image-generation prompt for a memoir chapter COVER. "
"Emphasize: hero composition, evocative scene, chapter cover aesthetic.\n"