Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Aug 28, 2025

Summary by CodeRabbit

  • New Features

    • Image support in documents and search results, including embedded images and image metadata.
    • New endpoint to fetch a specific image from a document.
    • Metadata-based fuzzy query endpoint with scored results.
  • Chores

    • Expanded roles/permissions to include corpus- and agent-scoped roles; user management updated accordingly.
    • Increased max query length to 5000 characters and added history_id filtering across query/history endpoints.
    • Renamed pagination field for hallucination tools.
    • Removed explicit API key-type constraints in select endpoints.
  • Documentation

    • Added Agents and Agent Connectors tags and updated descriptions to reflect new capabilities.

@coderabbitai
Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

The OpenAPI spec was updated to add image schemas and document image references, introduce image retrieval and metadata query endpoints, expand roles and user role assignments, increase query length limits, adjust history filters, rename hallucination corrector pagination fields, add agent-related tags, and remove select API-key-type constraints.

Changes

Cohort / File(s) Summary
Image schemas and document integration
src/libs/Vectara/openapi.yaml
Added ImageMetadata, ImageData, Image. Document, CoreDocument, StructuredDocument, StructuredDocumentSection updated to include images; CoreDocumentPart now links via image_id. Examples updated; search results may include image metadata.
New endpoints: image fetch and metadata query
src/libs/Vectara/openapi.yaml
Added GET /v2/corpora/{corpus_key}/documents/{document_id}/images/{image_id}. Added POST /v2/corpora/{corpus_key}/metadata_query with request/response schemas (FieldQuery, MetadataQueryRequest/Response, ScoredDocument).
Query limits and history filters
src/libs/Vectara/openapi.yaml
Increased query maxLength to 5000 across QueryRequest, KeyedSearchCorpus, QueryCorpusRequest, QueryHistorySummary, ChatRequest, Turn. Added history_id filtering in list/query history responses.
Roles and user model expansion
src/libs/Vectara/openapi.yaml
ApiRole extended (corpus_developer, agent_administrator, agent_viewer, agent_developer). Added CorpusRole and AgentRole. User, CreateUserRequest, UpdateUserRequest now include corpus_roles and agent_roles; descriptions updated.
Hallucination corrector pagination rename
src/libs/Vectara/openapi.yaml
Renamed pagination list field from hallucination_correctors to hallucinationCorrectionModels.
Tags and taxonomy
src/libs/Vectara/openapi.yaml
Added top-level tags: Agents, Agent Connectors; descriptions updated accordingly.
Security constraints adjustments
src/libs/Vectara/openapi.yaml
Removed x-required-api-key-type blocks from select endpoints.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant C as Client
    participant S as API Server
    participant DS as Document Store
    participant IS as Image Store

    rect rgba(230,245,255,0.5)
    note over C,S: Retrieve embedded image by ID (new)
    C->>S: GET /v2/corpora/{corpus}/documents/{doc}/images/{image}
    S->>DS: Validate corpus/doc access
    alt Authorized
        S->>IS: Fetch Image (id, mime_type, data)
        IS-->>S: Image
        S-->>C: 200 Image (base64 data, MIME)
    else Forbidden
        S-->>C: 403
    else Not Found
        S-->>C: 404
    end
    end
Loading
sequenceDiagram
    autonumber
    participant C as Client
    participant S as API Server
    participant IQ as Index/Query Engine
    participant MD as Metadata Filter

    rect rgba(240,255,240,0.5)
    note over C,S: Metadata fuzzy query (new)
    C->>S: POST /v2/corpora/{corpus}/metadata_query<br/>MetadataQueryRequest(queries[], level, filter, limit, offset)
    S->>MD: Build metadata predicates from FieldQuery[]
    S->>IQ: Execute metadata-level search
    IQ-->>S: ScoredDocument[] + total_count
    S-->>C: 200 MetadataQueryResponse
    end
Loading
sequenceDiagram
    autonumber
    participant C as Client
    participant S as API Server
    participant QE as Query Engine
    participant RS as Result Serializer
    participant IS as Image Store

    rect rgba(255,248,230,0.5)
    note over C,S: Query with images in results (modified)
    C->>S: POST /query (query up to 5000 chars)
    S->>QE: Execute search
    QE-->>S: Results (+ optional image_id per part)
    S->>IS: Resolve image metadata for results
    IS-->>S: ImageMetadata[]
    S->>RS: Assemble IndividualSearchResult with image metadata
    S-->>C: 200 Results (text + optional image)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I nibble specs with whiskered cheer,
New images hop into results so clear.
Roles multiply, agents align,
Queries grow long—yet look so fine.
I thump approval on the ground—
Metadata sings, corrections rebound.
Carrot-shaped endpoints all around! 🥕✨

✨ 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_202508280150

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@HavenDV HavenDV merged commit bd8ef8d into main Aug 28, 2025
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202508280150 branch August 28, 2025 01:51
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Update OpenAPI: image schemas/endpoints, roles, query limits, filters Aug 28, 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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
src/libs/Vectara/openapi.yaml (4)

3538-3543: Pagination results key mismatch breaks codegen.

x-fern-pagination.results references $response.hallucinationCorrectionModels, but the schema returns hallucination_correctors (see ListHallucinationCorrectorsResponse). This will yield empty pages.

-        results: $response.hallucinationCorrectionModels
+        results: $response.hallucination_correctors

1240-1249: Incorrect corpus_key examples (values are queries, not keys).

Use actual corpus keys to prevent SDK docs confusion.

-            Finance_risk_analysis:
-              summary: Risk metrics query in finance
-              value: Explain changes in VaR metrics over Q1
-            Legal_terms_summary:
-              summary: Indemnification clause interpretation
-              value: Explain the indemnification clause
-            Support_kb:
-              summary: Internal support KB lookup
-              value: Steps to reset 2FA for legacy login system
+            Finance_risk_analysis:
+              summary: Finance corpus key
+              value: fin_esg_docs
+            Legal_terms_summary:
+              summary: Legal corpus key
+              value: legal_ip_cases
+            Support_kb:
+              summary: Support corpus key
+              value: support_web_portal

4760-4765: Metadata example has malformed keys/values.

Stray quote and unquoted string value will invalidate example rendering.

-          example:
-            department: engineering
-            doc_type": architecture_diagram
+          example:
+            department: engineering
+            doc_type: architecture_diagram

4779-4782: Malformed example under UploadFileRequest.example.

Keys have trailing quotes; values should be strings.

-        metadata:
-          department": engineering
-          doc_type": architecture_diagram
+        metadata:
+          department: engineering
+          doc_type: architecture_diagram
🧹 Nitpick comments (5)
src/libs/Vectara/openapi.yaml (5)

3126-3131: Copy change: wrong resource in error description.

“listing summarizers” should be “listing LLMs”.

-          description: Permissions do not allow listing summarizers.
+          description: Permissions do not allow listing LLMs.

5423-5426: Minor grammar fix in streaming descriptions.

“Then end of …” → “The end of …”.

-          description: Then end of generation will be denoted with an object with the type `generation_end`.
+          description: The end of generation will be denoted with an object with the type `generation_end`.
-          description: Then end of stream will be denoted with an object with the type `end`.
+          description: The end of stream will be denoted with an object with the type `end`.

Also applies to: 5451-5455


5444-5448: Unknown x-vectaraParents reference.

AgentStreamedResponse is referenced but no such schema exists. Either add it or drop the reference to avoid generator warnings.

-      x-vectaraParents:
-        - QueryStreamedResponse
-        - ChatStreamedResponse
-        - SummarizeDocumentStreamedResponse
-        - AgentStreamedResponse
+      x-vectaraParents:
+        - QueryStreamedResponse
+        - ChatStreamedResponse
+        - SummarizeDocumentStreamedResponse
-      x-vectaraParents:
-        - QueryStreamedResponse
-        - ChatStreamedResponse
-        - SummarizeDocumentStreamedResponse
-        - AgentStreamedResponse
+      x-vectaraParents:
+        - QueryStreamedResponse
+        - ChatStreamedResponse
+        - SummarizeDocumentStreamedResponse

Also applies to: 5457-5461


6786-6789: Typo in description (“precofnigured”).

-          description: 'Name to reference the LLM.  This will be used in other endpoints (like query) when using this LLM. If this name conflicts with a global LLM (a LLM that is precofnigured with the Vectara platform), then it will override that LLM for all usages.'
+          description: 'Name to reference the LLM. This will be used in other endpoints (like query) when using this LLM. If this name conflicts with a global LLM (an LLM that is preconfigured with the Vectara platform), then it will override that LLM for all usages.'

7753-7753: Add trailing newline.

YAMLlint reports “no new line character at the end of file”.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b5033a6 and 656be6d.

⛔ Files ignored due to path filters (62)
  • src/libs/Vectara/Generated/Vectara..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.AgentConnectorsClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.AgentsClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.DocumentsClient.GetImage.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IAgentConnectorsClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IAgentsClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IDocumentsClient.GetImage.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IInstructionsClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IMetadataQueryClient.QueryMetadata.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IMetadataQueryClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IQueryHistoryClient.GetQueryHistories.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IToolsClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IUsersClient.CreateUser.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IUsersClient.UpdateUser.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.InstructionsClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.JsonConverters.AgentRoleRole.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.JsonConverters.AgentRoleRoleNullable.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.JsonConverters.CorpusRoleRole.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.JsonConverters.CorpusRoleRoleNullable.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.JsonConverters.MetadataQueryRequestLevel.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.JsonConverters.MetadataQueryRequestLevelNullable.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.MetadataQueryClient.QueryMetadata.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.MetadataQueryClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.AgentRole.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.AgentRole.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.AgentRoleRole.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ApiRole.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CoreDocument.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CoreDocumentPart.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CorpusRole.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CorpusRole.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CorpusRoleRole.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CreateUserRequest.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.Document.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.FieldQuery.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.FieldQuery.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.Image.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.Image.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ImageData.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ImageData.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ImageMetadata.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ImageMetadata.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.IndividualSearchResult.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequest.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequest.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.MetadataQueryRequestLevel.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.MetadataQueryResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.MetadataQueryResponse.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ScoredDocument.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ScoredDocument.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ScoredDocumentMetadata.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ScoredDocumentMetadata.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.StructuredDocumentSection.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.UpdateUserRequest.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.User.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.QueryHistoryClient.GetQueryHistories.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.ToolsClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.UsersClient.CreateUser.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.UsersClient.UpdateUser.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.VectaraClient.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Vectara/openapi.yaml (29 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
src/libs/Vectara/openapi.yaml

[error] 7753-7753: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (1)
src/libs/Vectara/openapi.yaml (1)

5630-5631: LGTM: image pointer added to search results.

Adding image: ImageMetadata to IndividualSearchResult is consistent with Document.images and the new image retrieval endpoint.

Comment on lines +1119 to +1175
get:
tags:
- Documents
summary: Retrieve an image from a document
description: Returns a specific image that is embedded within a document. The `image_id` uniquely identifies the image within the document. Use this endpoint to fetch the raw image data and associated metadata.
operationId: getImage
parameters:
- $ref: '#/components/parameters/RequestTimeout'
- $ref: '#/components/parameters/RequestTimeoutMillis'
- name: corpus_key
in: path
description: A unique identifier for the corpus that contains the target document.
required: true
schema:
$ref: '#/components/schemas/CorpusKey'
- name: document_id
in: path
description: The identifier of the document containing the image. This `document_id` must be percent encoded.
required: true
schema:
type: string
- name: image_id
in: path
description: The identifier of the image to retrieve from the specified document. Each image within a document has a unique `image_id`. This value must be percent-encoded when passed in the request URL.
required: true
schema:
type: string
responses:
'200':
description: An image including raw image data and associated metadata.
content:
application/json:
schema:
$ref: '#/components/schemas/Image'
example:
id: image_1
title: Quarterly Sales Performance
caption: Sales growth trends for Q1 to Q4 of 2024
description: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%'
image_data:
data: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4//8/AAX+Av4N70a4AAAAAElFTkSuQmCC
mime_type: image/png
'403':
description: Permissions do not allow retrieving the image.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Image not found.
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
x-fern-sdk-group-name: documents
x-fern-sdk-method-name: get
'/v2/corpora/{corpus_key}/metadata_query':
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid SDK method-name collision in "documents" group.

This endpoint uses x-fern-sdk-method-name: get, which already exists for GET /v2/corpora/{corpus_key}/documents/{document_id}. Rename to avoid client generation conflicts.

-      x-fern-sdk-method-name: get
+      x-fern-sdk-method-name: getImage
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
get:
tags:
- Documents
summary: Retrieve an image from a document
description: Returns a specific image that is embedded within a document. The `image_id` uniquely identifies the image within the document. Use this endpoint to fetch the raw image data and associated metadata.
operationId: getImage
parameters:
- $ref: '#/components/parameters/RequestTimeout'
- $ref: '#/components/parameters/RequestTimeoutMillis'
- name: corpus_key
in: path
description: A unique identifier for the corpus that contains the target document.
required: true
schema:
$ref: '#/components/schemas/CorpusKey'
- name: document_id
in: path
description: The identifier of the document containing the image. This `document_id` must be percent encoded.
required: true
schema:
type: string
- name: image_id
in: path
description: The identifier of the image to retrieve from the specified document. Each image within a document has a unique `image_id`. This value must be percent-encoded when passed in the request URL.
required: true
schema:
type: string
responses:
'200':
description: An image including raw image data and associated metadata.
content:
application/json:
schema:
$ref: '#/components/schemas/Image'
example:
id: image_1
title: Quarterly Sales Performance
caption: Sales growth trends for Q1 to Q4 of 2024
description: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%'
image_data:
data: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4//8/AAX+Av4N70a4AAAAAElFTkSuQmCC
mime_type: image/png
'403':
description: Permissions do not allow retrieving the image.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Image not found.
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
x-fern-sdk-group-name: documents
x-fern-sdk-method-name: get
'/v2/corpora/{corpus_key}/metadata_query':
get:
tags:
- Documents
summary: Retrieve an image from a document
description: Returns a specific image that is embedded within a document. The `image_id` uniquely identifies the image within the document. Use this endpoint to fetch the raw image data and associated metadata.
operationId: getImage
parameters:
- $ref: '#/components/parameters/RequestTimeout'
- $ref: '#/components/parameters/RequestTimeoutMillis'
- name: corpus_key
in: path
description: A unique identifier for the corpus that contains the target document.
required: true
schema:
$ref: '#/components/schemas/CorpusKey'
- name: document_id
in: path
description: The identifier of the document containing the image. This `document_id` must be percent encoded.
required: true
schema:
type: string
- name: image_id
in: path
description: The identifier of the image to retrieve from the specified document. Each image within a document has a unique `image_id`. This value must be percent-encoded when passed in the request URL.
required: true
schema:
type: string
responses:
'200':
description: An image including raw image data and associated metadata.
content:
application/json:
schema:
$ref: '#/components/schemas/Image'
example:
id: image_1
title: Quarterly Sales Performance
caption: Sales growth trends for Q1 to Q4 of 2024
description: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%'
image_data:
data: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4//8/AAX+Av4N70a4AAAAAElFTkSuQmCC
mime_type: image/png
'403':
description: Permissions do not allow retrieving the image.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Image not found.
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
x-fern-sdk-group-name: documents
x-fern-sdk-method-name: getImage
'/v2/corpora/{corpus_key}/metadata_query':
🤖 Prompt for AI Agents
In src/libs/Vectara/openapi.yaml around lines 1119 to 1175 the
x-fern-sdk-method-name for the GET
/v2/corpora/{corpus_key}/documents/{document_id}/images/{image_id} endpoint is
set to "get", colliding with the existing documents.get method; change
x-fern-sdk-method-name to a unique identifier such as "getImage" (or
"getDocumentImage") to avoid client generation conflicts, and ensure the new
name is applied consistently in that operation object while leaving
x-fern-sdk-group-name: documents unchanged.

Comment on lines +4860 to +4886
required:
- id
- image_data
- mime_type
type: object
properties:
id:
type: string
description: 'The unique identifier of the image within the document, used to reference it in related content.'
example: chart_1
title:
type: string
description: 'A short, human-readable title for the image, often displayed above or alongside it.'
example: Quarterly Sales Performance
caption:
type: string
description: 'A brief caption providing context or an explanation for the image, typically displayed below it.'
example: Sales growth trends for Q1 to Q4 of 2024
description:
type: string
description: 'A longer, detailed description of the image for accessibility or additional context.'
example: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%'
mime_type:
type: string
description: 'The MIME type of the image, indicating the format of the binary data (e.g., image/jpeg for JPEG images).'
example: image/jpeg
description: 'An image element within a document, containing its identifying information and optional metadata.'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

ImageMetadata requires a non-existent property.

ImageMetadata.required includes image_data, but no such property exists on this schema (binary lives on Image/ImageData). This violates the schema.

-      required:
-        - id
-        - image_data
-        - mime_type
+      required:
+        - id
+        - mime_type
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
required:
- id
- image_data
- mime_type
type: object
properties:
id:
type: string
description: 'The unique identifier of the image within the document, used to reference it in related content.'
example: chart_1
title:
type: string
description: 'A short, human-readable title for the image, often displayed above or alongside it.'
example: Quarterly Sales Performance
caption:
type: string
description: 'A brief caption providing context or an explanation for the image, typically displayed below it.'
example: Sales growth trends for Q1 to Q4 of 2024
description:
type: string
description: 'A longer, detailed description of the image for accessibility or additional context.'
example: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%'
mime_type:
type: string
description: 'The MIME type of the image, indicating the format of the binary data (e.g., image/jpeg for JPEG images).'
example: image/jpeg
description: 'An image element within a document, containing its identifying information and optional metadata.'
required:
- id
- mime_type
type: object
properties:
id:
type: string
description: 'The unique identifier of the image within the document, used to reference it in related content.'
example: chart_1
title:
type: string
description: 'A short, human-readable title for the image, often displayed above or alongside it.'
example: Quarterly Sales Performance
caption:
type: string
description: 'A brief caption providing context or an explanation for the image, typically displayed below it.'
example: Sales growth trends for Q1 to Q4 of 2024
description:
type: string
description: 'A longer, detailed description of the image for accessibility or additional context.'
example: 'A bar chart showing quarterly sales growth, with Q4 outperforming all previous quarters by 15%'
mime_type:
type: string
description: 'The MIME type of the image, indicating the format of the binary data (e.g., image/jpeg for JPEG images).'
example: image/jpeg
description: 'An image element within a document, containing its identifying information and optional metadata.'
🤖 Prompt for AI Agents
In src/libs/Vectara/openapi.yaml around lines 4860 to 4886, the ImageMetadata
schema lists image_data in required but the schema does not define image_data
(the binary is defined elsewhere on Image/ImageData); remove image_data from the
required array or add a proper image_data property that references the existing
ImageData schema (e.g., $ref to the ImageData component) so the required list
matches defined properties; prefer removing image_data from required if metadata
should not include binary data, or otherwise add the correct property
definition/reference and update examples accordingly.

Comment on lines +7373 to +7379
enum:
- agent_admin
- agent_viewer
- agent_developer
type: string
description: The role assigned for this specific agent.
description: Agent-specific role assignment.
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Agent role naming inconsistency (admin vs administrator).

ApiRole uses agent_administrator while AgentRole enum uses agent_admin. Align to one spelling to avoid confusion and mismatched validation.

-            - agent_admin
+            - agent_administrator
🤖 Prompt for AI Agents
In src/libs/Vectara/openapi.yaml around lines 7373-7379, the AgentRole enum uses
"agent_admin" while ApiRole elsewhere uses "agent_administrator", causing
inconsistent validation; pick one canonical spelling (recommend coordinating
with existing ApiRole and change the enum to "agent_administrator" or
alternatively change ApiRole to "agent_admin"), then update the enum entry here
to match exactly, and search/replace all occurrences across the OpenAPI file and
codebase (schemas, validators, docs, tests) to keep them consistent and pass
schema validation.

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