Skip to content

Messages do not serialize properly #78

@qandrew

Description

@qandrew

In the context of vLLM usage, when we try to serialize messages for sending it out as a SSE event, the serialization doesn't work. We wrote a workaround in vllm-project/vllm#26185 but it would be nice to fix it in this library.

parser.messages[0]
Message(author=Author(role=<Role.ASSISTANT: 'assistant'>, name=None), content=[TextContent(text='We need to respond as ChatGPT. The user says "Hello." We respond politely. Possibly ask how can help.')], channel='analysis', recipient=None, content_type=None)
parser.messages[0].model_dump_json()
'{"author":{"role":"assistant","name":null},"content":[{}],"channel":"analysis","recipient":null,"content_type":null}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions