mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-12 23:01:07 +00:00
fix incomplete role handling for system and tool messages
This commit is contained in:
parent
550aa0e975
commit
817c319e38
1 changed files with 6 additions and 1 deletions
|
|
@ -69,7 +69,12 @@ def get_conversation_content(messages: List[ChatCompletionMessageParam]) -> str:
|
|||
|
||||
for message in messages:
|
||||
role = message.get("role", "")
|
||||
role_label = "User" if role == "user" else "Assistant"
|
||||
role_label = {
|
||||
"user": "User",
|
||||
"assistant": "Assistant",
|
||||
"system": "System",
|
||||
"tool": "Tool"
|
||||
}.get(role, "Unknown")
|
||||
|
||||
content = message.get("content")
|
||||
if isinstance(content, str):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue