Repository navigation
OpenAI - Analyze Image Content - support configurable model - #20791
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
📝 WalkthroughWalkthroughAdds a configurable Responses API model and per-image detail handling to the OpenAI analyze-image-content action, updates response parsing, introduces separate filePath/fileUrl props, adds a new ChangesAnalyze Image Content (model + image detail + response parsing)
Version and Manifest Bumps
Sequence Diagram(s)sequenceDiagram
participant User
participant Action as AnalyzeImageContentAction
participant Files as FilesAPI
participant OpenAI as OpenAI Responses API
User->>Action: invoke with fileUrl/filePath/imageFileId + imageDetailLevel
Action->>Files: (if upload) upload `filePath` -> receive file reference
Action->>OpenAI: POST /responses with model = this.modelId, input_image blocks include detail=this.imageDetailLevel
OpenAI-->>Action: responses with run.output[0].content array
Action->>Action: find content object with `text`, set returnData.response, push message
Action-->>User: return response and messages
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 10
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/openai/actions/analyze-image-content/analyze-image-content.mjs`:
- Line 11: The package version in analyze-image-content action was bumped as a
patch but this change adds new optional functionality (modelId), so update the
version string in analyze-image-content.mjs from "1.1.2" to "1.2.0" to reflect a
minor semver bump; locate the version field (version: "1.1.2",) in the
analyze-image-content action module and replace it with the new minor version
"1.2.0".
In
`@components/openai/actions/chat-with-responses-api/chat-with-responses-api.mjs`:
- Line 13: The version number in the chat-with-responses-api.mjs file was
incremented from 0.0.4 to 0.0.5 without any code or behavior changes, which
violates the versioning guidelines. Revert the version back to 0.0.4 to reflect
that no functional changes were made in this file.
In `@components/openai/actions/chat/chat.mjs`:
- Line 8: The version field in chat.mjs was bumped to "0.3.6" without any
corresponding code or behavior change; revert the version value in the exported
object (the version property in components/openai/actions/chat/chat.mjs) back to
"0.3.5" unless you intentionally made a behavioral change—if the bump is
intentional, add a brief changelog or comment explaining the reason and ensure
related package/version metadata is updated consistently.
In
`@components/openai/actions/classify-items-into-categories/classify-items-into-categories.mjs`:
- Line 6: The version field in this action (version: "0.1.12") was bumped with
no functional change—revert it back to "0.1.11" (or alternatively implement the
intended change, e.g., add handling for the new responsesModelId prop on this
action and include it in inherited props) so the action's semantic version
matches actual modifications; update the version string in the module and, if
you opt to support responsesModelId, add the prop usage/prop inheritance in the
action code (and corresponding tests) before keeping a higher patch version.
In `@components/openai/actions/create-batch/create-batch.mjs`:
- Line 12: Revert the unnecessary version bump in create-batch.mjs by changing
the module's version field back from "0.1.5" to "0.1.4" (the lone updated symbol
is the version key on the top-level export), or if a bump is required by policy,
add a brief comment in the file explaining why the version changed despite no
interface/behavior changes so reviewers can verify intent.
In `@components/openai/actions/create-thread/create-thread.mjs`:
- Line 9: The version field was bumped from "0.0.18" to "0.0.19" without any
corresponding interface or behavioral changes; revert the version value in
create-thread.mjs back to "0.0.18" (restore the original "version" string) so
the action's version only changes when the action's API/behavior changes, and if
this bump was intended, add a brief note in the changelog or commit message
describing the actual change that justifies "0.0.19".
In `@components/openai/actions/list-runs/list-runs.mjs`:
- Line 7: The version field was incremented without any functional changes;
revert the manifest entry version: "0.0.20" back to version: "0.0.19" (the
original value) in the list-runs module so the package version matches actual
code changes, or if the bump is intentional, add a comment explaining the reason
and update related changelog/props consistently; target the single line
containing the version string (version: "0.0.20",) in list-runs.mjs for the
edit.
In `@components/openai/actions/retrieve-run-step/retrieve-run-step.mjs`:
- Line 7: The version field "version" in retrieve-run-step.mjs was bumped from
"0.0.18" to "0.0.19" without any corresponding code or behavioral changes;
revert the version string in the module (the "version" property) back to
"0.0.18" unless there are associated changes elsewhere that justify a bump, and
if a bump is intended add a changelog or commit that reflects the functional
updates tied to this file.
In `@components/openai/actions/retrieve-run/retrieve-run.mjs`:
- Line 7: The version field was incremented from "0.0.18" to "0.0.19" without
corresponding code changes; revert the version change in this file by restoring
the version value to "0.0.18" (the version string literal in this module) or, if
a bump is intentional, add a brief commit message or changelog entry justifying
the bump and ensure related code/prop/behavior changes are present; update the
version string in the top-level export (the version: "..." entry) accordingly so
the version matches actual changes.
In `@components/openai/package.json`:
- Line 3: The package.json version bump is incorrect for adding a new optional
prop; update "version" in components/openai/package.json from 1.2.5 to at least
1.3.0 (minor bump) to reflect the backward-compatible addition (new optional
prop modelId in the analyze-image-content action), and also ensure the consuming
app's package.json version is bumped to the same or greater semver segment so
both component and app versions remain consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 99402682-7267-494e-aa7e-a309d571fcc9
📒 Files selected for processing (47)
components/openai/actions/analyze-image-content/analyze-image-content.mjscomponents/openai/actions/cancel-run/cancel-run.mjscomponents/openai/actions/chat-using-file-search/chat-using-file-search.mjscomponents/openai/actions/chat-using-functions/chat-using-functions.mjscomponents/openai/actions/chat-using-web-search/chat-using-web-search.mjscomponents/openai/actions/chat-with-assistant/chat-with-assistant.mjscomponents/openai/actions/chat-with-responses-api/chat-with-responses-api.mjscomponents/openai/actions/chat/chat.mjscomponents/openai/actions/classify-items-into-categories/classify-items-into-categories.mjscomponents/openai/actions/convert-text-to-speech/convert-text-to-speech.mjscomponents/openai/actions/create-assistant/create-assistant.mjscomponents/openai/actions/create-batch/create-batch.mjscomponents/openai/actions/create-embeddings/create-embeddings.mjscomponents/openai/actions/create-fine-tuning-job/create-fine-tuning-job.mjscomponents/openai/actions/create-image/create-image.mjscomponents/openai/actions/create-moderation/create-moderation.mjscomponents/openai/actions/create-thread/create-thread.mjscomponents/openai/actions/create-transcription/create-transcription.mjscomponents/openai/actions/create-vector-store-file/create-vector-store-file.mjscomponents/openai/actions/create-vector-store/create-vector-store.mjscomponents/openai/actions/delete-file/delete-file.mjscomponents/openai/actions/delete-vector-store-file/delete-vector-store-file.mjscomponents/openai/actions/delete-vector-store/delete-vector-store.mjscomponents/openai/actions/list-files/list-files.mjscomponents/openai/actions/list-messages/list-messages.mjscomponents/openai/actions/list-run-steps/list-run-steps.mjscomponents/openai/actions/list-runs/list-runs.mjscomponents/openai/actions/list-vector-store-files/list-vector-store-files.mjscomponents/openai/actions/list-vector-stores/list-vector-stores.mjscomponents/openai/actions/modify-assistant/modify-assistant.mjscomponents/openai/actions/retrieve-file-content/retrieve-file-content.mjscomponents/openai/actions/retrieve-file/retrieve-file.mjscomponents/openai/actions/retrieve-run-step/retrieve-run-step.mjscomponents/openai/actions/retrieve-run/retrieve-run.mjscomponents/openai/actions/retrieve-vector-store-file/retrieve-vector-store-file.mjscomponents/openai/actions/retrieve-vector-store/retrieve-vector-store.mjscomponents/openai/actions/send-prompt/send-prompt.mjscomponents/openai/actions/submit-tool-outputs-to-run/submit-tool-outputs-to-run.mjscomponents/openai/actions/summarize/summarize.mjscomponents/openai/actions/translate-text/translate-text.mjscomponents/openai/actions/upload-file/upload-file.mjscomponents/openai/openai.app.mjscomponents/openai/package.jsoncomponents/openai/sources/new-batch-completed/new-batch-completed.mjscomponents/openai/sources/new-file-created/new-file-created.mjscomponents/openai/sources/new-fine-tuning-job-created/new-fine-tuning-job-created.mjscomponents/openai/sources/new-run-state-changed/new-run-state-changed.mjs
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/openai/actions/analyze-image-content/analyze-image-content.mjs`:
- Around line 138-144: The current block can push undefined or change the
assistant message shape; update the parsing so you only push a message when text
blocks exist and preserve the original content-array shape. Specifically, for
the run object (run.output and run.output[0]), filter or find text-bearing
content entries first (e.g., const textBlocks = run.output[0]?.content?.filter(c
=> c.text)), set returnData.response from the first textBlock if present, and
push to returnData.messages only when textBlocks.length > 0, using the same
array shape (e.g., content: textBlocks) and include role: run.output[0].role so
you never push undefined or change content from array to single object.
- Around line 48-53: The fileUrl property in the analyze-image-content action
schema is defined as a plain string but should use the file-ref contract; update
the fileUrl schema (the fileUrl object in analyze-image-content.mjs) to include
format: "file-ref" so it is treated as a file input like other file path/URL
props and follows the project's file input conventions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5107c58c-8a5d-467f-a90d-f12eba469fab
📒 Files selected for processing (1)
components/openai/actions/analyze-image-content/analyze-image-content.mjs
…mHQ#20791) * add modelId prop to analyze-image-content * versions * versions * add imageDetailLevel prop * allow image_url directly --------- Co-authored-by: Michelle Bergeron <michelle.bergeron@ahp7jvtgvfr.celonis.cloud>
* add modelId prop to analyze-image-content * versions * versions * add imageDetailLevel prop * allow image_url directly --------- Co-authored-by: Michelle Bergeron <michelle.bergeron@ahp7jvtgvfr.celonis.cloud>

Resolves #20777
Summary by CodeRabbit
New Features
Chores