Skip to content

feat: add base64 serialization config for Output and Chunk models#145

Merged
Kamilbenkirane merged 1 commit intomainfrom
feat/output-serialization-config
Feb 9, 2026
Merged

feat: add base64 serialization config for Output and Chunk models#145
Kamilbenkirane merged 1 commit intomainfrom
feat/output-serialization-config

Conversation

@Kamilbenkirane
Copy link
Member

Summary

  • Add ser_json_bytes="base64" ConfigDict to Output and Chunk base classes
  • Ensures bytes fields (e.g. artifact data) are base64-encoded when serializing to JSON
  • Without this, Pydantic v2 defaults to UTF-8 encoding for bytes fields, which corrupts binary data

Test plan

  • Run unit tests: uv run pytest tests/unit_tests -v
  • Verify output.model_dump_json() correctly base64-encodes artifact data

Add ser_json_bytes="base64" ConfigDict to Output and Chunk base classes
so bytes fields (e.g. artifact data) are base64-encoded when serializing
to JSON, rather than Pydantic's default UTF-8 encoding.
@claude
Copy link

claude bot commented Feb 9, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@Kamilbenkirane Kamilbenkirane merged commit 3b50075 into main Feb 9, 2026
11 checks passed
@Kamilbenkirane Kamilbenkirane mentioned this pull request Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant