Skip to content

fix: as_chat_history is outdated and functionality doesn't match it's name #932

@jakelorocco

Description

@jakelorocco

https://github.com/generative-computing/mellea/blob/main/mellea/stdlib/components/chat.py#L237

The as_chat_history only works on a context that is composed of Messages and ModelOutputThunks. We should provide a general purpose function that outputs contexts in a "general" message format.

It should take an optional formatter parameter but default to a generic one with a log/warning for ease of use.

We can either make this a new function with a new name or change the implementation of as_chat_history. Basically, we should make the interface sensible for end users to output a list of messages that matches closely to what the model gets.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions