fix(types): use in_memory for prompt_cache_retention#3108
fix(types): use in_memory for prompt_cache_retention#3108MukundaKatta wants to merge 4 commits intoopenai:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbdee6d0a5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| """The annotations of the text output.""" | ||
|
|
||
| text: str | ||
| text: Optional[str] = None |
There was a problem hiding this comment.
Keep streamed output text non-null before delta appends
Changing ResponseOutputText.text to optional allows response.content_part.added snapshots to carry text=None, but streaming accumulation still assumes a string and does content.text += event.delta in src/openai/lib/streaming/responses/_responses.py (lines 349-354). In streams where a content part starts as null and then receives response.output_text.delta events, this will raise a TypeError and terminate parsing; please preserve a non-null invariant for streamed output_text content (or normalize null to "" before appending).
Useful? React with 👍 / 👎.
Per @chatgpt-codex-connector review: making ResponseOutputText.text Optional allows response.content_part.added snapshots to carry text=None. Streaming accumulation then hits 'content.text += event.delta' with a NoneType and raises TypeError, terminating parsing. Normalize text to '' before the first delta append so the existing streaming invariant ('text is a string') holds regardless of the initial content_part.added shape.
|
Addressed @chatgpt-codex-connector review: normalize |
|
Note To use Codex here, create a Codex account and connect to github. |
Summary
Fixes #2883
Validation