-
Notifications
You must be signed in to change notification settings - Fork 345
Description
Describe the feature or improvement you are requesting
Hey, thanks for building this OpenAI SDK.
I am working on integration OpenAI Responses into the agent framework, and I've faced many problems operating with the OpenAI SDK types because:
- most of the types can be constructed only via the JSON
- some of the type properties are internal
- some of the types! are internal
My scenario is that I have an "abstract AIAgent", which can respond with OpenAI Responses, but also can respond with for example OpenAI ChatCompletions or MCP or . Its undetermenistic. Moreover, we have our own subset of types to represent the response in a generic way - for example AIContent.
-
The biggest frustration is that I am not able to implement streaming of the response via OpenAI SDK types, because I can not instantiate the types needed (e.g.
StreamingResponseCreatedUpdateand others). I had to define my own types to stream the response for that. -
Moreover, ResponseCreationOptions has internal fields / properties, which ARE parsed. I would like to use this type in my endpoint handler input, but I cant, and I have to write manual deserialization logic + access e.g.
Streamproperty via reflection code. That complicates the code incredibly. -
Some of the types are simply internal, and without building up tons of reflection code I dont see a clear way to use them.
I really like that there is an SDK carefully defining the types per spec, but these design decisions heavily restrict SDK manipulation. I would like to suggest opening up constructors and avoid internal members. That would definitley allow easier integration. I've seen other issues (e.g. #306) asking for similar thing.
Additional context
No response