Make chatgpt_request compatible with OpenAI 2.x#12
Merged
Conversation
The boundary regex in `.ci/changelog-notes` stopped at `## ` headers and `<a id=` anchors, but not at the trailing scriv marker. Once scriv emits `<!-- scriv-end-here -->`, the extractor would silently include it in release notes. Port the fix from shellgenius so the extractor also stops at `<!-- scriv-end-here -->`. Co-authored-by: AI <ai@sderev.com>
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
* switch streaming requests to `client.responses.stream()` and drop the private status-error helper * add direct SDK-boundary tests for streaming, fallback, and error propagation * widen supported `openai` versions to `<3.0` and refresh `uv.lock` Co-authored-by: AI <ai@sderev.com>
be45df7 to
f71f774
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
vocabmaster/gpt_integration.pysochatgpt_requestuses the OpenAI Responses 2.x public interfaces:client.responses.stream(...)for streaming andclient.responses.create(...)for non-streaming.tests/test_gpt_integration_sdk_boundary.pyfor streaming/non-streaming behavior, streamed delta handling, fallback to final output text, and publicRateLimitErrorpropagation.openaidependency constraint inpyproject.tomland refresheduv.lockaccordingly.changelog.d/openai-2x-compatibility.md.Why
vocabmasterflow compatible with OpenAI 2.x while preserving current output behavior.How to test
gatefrom the repository root.OPENAI_API_KEY(or~/.config/lmt/key.env) with a valid key.vocabmaster pairs addand create a test pair.vocabmaster add <word>for one or more words in that pair.vocabmaster translateand verify TSV output still showsoriginal_word, translations/definition field, and a single example sentence per row.vocabmaster translatewith enough words to observe streamed output and confirm no SDK compatibility error is raised.Risk/comp notes
response.output_text.deltaevents; when absent, code falls back tofinal_response.output_text.Changelog fragment
changelog.d/openai-2x-compatibility.md.