Skip to content

fix: Multi turn evaluation causes JSON serialization error#62

Open
ViaDézo1er (viadezo1er) wants to merge 2 commits intomainfrom
cedric/json-serialization-error-multi-turn-evaluation
Open

fix: Multi turn evaluation causes JSON serialization error#62
ViaDézo1er (viadezo1er) wants to merge 2 commits intomainfrom
cedric/json-serialization-error-multi-turn-evaluation

Conversation

@viadezo1er

Fix #38

Deserialize JSON using Braintrust custom deserialization function (bt_dumps from bt_json), allowing to deserialize the ChatCompletionMessage objects.

@viadezo1er ViaDézo1er (viadezo1er) force-pushed the cedric/json-serialization-error-multi-turn-evaluation branch from c6dca9e to de0f896 Compare March 9, 2026 23:40

resp = proxy_conn().post("function/invoke", json=request, headers=headers, stream=stream)
request = bt_dumps(request)
resp = proxy_conn().post("function/invoke", data=request, headers=headers, stream=stream)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it's important to note that switching from json=request to data=request will mean we no longer set Content-Type: application/json when sending the request. I'd double check if this is okay. If it is, feel free to merge!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, let's also add a regression test for this - I'm actually going to block until we add that.

Co-authored-by: Abhijeet Prasad <[email protected]>
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.

JSON serialization error with Gemini 2.5 models in multi-turn evaluation

2 participants