feat: Responses streaming types#711
Conversation
Signed-off-by: Mads Kildegård <mkildegaard99@gmail.com>
Signed-off-by: Mads Kildegård <mkildegaard99@gmail.com>
8708501 to
3330a3b
Compare
|
Is there something in specific you hit that required this? Since we switch off the type to build the sub streaming set, we technically know it. I'm guessing maybe the toArray() not returning it was a bug? The missing types on response is a good call out. Some types we made fresh streaming classes for, others seemed like they reuse the main response class. |
iBotPeaches
left a comment
There was a problem hiding this comment.
Ran it through my Response tests and all good. Confirmed the changes to Response makes sense. Don't love response->response, but I can't think of a better name.
Slight breaking change here, but since we aren't 1.0.0 yet - I believe thats alright.
Exactly. I was running some tests using the client, that required the items to be the same as the OpenAI API Reference says, which is why I recognized the difference.
I agree - don't like the naming either. Also, using the class |
What:
Description:
This pull request adds
typeto every streamed object in the Responses endpoint, as seen in the OpenAI API Reference.The API Reference also shows that response.created, response.in_progress, response.completed, response.failed and response.incomplete has a
type,responseandsequence number. Currently only theresponseobject is returned, which is made by theCreateResponseclass. I've made it so that they now return aResponseclass, which hastype: string,response: CreateResponseTypeandsequence_number: int.This is a pretty big change, but I believe it is necessary in order to conform to the OpenAI spec more closely.