Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 15, 2025

Summary by CodeRabbit

  • New Features

    • Embedding endpoints now accept WEBP and GIF images, in addition to JPEG and PNG.
    • Backwards-compatible; existing integrations continue to function without changes. One image per call remains supported.
  • Documentation

    • API documentation updated to list the expanded image formats and clarify allowed data URI types across affected endpoints.

@coderabbitai
Copy link

coderabbitai bot commented Sep 15, 2025

Walkthrough

Updated two OpenAPI path descriptions in src/libs/Cohere/openapi.yaml to expand allowed data URI image formats for embedding from image/jpeg and image/png to also include image/webp and image/gif. No schema or signature changes; per-call image limit and other notes remain unchanged.

Changes

Cohort / File(s) Summary
OpenAPI documentation updates
src/libs/Cohere/openapi.yaml
Expanded allowed image MIME types in two endpoint descriptions to include image/webp and image/gif alongside image/jpeg and image/png; no structural/spec changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

A rabbit taps the spec with care,
“Add webp, gif—now users share!”
The endpoints nod, the docs align,
Four flavors hop into the line.
With JPEG, PNG in the mix,
Our burrow’s API is picture-fixed. 🐇🖼️

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "feat:@coderabbitai" is vague and does not describe the main change in this PR (which updates OpenAPI descriptions to expand allowed image formats for embedding endpoints). Because it fails to convey the primary change, the title is inconclusive as a summary for reviewers scanning the history. Please update the title to a concise, descriptive summary of the primary change (for example: "docs(openapi): allow webp and gif image formats for embedding endpoints" or "feat: expand allowed image formats in embedding OpenAPI paths"); this will make the PR intent clear to reviewers.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202509151522

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

@HavenDV HavenDV enabled auto-merge (squash) September 15, 2025 15:23
@HavenDV HavenDV merged commit 111c2a6 into main Sep 15, 2025
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202509151522 branch September 15, 2025 15:25
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Update openapi.yaml to allow webp and gif for image embeddings Sep 15, 2025
Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
src/libs/Cohere/openapi.yaml (1)

8868-8868: Keep wording consistent across endpoints; same schema enforcement applies.

  • Mirror the clarified size wording used above.
  • Consider deduplicating this description via a shared component to avoid drift.

Apply this minimal description tweak:

-                  description: "An array of image data URIs for the model to embed. Maximum number of images per call is `1`.\n\nThe image must be a valid [data URI](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data). The image must be in either `image/jpeg`, `image/png`, `image/webp`, or `image/gif` format and has a maximum size of 5MB.\n\nImage embeddings are supported with Embed v3.0 and newer models."
+                  description: "An array of image data URIs for the model to embed. Maximum number of images per call is `1`.\n\nThe image must be a valid [data URI](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data). The image must be in either `image/jpeg`, `image/png`, `image/webp`, or `image/gif` format and must be no more than 5MB after decoding (before base64).\n\nImage embeddings are supported with Embed v3.0 and newer models."

If helpful, I can extract a Components schema (e.g., components.schemas.EmbedImageDataUri) and wire both sites to it.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4acce73 and 73ea92d.

⛔ Files ignored due to path filters (6)
  • src/libs/Cohere/Generated/Cohere.CohereClient.Embed.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.CohereClient.Embedv2.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ICohereClient.Embed.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ICohereClient.Embedv2.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.EmbedRequest.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.Embedv2Request.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Cohere/openapi.yaml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test / Build, test and publish

x-fern-audiences:
- public
description: "An array of image data URIs for the model to embed. Maximum number of images per call is `1`.\n\nThe image must be a valid [data URI](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data). The image must be in either `image/jpeg` or `image/png` format and has a maximum size of 5MB.\n\nImages are only supported with Embed v3.0 and newer models."
description: "An array of image data URIs for the model to embed. Maximum number of images per call is `1`.\n\nThe image must be a valid [data URI](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data). The image must be in either `image/jpeg`, `image/png`, `image/webp`, or `image/gif` format and has a maximum size of 5MB.\n\nImages are only supported with Embed v3.0 and newer models."
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Clarify size semantics and enforce via schema (not only description).

  • The 5MB limit is ambiguous for data URIs. Recommend clarifying “after decoding (before base64)”.
  • Also add maxItems: 1 and (optionally) a data-URI pattern for allowed MIME types so tooling enforces constraints.

Apply this minimal description tweak:

-                  description: "An array of image data URIs for the model to embed. Maximum number of images per call is `1`.\n\nThe image must be a valid [data URI](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data). The image must be in either `image/jpeg`, `image/png`, `image/webp`, or `image/gif` format and has a maximum size of 5MB.\n\nImages are only supported with Embed v3.0 and newer models."
+                  description: "An array of image data URIs for the model to embed. Maximum number of images per call is `1`.\n\nThe image must be a valid [data URI](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data). The image must be in either `image/jpeg`, `image/png`, `image/webp`, or `image/gif` format and must be no more than 5MB after decoding (before base64).\n\nImages are only supported with Embed v3.0 and newer models."

Schema hardening (outside this line) for the same property:

type: array
maxItems: 1
items:
  type: string
  pattern: '^data:(image/(jpeg|png|webp|gif));base64,[A-Za-z0-9+/=]+$'

Verification script to catch remaining places that still list only jpeg/png:


🏁 Script executed:

#!/bin/bash
rg -n -C2 -e 'image/jpeg.*image/png(?!.*webp)(?!.*gif)' src/libs/Cohere/openapi.yaml

Length of output: 119


🏁 Script executed:

#!/bin/bash
set -euo pipefail
file="src/libs/Cohere/openapi.yaml"
if [ ! -f "$file" ]; then
  echo "MISSING_FILE:$file"
  exit 0
fi

echo "FILE: $file"
echo
echo "=== occurrences of image MIME types (context -2 lines) ==="
rg -n -C2 -S 'image/(jpeg|png|webp|gif)' "$file" || true

echo
echo "=== lines mentioning data URI or data URI docs (context -2 lines) ==="
rg -n -C2 -S 'data URI|data-uri|dataURI|data:(image' "$file" || true

echo
echo "=== YAML blocks (paragraph mode) containing both jpeg and png but NOT webp/gif (heuristic) ==="
awk 'BEGIN{RS=""; ORS="\n\n"} /image\/jpeg/ && /image\/png/ && !/image\/webp/ && !/image\/gif/ {print "BLOCK:\n"$0}' "$file" || true

echo
echo "=== lines mentioning '5MB' or 'Maximum size' (context -2 lines) ==="
rg -n -C2 -S '5MB|5 MB|Maximum size' "$file" || true

Length of output: 47072


Clarify image size semantics and add schema constraints in src/libs/Cohere/openapi.yaml

Two description blocks still state "maximum size of 5MB" — change wording to clarify decoding semantics and add schema constraints. Locations: src/libs/Cohere/openapi.yaml lines 2168 and 8868.

Apply this minimal description tweak:

-                  description: "An array of image data URIs for the model to embed. Maximum number of images per call is `1`.\n\nThe image must be a valid [data URI](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data). The image must be in either `image/jpeg`, `image/png`, `image/webp`, or `image/gif` format and has a maximum size of 5MB.\n\nImages are only supported with Embed v3.0 and newer models."
+                  description: "An array of image data URIs for the model to embed. Maximum number of images per call is `1`.\n\nThe image must be a valid [data URI](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data). The image must be in either `image/jpeg`, `image/png`, `image/webp`, or `image/gif` format and must be no more than 5MB after decoding (before base64).\n\nImages are only supported with Embed v3.0 and newer models."

Schema hardening (apply to the same property):

type: array
maxItems: 1
items:
  type: string
  pattern: '^data:(image/(jpeg|png|webp|gif));base64,[A-Za-z0-9+/=]+$'
🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 2168 and 8868, change the
description text that currently says "maximum size of 5MB" to clarify that the
5MB limit applies to the decoded image bytes (i.e., after base64 decoding), and
harden the schema for that property so it is an array with a single item allowed
(maxItems: 1), where the item is a string and must match a data URI for an image
(i.e., begins with "data:image/" followed by one of jpeg, png, webp, or gif,
then ";base64," and only base64 characters). Ensure the schema enforces
type=array, maxItems=1, items.type=string and a regex pattern that matches
"data:image/(jpeg|png|webp|gif);base64,<base64 chars>" while updating the
description text accordingly.

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.

2 participants