openai-go icon indicating copy to clipboard operation
openai-go copied to clipboard

field missing in chat completion?

Open alexagriffith opened this issue 3 months ago • 1 comments

It seems that the chat completion struct in this repo is missing a field that is recorded in the openai platform's response.

The openai docs and ChatCompletion struct https://github.com/openai/openai-go/blob/c6f74f0a573e87895f699b1e4b89274108be205a/chatcompletion.go#L166 don't have the obfuscation field. (but it is listed in the responses docs https://platform.openai.com/docs/api-reference/responses/get)

however, when we test with openai platform it is in the chat completion response. https://github.com/envoyproxy/ai-gateway/tree/main/tests/internal/testopenai/cassettes

background: we are looking to refactor our code from using local structs to using this repo's. however we had just added obfuscation as i was refactoring and I noticed its not in the docs or this repo, and upon asking it seems it was in the response from openai platform, causing some confusion. Adding this field while also using this repo is possible but hacky. We wanted to use this repo so that we wouldnt have to keep up with our local structs and their fields.

Is there a reason there is a mismatch here? Am I missing something?

alexagriffith avatar Aug 19 '25 16:08 alexagriffith

hi bumping this - any thoughts?

alexagriffith avatar Sep 02 '25 14:09 alexagriffith