Skip to content

OpenAI - Analyze Image Content - support configurable model - #20791

Merged
michelle0927 merged 5 commits into
masterfrom
issue-20777
May 11, 2026
Merged

michelle0927 merged 5 commits into
masterfrom
issue-20777

Conversation

@michelle0927

@michelle0927 michelle0927 commented May 5, 2026 •

Copy link
Copy Markdown
Collaborator

Resolves #20777

Summary by CodeRabbit

  • New Features

    • Make the image-analysis model selectable and add a Responses API model setting.
    • Image inputs now accept separate file path and URL fields and honor image detail level.
    • Improved parsing of image analysis responses for more reliable text output.
  • Chores

    • Bumped package and component versions across many OpenAI actions and sources for maintenance.

@vercel

vercel Bot commented May 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored May 5, 2026 6:22pm

Request Review

@coderabbitai

coderabbitai Bot commented May 5, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds 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 responsesModelId app prop, and bumps versions across many OpenAI actions, sources, and the package.

Changes

Analyze Image Content (model + image detail + response parsing)

Layer / File(s) Summary
App Prop
components/openai/openai.app.mjs
Adds propDefinitions.responsesModelId — a string selector (options from getChatCompletionModels().map(m => m.id)) with default gpt-4o.
Action Props / Inputs
components/openai/actions/analyze-image-content/analyze-image-content.mjs
Adds modelId prop bound to openai.responsesModelId; splits image input into separate filePath (format: "file-ref") and fileUrl props; retains/expands imageDetailLevel options.
Request Wiring
components/openai/actions/analyze-image-content/analyze-image-content.mjs
Replaces hardcoded model: "gpt-4o" with model: this.modelId in Responses API payload; includes detail: this.imageDetailLevel on input_image blocks for imageFileId, fileUrl, and uploaded filePath.
Response Parsing
components/openai/actions/analyze-image-content/analyze-image-content.mjs
Extracts first content object with text via run.output[0]?.content?.find(c => c.text); sets returnData.response from that text and pushes the content object into returnData.messages.
Action Metadata
components/openai/actions/analyze-image-content/analyze-image-content.mjs
Bumps action version from 1.1.1 → 1.2.0.

Version and Manifest Bumps

Layer / File(s) Summary
Action Version Bumps
components/openai/actions/*/*.mjs
Many action modules incremented their exported version fields (numerous patch bumps across actions).
Source Version Bumps
components/openai/sources/*/*.mjs
Several OpenAI event sources had exported version fields incremented.
Package Manifest
components/openai/package.json
Package version updated from 1.2.4 → 1.3.0.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • GTFalcao
  • luancazarine
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is minimal but references the related issue #20777; however, it lacks detailed information about the changes made and doesn't follow the template structure with proper sections and checklists. Expand the description to include a summary section explaining what was changed, and complete the provided template checklist to confirm versioning and code review status.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly describes the main change: adding support for configurable model selection in the analyze-image-content action.
Linked Issues check ✅ Passed The PR successfully implements the primary requirement from issue #20777: exposing model as a configurable prop with gpt-4o default. It also implements both optional enhancements: the detail parameter for image quality control and support for direct image_url input instead of always uploading via Files API.
Out of Scope Changes check ✅ Passed All changes are within scope: the analyze-image-content action was enhanced with configurable model/detail props, the openai app received the responsesModelId prop definition, and version numbers were uniformly bumped across all OpenAI components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-20777

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@michelle0927
michelle0927 marked this pull request as ready for review May 5, 2026 17:35

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 14e5014 and ae156cc.

📒 Files selected for processing (47)
  • components/openai/actions/analyze-image-content/analyze-image-content.mjs
  • components/openai/actions/cancel-run/cancel-run.mjs
  • components/openai/actions/chat-using-file-search/chat-using-file-search.mjs
  • components/openai/actions/chat-using-functions/chat-using-functions.mjs
  • components/openai/actions/chat-using-web-search/chat-using-web-search.mjs
  • components/openai/actions/chat-with-assistant/chat-with-assistant.mjs
  • components/openai/actions/chat-with-responses-api/chat-with-responses-api.mjs
  • components/openai/actions/chat/chat.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/create-vector-store-file/create-vector-store-file.mjs
  • components/openai/actions/create-vector-store/create-vector-store.mjs
  • components/openai/actions/delete-file/delete-file.mjs
  • components/openai/actions/delete-vector-store-file/delete-vector-store-file.mjs
  • components/openai/actions/delete-vector-store/delete-vector-store.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/list-vector-store-files/list-vector-store-files.mjs
  • components/openai/actions/list-vector-stores/list-vector-stores.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/retrieve-vector-store-file/retrieve-vector-store-file.mjs
  • components/openai/actions/retrieve-vector-store/retrieve-vector-store.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/openai.app.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

Comment thread components/openai/actions/chat/chat.mjs Resolved
Comment thread components/openai/package.json Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ebc859c and f1d03c3.

📒 Files selected for processing (1)
  • components/openai/actions/analyze-image-content/analyze-image-content.mjs

@GTFalcao GTFalcao left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mariano-pd mariano-pd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA testing successful ✅

Image

@michelle0927
michelle0927 merged commit b122fac into master May 11, 2026
7 checks passed
@michelle0927
michelle0927 deleted the issue-20777 branch May 11, 2026 16:44
e11man pushed a commit to RoboSourceTeam/pipedream that referenced this pull request May 15, 2026
…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>
michelle0927 added a commit that referenced this pull request Jun 2, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ACTION] openai-analyze-image-content: support configurable model (gpt-4.1, gpt-5, etc.)

3 participants