-
Notifications
You must be signed in to change notification settings - Fork 5.5k
OpenAI - use max_completion_tokens #17287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis update primarily refactors the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant CommonArgsModule
Caller->>CommonArgsModule: Call _getCommonArgs()
CommonArgsModule->>CommonArgsModule: Check modelId prefix
alt modelId starts with "o1", "o3", or "o4"
CommonArgsModule->>CommonArgsModule: Set args.max_completion_tokens
else
CommonArgsModule->>CommonArgsModule: Set args.max_tokens
end
CommonArgsModule-->>Caller: Return args
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/openai/actions/chat-using-functions/chat-using-functions.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/openai/actions/classify-items-into-categories/classify-items-into-categories.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/openai/actions/chat-using-file-search/chat-using-file-search.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/openai/actions/chat-using-file-search/chat-using-file-search.mjs (1)
8-8: Version bump looks good — remember to note it in the changelogThe change cleanly advances the module from
0.0.4to0.0.5, keeping parity with the other action packages.
Minor nit: ensure the project-wide CHANGELOG (or equivalent release notes) also records this bump so downstream users can track what changed at a glance.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
components/openai/actions/chat-using-file-search/chat-using-file-search.mjs(1 hunks)components/openai/actions/chat-using-functions/chat-using-functions.mjs(1 hunks)components/openai/actions/chat-using-web-search/chat-using-web-search.mjs(1 hunks)components/openai/actions/chat/chat.mjs(1 hunks)components/openai/actions/classify-items-into-categories/classify-items-into-categories.mjs(1 hunks)components/openai/actions/common/common.mjs(2 hunks)components/openai/actions/create-embeddings/create-embeddings.mjs(1 hunks)components/openai/actions/send-prompt/send-prompt.mjs(1 hunks)components/openai/actions/summarize/summarize.mjs(1 hunks)components/openai/actions/translate-text/translate-text.mjs(1 hunks)components/openai/package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (10)
components/openai/package.json (1)
3-3: LGTM: Appropriate patch version increment.The version bump from "1.0.0" to "1.0.1" correctly reflects the patch-level changes made to the OpenAI integration, specifically the model-specific token parameter handling.
components/openai/actions/common/common.mjs (1)
62-87: LGTM: Clean implementation of model-specific token parameter handling.The refactored
_getCommonArgsmethod correctly handles the difference between newer OpenAI models (o1, o3, o4 series) that usemax_completion_tokensand older models that usemax_tokens. The implementation maintains backward compatibility while supporting the newer API requirements.Please verify that the model ID prefixes ("o1", "o3", "o4") are comprehensive and up-to-date with OpenAI's latest model releases:
What are the current OpenAI model names that require max_completion_tokens instead of max_tokens parameter?components/openai/actions/chat/chat.mjs (1)
8-8: LGTM: Version increment reflects improved model compatibility.The patch version bump appropriately indicates that this action now benefits from the improved token parameter handling for newer OpenAI models via the updated common.mjs dependency.
components/openai/actions/send-prompt/send-prompt.mjs (1)
7-7: LGTM: Version increment reflects inherited improvements.The version bump from "0.1.17" to "0.1.18" correctly indicates that this action now supports improved token parameter handling for newer OpenAI models through its dependency on the updated common.mjs.
components/openai/actions/summarize/summarize.mjs (1)
7-7: LGTM: Consistent version increment for improved model support.The version bump from "0.1.6" to "0.1.7" aligns with the coordinated updates across OpenAI actions and ensures users benefit from the enhanced model compatibility for newer OpenAI models.
components/openai/actions/chat-using-web-search/chat-using-web-search.mjs (1)
8-8: Version bump acknowledged – no concernsOnly the
versionfield was incremented from0.0.4to0.0.5. No functional code changed, so nothing else to review here.components/openai/actions/classify-items-into-categories/classify-items-into-categories.mjs (1)
6-6: Minor version bump is fine
versionmoved from0.1.6to0.1.7; no logic touched. Good to go.components/openai/actions/translate-text/translate-text.mjs (1)
12-12: Patch release acceptedRaised to
0.1.7; no implementation differences. Looks OK.components/openai/actions/chat-using-functions/chat-using-functions.mjs (1)
8-8: Version increment onlyBumped from
0.0.5to0.0.6. Since the common token-handling change lives elsewhere, this local file is unaffected. No issues.components/openai/actions/create-embeddings/create-embeddings.mjs (1)
7-7: Embeddings action version bump acknowledged
0.0.18➔0.0.19; code untouched. All good.
Resolves #17082
Summary by CodeRabbit