chore/ 删除无用文件
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
回忆录整理 Agent:基于传记结构,将口语改写为书面语,归类到章节
|
||||
支持异步调用
|
||||
"""
|
||||
|
||||
import json
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
@@ -40,7 +41,9 @@ class MemoryAgent:
|
||||
try:
|
||||
prompt = get_chapter_classification_prompt(segments_text)
|
||||
response = await self.llm.ainvoke(prompt)
|
||||
content = response.content if hasattr(response, "content") else str(response)
|
||||
content = (
|
||||
response.content if hasattr(response, "content") else str(response)
|
||||
)
|
||||
category = content.strip().lower()
|
||||
if category in CHAPTER_CATEGORIES:
|
||||
return category
|
||||
@@ -70,7 +73,9 @@ class MemoryAgent:
|
||||
max_tokens=4096,
|
||||
)
|
||||
response = await json_llm.ainvoke(prompt)
|
||||
content = response.content if hasattr(response, "content") else str(response)
|
||||
content = (
|
||||
response.content if hasattr(response, "content") else str(response)
|
||||
)
|
||||
content = content.strip()
|
||||
result = json.loads(extract_json_payload(content))
|
||||
result["content"] = inject_image_placeholder_template(
|
||||
|
||||
Reference in New Issue
Block a user