Skip to content

Better handling of custom fields in OpenAI-compatible APIs #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Anson2251 opened this issue Feb 23, 2025 · 0 comments
Open

Better handling of custom fields in OpenAI-compatible APIs #149

Anson2251 opened this issue Feb 23, 2025 · 0 comments

Comments

@Anson2251
Copy link

Describe the feature or improvement you're requesting

Hi there! Could we make the response deserialization more flexible to preserve custom fields like reasoning_content?

When using DeepSeek's API (which is OpenAI-compatible), their R1 model returns a reasoning_content field at:

response.choices[0].message.reasoning_content

But currently these custom fields get silently dropped. Maybe we could keep them like OpenAI's Python SDK does?

Additional context

I checked OpenAI's official Python SDK. It seems that they just deserialised the generated json and didn't perform any checks. So the unknown fields were just preserved by dynamic typing.

deepseek's reasoning model docs

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

No branches or pull requests

1 participant