Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented May 9, 2025

Summary by CodeRabbit

  • New Features
    • Introduced a new endpoint to list available hallucination correctors for detecting and correcting hallucinations in AI-generated content.
  • Enhancements
    • Added improved descriptions and documentation links for intelligent query rewriting features, now marked as "[Tech Preview]".
    • Added an experimental option for rerankers to use text with context for scoring.
  • Other
    • Minor formatting and descriptive improvements throughout the documentation.

@coderabbitai
Copy link

coderabbitai bot commented May 9, 2025

Walkthrough

The OpenAPI specification was updated to introduce a new /v2/hallucination_correctors GET endpoint for listing hallucination correctors, along with supporting schemas and a new tag. Descriptions for the intelligent_query_rewriting parameter were enhanced, and an experimental property was added to the CustomerSpecificReranker schema. Minor formatting improvements were also made.

Changes

File Change Summary
src/libs/Vectara/openapi.yaml Added /v2/hallucination_correctors GET endpoint, new schemas (HallucinationCorrector, ListHallucinationCorrectorsResponse), new tag, updated descriptions for intelligent_query_rewriting, added experimental_use_text_with_context to CustomerSpecificReranker, and made minor formatting adjustments.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API
    participant DB

    Client->>API: GET /v2/hallucination_correctors?filter=...&limit=...&page_key=...
    API->>DB: Query hallucination correctors (filter, pagination)
    DB-->>API: Return list of correctors + metadata
    API-->>Client: ListHallucinationCorrectorsResponse (correctors, metadata)
Loading

Poem

🐇
A hop, a skip, a YAML tweak,
Hallucination tools now at their peak!
Endpoints sprout and schemas grow,
Descriptions clearer, features show.
With context, rerankers leap ahead—
The OpenAPI garden, freshly fed!
🌱✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


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.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai 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:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @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

Documentation and Community

  • 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 12f2e88 into main May 9, 2025
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202505090155 branch May 9, 2025 01:56
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add /v2/hallucination_correctors GET endpoint and schema updates to OpenAPI May 9, 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

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

83-90: Consider pluralizing the parameter name for clarity.

The new corpus_id parameter accepts an array of IDs, but its singular name may be misleading. Consider renaming it to corpus_ids to clearly indicate multiple values are allowed and align with REST naming conventions.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c5d800 and 33a881f.

⛔ Files ignored due to path filters (26)
  • src/libs/Vectara/Generated/JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.ChatsClient.CreateChat.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.ChatsClient.CreateChatTurn.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.CorporaClient.ListCorpora.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.ListHallucinationCorrectors.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.HallucinationCorrectorsClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IChatsClient.CreateChat.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IChatsClient.CreateChatTurn.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.ICorporaClient.ListCorpora.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IHallucinationCorrectorsClient.ListHallucinationCorrectors.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IHallucinationCorrectorsClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IQueriesClient.Query.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IQueriesClient.QueryCorpus.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ChatRequest.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CreateChatCompletionRequest.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CustomerSpecificReranker.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.HallucinationCorrector.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.HallucinationCorrector.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ListHallucinationCorrectorsResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ListHallucinationCorrectorsResponse.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.QueryCorpusRequest.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.QueryRequest.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.QueriesClient.Query.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.QueriesClient.QueryCorpus.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 (10 hunks)
🔇 Additional comments (7)
src/libs/Vectara/openapi.yaml (7)

380-383: Approve enhanced documentation for intelligent_query_rewriting.

The description now clearly marks this feature as a Tech Preview and includes a link for more details.


3248-3250: Approve updated intelligent_query_rewriting description in QueryRequest.

The Tech Preview tag and documentation URL improve clarity for SDK users.


3289-3292: Approve updated intelligent_query_rewriting description in QueryCorpusRequest.

Consistent messaging across request schemas is beneficial.


3377-3380: Approve addition of experimental experimental_use_text_with_context.

This flag is clearly documented as experimental, with a sensible default.


4261-4262: Approve updated intelligent_query_rewriting description in ChatRequest.

The new description consistently marks this feature as a Tech Preview and provides a reference link.


5434-5435: Approve extended description for CreateChatCompletionRequest.

The updated description clarifies OpenAI compatibility and customization options.


5590-5592: Approve addition of Hallucination Correctors tag.

The new tag aligns with the added endpoint and provides clear grouping.

Comment on lines +1859 to +1906
/v2/hallucination_correctors:
get:
tags:
- Hallucination Correctors
summary: List hallucination correctors
description: 'Retrieves a list of available hallucination correctors used for detecting and correcting hallucinations in AI-generated content. This endpoint supports filtering by name or description, pagination, and metadata for navigating large result sets.'
operationId: listHallucinationCorrectors
parameters:
- $ref: '#/components/parameters/RequestTimeout'
- $ref: '#/components/parameters/RequestTimeoutMillis'
- name: filter
in: query
description: A regular expression applied to the name and description fields. Use this to return only hallucination correctors that match specific keywords or naming conventions.
schema:
type: string
- name: limit
in: query
description: The maximum number of hallucination correctors to return in the list. Defaults to 10. Range is between 1 and 100.
schema:
maximum: 100
minimum: 1
type: integer
format: int32
default: 10
- name: page_key
in: query
description: Retrieves the next page of hallucination correctors after reaching the limit.
schema:
type: string
responses:
'200':
description: List of hallucination correctors.
content:
application/json:
schema:
$ref: '#/components/schemas/ListHallucinationCorrectorsResponse'
'403':
description: Permissions do not allow listing hallucination correctors.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
x-fern-sdk-group-name: hallucination_correctors
x-fern-sdk-method-name: list
x-fern-pagination:
cursor: $request.page_key
next_cursor: $response.metadata.page_key
results: $response.hallucinationCorrectionModels
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix pagination mapping property name.

The x-fern-pagination.results is currently pointing to $response.hallucinationCorrectionModels, but the response schema uses hallucination_correctors as the array property. This mismatch will break SDK generation.

Apply this diff to correct the mapping:

 x-fern-pagination:
   cursor: $request.page_key
   next_cursor: $response.metadata.page_key
-  results: $response.hallucinationCorrectionModels
+  results: $response.hallucination_correctors
📝 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
/v2/hallucination_correctors:
get:
tags:
- Hallucination Correctors
summary: List hallucination correctors
description: 'Retrieves a list of available hallucination correctors used for detecting and correcting hallucinations in AI-generated content. This endpoint supports filtering by name or description, pagination, and metadata for navigating large result sets.'
operationId: listHallucinationCorrectors
parameters:
- $ref: '#/components/parameters/RequestTimeout'
- $ref: '#/components/parameters/RequestTimeoutMillis'
- name: filter
in: query
description: A regular expression applied to the name and description fields. Use this to return only hallucination correctors that match specific keywords or naming conventions.
schema:
type: string
- name: limit
in: query
description: The maximum number of hallucination correctors to return in the list. Defaults to 10. Range is between 1 and 100.
schema:
maximum: 100
minimum: 1
type: integer
format: int32
default: 10
- name: page_key
in: query
description: Retrieves the next page of hallucination correctors after reaching the limit.
schema:
type: string
responses:
'200':
description: List of hallucination correctors.
content:
application/json:
schema:
$ref: '#/components/schemas/ListHallucinationCorrectorsResponse'
'403':
description: Permissions do not allow listing hallucination correctors.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
x-fern-sdk-group-name: hallucination_correctors
x-fern-sdk-method-name: list
x-fern-pagination:
cursor: $request.page_key
next_cursor: $response.metadata.page_key
results: $response.hallucinationCorrectionModels
/v2/hallucination_correctors:
get:
tags:
- Hallucination Correctors
summary: List hallucination correctors
description: 'Retrieves a list of available hallucination correctors used for detecting and correcting hallucinations in AI-generated content. This endpoint supports filtering by name or description, pagination, and metadata for navigating large result sets.'
operationId: listHallucinationCorrectors
parameters:
- $ref: '#/components/parameters/RequestTimeout'
- $ref: '#/components/parameters/RequestTimeoutMillis'
- name: filter
in: query
description: A regular expression applied to the name and description fields. Use this to return only hallucination correctors that match specific keywords or naming conventions.
schema:
type: string
- name: limit
in: query
description: The maximum number of hallucination correctors to return in the list. Defaults to 10. Range is between 1 and 100.
schema:
maximum: 100
minimum: 1
type: integer
format: int32
default: 10
- name: page_key
in: query
description: Retrieves the next page of hallucination correctors after reaching the limit.
schema:
type: string
responses:
'200':
description: List of hallucination correctors.
content:
application/json:
schema:
$ref: '#/components/schemas/ListHallucinationCorrectorsResponse'
'403':
description: Permissions do not allow listing hallucination correctors.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
x-fern-sdk-group-name: hallucination_correctors
x-fern-sdk-method-name: list
x-fern-pagination:
cursor: $request.page_key
next_cursor: $response.metadata.page_key
results: $response.hallucination_correctors
🤖 Prompt for AI Agents (early access)
In src/libs/Vectara/openapi.yaml between lines 1859 and 1906, the pagination
mapping property name in the x-fern-pagination extension is incorrect. The
results field is currently set to $response.hallucinationCorrectionModels, but
the response schema uses hallucination_correctors as the array property. To fix
this, update the x-fern-pagination.results value to
$response.hallucination_correctors to match the response schema and ensure
correct SDK generation.

Comment on lines +4759 to +4783
type: object
properties:
id:
pattern: 'hcm_[0-9]+$'
type: string
description: The unique ID for the Hallucination Corrector (HC).
example: hcm_123
name:
type: string
description: 'The hallucination corrector name, typically including the base name and variant.'
example: qwen2.5-7b-instruct-hcm
type:
type: string
description: The hallucination corrector type. Defaults to `vectara`.
default: vectara
description:
type: string
description: A short description of the hallucination corrector’s purpose.
example: Qwen/Qwen2.5-7B-Instruct for hallucination correction in AI-generated text.
enabled:
type: boolean
description: Indicates whether the hallucination corrector is enabled and available for use in hallucination correction workflows.
example: true
description: A hallucination corrector that detects and corrects hallucinations in generated text.
ListHallucinationCorrectorsResponse:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add missing required fields to the HallucinationCorrector schema.

Without a required list, validation may not enforce necessary properties.

     HallucinationCorrector:
       type: object
+      required:
+        - id
+        - name
+        - type
+        - enabled
       properties:
         id:
           pattern: 'hcm_[0-9]+$'
📝 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
type: object
properties:
id:
pattern: 'hcm_[0-9]+$'
type: string
description: The unique ID for the Hallucination Corrector (HC).
example: hcm_123
name:
type: string
description: 'The hallucination corrector name, typically including the base name and variant.'
example: qwen2.5-7b-instruct-hcm
type:
type: string
description: The hallucination corrector type. Defaults to `vectara`.
default: vectara
description:
type: string
description: A short description of the hallucination corrector’s purpose.
example: Qwen/Qwen2.5-7B-Instruct for hallucination correction in AI-generated text.
enabled:
type: boolean
description: Indicates whether the hallucination corrector is enabled and available for use in hallucination correction workflows.
example: true
description: A hallucination corrector that detects and corrects hallucinations in generated text.
ListHallucinationCorrectorsResponse:
HallucinationCorrector:
type: object
required:
- id
- name
- type
- enabled
properties:
id:
pattern: 'hcm_[0-9]+$'
type: string
description: The unique ID for the Hallucination Corrector (HC).
example: hcm_123
name:
type: string
description: 'The hallucination corrector name, typically including the base name and variant.'
example: qwen2.5-7b-instruct-hcm
type:
type: string
description: The hallucination corrector type. Defaults to `vectara`.
default: vectara
description:
type: string
description: A short description of the hallucination corrector’s purpose.
example: Qwen/Qwen2.5-7B-Instruct for hallucination correction in AI-generated text.
enabled:
type: boolean
description: Indicates whether the hallucination corrector is enabled and available for use in hallucination correction workflows.
example: true
description: A hallucination corrector that detects and corrects hallucinations in generated text.
🤖 Prompt for AI Agents (early access)
In src/libs/Vectara/openapi.yaml around lines 4759 to 4783, the
HallucinationCorrector schema lacks a `required` field list, which means
validation won't enforce the presence of essential properties. Add a `required`
array specifying the mandatory properties such as `id`, `name`, `type`, and
`enabled` to ensure these fields must be present in any valid object of this
schema.

Comment on lines +4784 to 4794
type: object
properties:
hallucination_correctors:
type: array
items:
$ref: '#/components/schemas/HallucinationCorrector'
description: An array of hallucination correctors that match the request parameters.
metadata:
$ref: '#/components/schemas/ListMetadata'
description: Response containing a list of hallucination correctors.
Job:
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Declare required fields in ListHallucinationCorrectorsResponse.

Ensuring hallucination_correctors and metadata are required improves schema correctness.

     ListHallucinationCorrectorsResponse:
       type: object
+      required:
+        - hallucination_correctors
+        - metadata
       properties:
         hallucination_correctors:
           type: array
📝 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
type: object
properties:
hallucination_correctors:
type: array
items:
$ref: '#/components/schemas/HallucinationCorrector'
description: An array of hallucination correctors that match the request parameters.
metadata:
$ref: '#/components/schemas/ListMetadata'
description: Response containing a list of hallucination correctors.
Job:
ListHallucinationCorrectorsResponse:
type: object
required:
- hallucination_correctors
- metadata
properties:
hallucination_correctors:
type: array
items:
$ref: '#/components/schemas/HallucinationCorrector'
description: An array of hallucination correctors that match the request parameters.
metadata:
$ref: '#/components/schemas/ListMetadata'
description: Response containing a list of hallucination correctors.
🤖 Prompt for AI Agents (early access)
In src/libs/Vectara/openapi.yaml around lines 4784 to 4794, the
ListHallucinationCorrectorsResponse schema lacks a required field declaration
for hallucination_correctors and metadata. Add a required section listing these
two properties to ensure they are mandatory in the response schema, improving
schema correctness and 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