Inconsistencies in message mappers #323
JonathanWebNL
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There seems to be some inconsistency in the way messages are mapped for different providers. For our application, I created a DatabaseChatHistory. During the process, some extra metadata is added to the message. So a message may have a "visible" or "errors" attribute.
For OpenAI the messages are simply serialized and send to the API endpoint. Apparently OpenAI accepts extra attributes.
The message mapper for Gemini explicitly only extracts the fields it requires from the message.
For Anthropic the mapper also simply serializes and send to the endpoint, but Anthropic does not accept extra attribute.
Our current workaround is to overwrite the mapper for anthropic and remove the metadata manually.
Shouldn't every provider follow the Gemini mapping approach: extracting only the allowed fields from the message?
Beta Was this translation helpful? Give feedback.
All reactions