|
18 | 18 | from openai.types.chat.chat_completion_message import ( |
19 | 19 | Annotation as OpenAIAnnotation) |
20 | 20 | # yapf: enable |
21 | | -from openai.types.responses import (ResponseFunctionToolCall, |
22 | | - ResponseInputItemParam, ResponseOutputItem, |
23 | | - ResponsePrompt, ResponseReasoningItem, |
24 | | - ResponseStatus) |
| 21 | +from openai.types.responses import ( |
| 22 | + ResponseCodeInterpreterCallCodeDeltaEvent, |
| 23 | + ResponseCodeInterpreterCallCodeDoneEvent, |
| 24 | + ResponseCodeInterpreterCallCompletedEvent, |
| 25 | + ResponseCodeInterpreterCallInProgressEvent, |
| 26 | + ResponseCodeInterpreterCallInterpretingEvent, ResponseCompletedEvent, |
| 27 | + ResponseContentPartAddedEvent, ResponseContentPartDoneEvent, |
| 28 | + ResponseCreatedEvent, ResponseFunctionToolCall, ResponseInProgressEvent, |
| 29 | + ResponseInputItemParam, ResponseOutputItem, ResponseOutputItemAddedEvent, |
| 30 | + ResponseOutputItemDoneEvent, ResponsePrompt, ResponseReasoningItem, |
| 31 | + ResponseReasoningTextDeltaEvent, ResponseReasoningTextDoneEvent, |
| 32 | + ResponseStatus, ResponseWebSearchCallCompletedEvent, |
| 33 | + ResponseWebSearchCallInProgressEvent, ResponseWebSearchCallSearchingEvent) |
25 | 34 |
|
26 | 35 | # Backward compatibility for OpenAI client versions |
27 | 36 | try: # For older openai versions (< 1.100.0) |
@@ -251,6 +260,26 @@ def get_logits_processors(processors: Optional[LogitsProcessors], |
251 | 260 | ResponseReasoningItem, |
252 | 261 | ResponseFunctionToolCall] |
253 | 262 |
|
| 263 | +StreamingResponsesResponse: TypeAlias = Union[ |
| 264 | + ResponseCreatedEvent, |
| 265 | + ResponseInProgressEvent, |
| 266 | + ResponseCompletedEvent, |
| 267 | + ResponseOutputItemAddedEvent, |
| 268 | + ResponseOutputItemDoneEvent, |
| 269 | + ResponseContentPartAddedEvent, |
| 270 | + ResponseContentPartDoneEvent, |
| 271 | + ResponseReasoningTextDeltaEvent, |
| 272 | + ResponseReasoningTextDoneEvent, |
| 273 | + ResponseCodeInterpreterCallInProgressEvent, |
| 274 | + ResponseCodeInterpreterCallCodeDeltaEvent, |
| 275 | + ResponseWebSearchCallInProgressEvent, |
| 276 | + ResponseWebSearchCallSearchingEvent, |
| 277 | + ResponseWebSearchCallCompletedEvent, |
| 278 | + ResponseCodeInterpreterCallCodeDoneEvent, |
| 279 | + ResponseCodeInterpreterCallInterpretingEvent, |
| 280 | + ResponseCodeInterpreterCallCompletedEvent, |
| 281 | +] |
| 282 | + |
254 | 283 |
|
255 | 284 | class ResponsesRequest(OpenAIBaseModel): |
256 | 285 | # Ordered by official OpenAI API documentation |
|
0 commit comments