-
Notifications
You must be signed in to change notification settings - Fork 5.3k
OpenAI - Migrate from Assistant API v1 to v2 #15061
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
Warning Rate limit exceeded@michelle0927 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 33 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
WalkthroughThis pull request involves a comprehensive update to the OpenAI component across multiple files. The primary changes include version number increments for various actions and modules, an update to the OpenAI API beta headers from "v1" to "v2", and a modification in the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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: 2
🧹 Nitpick comments (1)
components/openai/actions/analyze-image-content/analyze-image-content.mjs (1)
11-11
: Increment version in documentation.
The version has been raised to "0.1.3". Ensure that associated documentation and release notes reflect this version change for accurate tracking.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (44)
components/openai/actions/analyze-image-content/analyze-image-content.mjs
(1 hunks)components/openai/actions/cancel-run/cancel-run.mjs
(1 hunks)components/openai/actions/chat-with-assistant/chat-with-assistant.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/convert-text-to-speech/convert-text-to-speech.mjs
(1 hunks)components/openai/actions/create-assistant/create-assistant.mjs
(1 hunks)components/openai/actions/create-batch/create-batch.mjs
(1 hunks)components/openai/actions/create-embeddings/create-embeddings.mjs
(1 hunks)components/openai/actions/create-fine-tuning-job/create-fine-tuning-job.mjs
(1 hunks)components/openai/actions/create-image/create-image.mjs
(1 hunks)components/openai/actions/create-moderation/create-moderation.mjs
(1 hunks)components/openai/actions/create-thread/create-thread.mjs
(1 hunks)components/openai/actions/create-transcription/create-transcription.mjs
(1 hunks)components/openai/actions/create-vector-store-file/create-vector-store-file.mjs
(1 hunks)components/openai/actions/create-vector-store/create-vector-store.mjs
(1 hunks)components/openai/actions/delete-file/delete-file.mjs
(1 hunks)components/openai/actions/delete-vector-store-file/delete-vector-store-file.mjs
(1 hunks)components/openai/actions/delete-vector-store/delete-vector-store.mjs
(1 hunks)components/openai/actions/list-files/list-files.mjs
(1 hunks)components/openai/actions/list-messages/list-messages.mjs
(1 hunks)components/openai/actions/list-run-steps/list-run-steps.mjs
(1 hunks)components/openai/actions/list-runs/list-runs.mjs
(1 hunks)components/openai/actions/list-vector-store-files/list-vector-store-files.mjs
(1 hunks)components/openai/actions/list-vector-stores/list-vector-stores.mjs
(1 hunks)components/openai/actions/modify-assistant/modify-assistant.mjs
(1 hunks)components/openai/actions/retrieve-file-content/retrieve-file-content.mjs
(1 hunks)components/openai/actions/retrieve-file/retrieve-file.mjs
(1 hunks)components/openai/actions/retrieve-run-step/retrieve-run-step.mjs
(1 hunks)components/openai/actions/retrieve-run/retrieve-run.mjs
(1 hunks)components/openai/actions/retrieve-vector-store-file/retrieve-vector-store-file.mjs
(1 hunks)components/openai/actions/retrieve-vector-store/retrieve-vector-store.mjs
(1 hunks)components/openai/actions/send-prompt/send-prompt.mjs
(1 hunks)components/openai/actions/submit-tool-outputs-to-run/submit-tool-outputs-to-run.mjs
(1 hunks)components/openai/actions/summarize/summarize.mjs
(1 hunks)components/openai/actions/translate-text/translate-text.mjs
(1 hunks)components/openai/actions/upload-file/upload-file.mjs
(1 hunks)components/openai/common/helpers.mjs
(1 hunks)components/openai/openai.app.mjs
(1 hunks)components/openai/package.json
(2 hunks)components/openai/sources/new-batch-completed/new-batch-completed.mjs
(1 hunks)components/openai/sources/new-file-created/new-file-created.mjs
(1 hunks)components/openai/sources/new-fine-tuning-job-created/new-fine-tuning-job-created.mjs
(1 hunks)components/openai/sources/new-run-state-changed/new-run-state-changed.mjs
(1 hunks)
✅ Files skipped from review due to trivial changes (40)
- components/openai/actions/chat/chat.mjs
- components/openai/actions/chat-with-assistant/chat-with-assistant.mjs
- components/openai/actions/create-batch/create-batch.mjs
- components/openai/actions/retrieve-run/retrieve-run.mjs
- components/openai/actions/retrieve-file/retrieve-file.mjs
- components/openai/actions/upload-file/upload-file.mjs
- components/openai/actions/create-moderation/create-moderation.mjs
- components/openai/actions/delete-file/delete-file.mjs
- components/openai/actions/retrieve-vector-store/retrieve-vector-store.mjs
- components/openai/actions/list-files/list-files.mjs
- components/openai/actions/create-embeddings/create-embeddings.mjs
- components/openai/actions/delete-vector-store/delete-vector-store.mjs
- components/openai/actions/create-thread/create-thread.mjs
- components/openai/actions/create-assistant/create-assistant.mjs
- components/openai/actions/translate-text/translate-text.mjs
- components/openai/actions/list-run-steps/list-run-steps.mjs
- components/openai/actions/cancel-run/cancel-run.mjs
- components/openai/actions/retrieve-run-step/retrieve-run-step.mjs
- components/openai/actions/retrieve-file-content/retrieve-file-content.mjs
- components/openai/actions/modify-assistant/modify-assistant.mjs
- components/openai/actions/convert-text-to-speech/convert-text-to-speech.mjs
- components/openai/actions/create-transcription/create-transcription.mjs
- components/openai/actions/classify-items-into-categories/classify-items-into-categories.mjs
- components/openai/actions/list-messages/list-messages.mjs
- components/openai/sources/new-file-created/new-file-created.mjs
- components/openai/actions/create-fine-tuning-job/create-fine-tuning-job.mjs
- components/openai/actions/submit-tool-outputs-to-run/submit-tool-outputs-to-run.mjs
- components/openai/sources/new-run-state-changed/new-run-state-changed.mjs
- components/openai/sources/new-fine-tuning-job-created/new-fine-tuning-job-created.mjs
- components/openai/actions/list-runs/list-runs.mjs
- components/openai/actions/list-vector-stores/list-vector-stores.mjs
- components/openai/actions/create-vector-store/create-vector-store.mjs
- components/openai/actions/list-vector-store-files/list-vector-store-files.mjs
- components/openai/actions/create-image/create-image.mjs
- components/openai/actions/summarize/summarize.mjs
- components/openai/actions/create-vector-store-file/create-vector-store-file.mjs
- components/openai/actions/delete-vector-store-file/delete-vector-store-file.mjs
- components/openai/actions/send-prompt/send-prompt.mjs
- components/openai/actions/retrieve-vector-store-file/retrieve-vector-store-file.mjs
- components/openai/sources/new-batch-completed/new-batch-completed.mjs
🔇 Additional comments (3)
components/openai/package.json (1)
18-18
: Verify compatibility with platform v3.x.x
The major version jump in @pipedream/platform dependency (1.x.x → 3.x.x) might introduce breaking changes. Please ensure all platform API usage has been updated accordingly.
✅ Verification successful
Let's examine the actual platform API usage to verify compatibility.
Let's check the specific imports and platform API methods being used to ensure we have a complete picture.
Based on the results from our verification scripts, we can now provide a final assessment:
Platform v3.x.x compatibility appears safe
The codebase only uses basic platform features (db.get/set) which are stable across major versions. The usage is limited to simple key-value operations in source components, which are part of the core functionality maintained across platform versions.
- Found db operations in source components:
new-run-state-changed.mjs
new-batch-completed.mjs
common/common.mjs
No complex platform API patterns or deprecated methods were detected that could be affected by breaking changes.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Search for platform API usage patterns that might need updates
# Look for platform API imports and usage
echo "Searching for platform API usage patterns:"
rg -l "@pipedream/platform" components/openai/
Length of output: 648
Script:
#!/bin/bash
# Check imports and usage of platform APIs in the files
echo "=== Platform API Usage Analysis ==="
# Search for specific platform imports and their usage
rg -A 2 "from '@pipedream/platform'" components/openai/
# Search for common platform API patterns
echo -e "\n=== Common Platform API Patterns ==="
rg "this\.(http|db|store)" components/openai/
Length of output: 931
Script:
#!/bin/bash
# Search for all platform imports
echo "=== Platform Imports ==="
rg "import.*from '@pipedream/platform'" components/openai/
# Search for specific platform API method usage
echo -e "\n=== Platform API Method Usage ==="
rg "app\.(http|db|store)" components/openai/
Length of output: 255
components/openai/common/helpers.mjs (1)
7-7
: Confirm consistent usage of "file_search" across the codebase.
Renaming "retrieval" to "file_search" appears straightforward. Verify if any references or documentation still refer to "retrieval."
Run the following script to identify any lingering references to "retrieval" within the repository:
✅ Verification successful
Let me search for any remaining references to "file_search" to ensure consistency.
The term "file_search" is consistently used across the codebase
The search results show that "file_search" is used consistently in the OpenAI component files, specifically in:
components/openai/common/helpers.mjs
components/openai/actions/common/common-assistants.mjs
components/openai/common/constants.mjs
There are no lingering references to "retrieval" in relation to this functionality.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
rg "retrieval" -A 3 -B 3
Length of output: 61799
Script:
#!/bin/bash
# Search for "file_search" references
rg "file_search" -A 3 -B 3
Length of output: 2053
components/openai/openai.app.mjs (1)
319-319
: Migrate gracefully to API beta version "v2".
Switching from "v1" to "v2" ensures functionality aligns with the newer API. Confirm all downstream services handle the new response format or additional fields returned by version "v2."
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.
LGTM!
Resolves #15059
Summary by CodeRabbit
Release Notes
analyze-image-content
: 0.1.2 → 0.1.3cancel-run
: 0.0.11 → 0.0.12chat-with-assistant
: 0.0.7 → 0.0.8create-image
: 0.1.18 → 0.1.19package.json
: 0.7.1 → 0.7.2