Skip to content

Backwards compatibility guarantees for storing and loading message history? #2789

@metanivek

Description

@metanivek

Question

We recently upgraded to the 1.0 beta (congrats, btw 🎉) and had some code break that reads stored message history.

ValidationError
3 validation errors for list[tagged-union[ModelRequest,ModelResponse]]
1.response.usage.details
  Input should be a valid dictionary [type=dict_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.11/v/dict_type
3.response.usage.details
  Input should be a valid dictionary [type=dict_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.11/v/dict_type
5.response.usage.details
  Input should be a valid dictionary [type=dict_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.11/v/dict_type

What sort of guarantees will there be post-1.0 of these types (ModelRequest, ModelResponse) being stable such that ModelMessagesTypeAdapter.validate_python will work? Should we be looking into other ways of storing message history other than the guidance in the docs? Thanks!

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions