fix(openai-compat): decode base64 string data#13006
Conversation
felixarntz
left a comment
There was a problem hiding this comment.
we decoded the base64 data properly in the anthropic provider but not in openai-compat
the only production code change here is in the Anthropic provider - that seems to conflict with your statement? or maybe I'm misunderstanding?
im not sure i understand? what i meant was - previously, decoding was done for properly in anthropic provider but we missed to do it in openai compat. the current change in packages/anthropic/src/convert-to-anthropic-messages-prompt.ts is only to ensure we don't use a node specific api for this |
felixarntz
left a comment
There was a problem hiding this comment.
@aayush-kapoor ah my bad. I didn't actually see the OpenAI compatible non-test code change before 🤦♂️
All good!
|
🚀 Published in:
|
Background
reported in issue #12965
we decoded the base64 data properly in the anthropic provider but not in openai-compat
Summary
convertBase64ToUint8Arrayto properly decode the string before converting to textBuffer.from(data, 'base64').toString('utf-8')with the edge-runtime-safe equivalent usingconvertBase64ToUint8ArrayManual Verification
na
Checklist
pnpm changesetin the project root)Related Issues
fixes #12965