refac
This commit is contained in:
1 parent
d727ee4d1f
commit
3fe03583a3
2 files changed
+4
-3
No files matched your search
@@ -422,7 +422,7 @@ async def review_memory_after_turn(
|
|||||||
if not features.get('memory'):
|
if not features.get('memory'):
|
||||||
return
|
return
|
||||||
|
|
||||||
assistant_content = assistant_message.get('content', '')
|
assistant_content = get_content_from_message(assistant_message)
|
||||||
if not isinstance(assistant_content, str) or not assistant_content.strip():
|
if not isinstance(assistant_content, str) or not assistant_content.strip():
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -479,9 +479,9 @@ async def _review_memory(
|
|||||||
for memory in (existing_memories or [])[:80]
|
for memory in (existing_memories or [])[:80]
|
||||||
]
|
]
|
||||||
|
|
||||||
assistant_content = assistant_message.get('content', '')
|
assistant_content = get_content_from_message(assistant_message)
|
||||||
if not isinstance(assistant_content, str):
|
if not isinstance(assistant_content, str):
|
||||||
assistant_content = get_content_from_message(assistant_message)
|
assistant_content = ''
|
||||||
|
|
||||||
transcript_lines = []
|
transcript_lines = []
|
||||||
for message in messages[-16:]:
|
for message in messages[-16:]:
|
||||||
|
|||||||
@@ -5460,6 +5460,7 @@ async def streaming_chat_response_handler(response, ctx):
|
|||||||
)
|
)
|
||||||
|
|
||||||
ctx['assistant_message'] = {
|
ctx['assistant_message'] = {
|
||||||
|
'content': ''.join(content_parts) or get_output_text(output),
|
||||||
'output': output,
|
'output': output,
|
||||||
**({'usage': usage} if usage else {}),
|
**({'usage': usage} if usage else {}),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user