-
Notifications
You must be signed in to change notification settings - Fork 5.5k
OpenAI: Added support for structured outputs in Chat action #13725
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
OpenAI: Added support for structured outputs in Chat action #13725
Conversation
WalkthroughThe recent changes introduce support for structured outputs in OpenAI Actions, particularly enhancing the Chat action to utilize a new Changes
Assessment against linked issues
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
@jcortes is attempting to deploy a commit to the Pipedreamers Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
ec69d49
to
ac352db
Compare
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (37)
- 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 (2 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/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/delete-file/delete-file.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/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/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/constants.mjs (2 hunks)
- components/openai/common/helpers.mjs (2 hunks)
- components/openai/package.json (1 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 (33)
- components/openai/actions/analyze-image-content/analyze-image-content.mjs
- components/openai/actions/cancel-run/cancel-run.mjs
- components/openai/actions/chat-with-assistant/chat-with-assistant.mjs
- components/openai/actions/classify-items-into-categories/classify-items-into-categories.mjs
- components/openai/actions/convert-text-to-speech/convert-text-to-speech.mjs
- components/openai/actions/create-assistant/create-assistant.mjs
- components/openai/actions/create-batch/create-batch.mjs
- components/openai/actions/create-embeddings/create-embeddings.mjs
- components/openai/actions/create-fine-tuning-job/create-fine-tuning-job.mjs
- components/openai/actions/create-image/create-image.mjs
- components/openai/actions/create-moderation/create-moderation.mjs
- components/openai/actions/create-thread/create-thread.mjs
- components/openai/actions/create-transcription/create-transcription.mjs
- components/openai/actions/delete-file/delete-file.mjs
- components/openai/actions/list-files/list-files.mjs
- components/openai/actions/list-messages/list-messages.mjs
- components/openai/actions/list-run-steps/list-run-steps.mjs
- components/openai/actions/list-runs/list-runs.mjs
- components/openai/actions/modify-assistant/modify-assistant.mjs
- components/openai/actions/retrieve-file-content/retrieve-file-content.mjs
- components/openai/actions/retrieve-file/retrieve-file.mjs
- components/openai/actions/retrieve-run-step/retrieve-run-step.mjs
- components/openai/actions/retrieve-run/retrieve-run.mjs
- components/openai/actions/send-prompt/send-prompt.mjs
- components/openai/actions/submit-tool-outputs-to-run/submit-tool-outputs-to-run.mjs
- components/openai/actions/summarize/summarize.mjs
- components/openai/actions/translate-text/translate-text.mjs
- components/openai/actions/upload-file/upload-file.mjs
- components/openai/package.json
- components/openai/sources/new-batch-completed/new-batch-completed.mjs
- components/openai/sources/new-file-created/new-file-created.mjs
- components/openai/sources/new-fine-tuning-job-created/new-fine-tuning-job-created.mjs
- components/openai/sources/new-run-state-changed/new-run-state-changed.mjs
Additional comments not posted (9)
components/openai/common/helpers.mjs (3)
Line range hint
3-19
: LGTM!The function is correctly implemented and handles both specific string values and JSON parsing.
The code changes are approved.
22-27
: LGTM!The function is correctly implemented and handles empty strings appropriately.
The code changes are approved.
29-39
: LGTM!The function is correctly implemented, handling various input types and providing appropriate error messages for invalid JSON.
The code changes are approved.
components/openai/common/constants.mjs (1)
48-61
: LGTM!The constant is correctly implemented, providing a clear and extensible format for defining response types.
The code changes are approved.
components/openai/actions/chat/chat.mjs (4)
8-8
: LGTM!The version update is appropriate given the new features and enhancements.
The code changes are approved.
46-47
: LGTM!The description update is clear and provides valuable information about the new JSON Schema option.
The code changes are approved.
47-47
: LGTM!The update is appropriate and aligns with the new structure of
CHAT_RESPONSE_FORMAT
.The code changes are approved.
54-66
: LGTM!The method is correctly implemented, enhancing the flexibility and usability of the Chat API.
The code changes are approved.
components/openai/actions/common/common.mjs (1)
153-159
: Verify the correctness ofconstants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value
.Ensure that
constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value
is correctly defined and used.Run the following script to verify the definition and usage of
constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value
:
WHY
Resolves #13707
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores