Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Mar 14, 2025

Summary by CodeRabbit

  • New Features

    • Added endpoints for retrieving and deleting custom language model connections.
    • Introduced an endpoint for creating encoders to expand integration capabilities.
  • Documentation

    • Enhanced API documentation for file uploads, now clarifying chunking strategies options.
    • Expanded parameter and response details for improved usability and error handling.

@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2025

Walkthrough

The changes update the API documentation in the openapi.yaml file. The file upload endpoint now explains two chunking strategies and includes a new 415 response for unsupported media types. New endpoints for managing large language models (GET and DELETE) have been added, alongside a POST endpoint for creating encoders. Additionally, new request schemas for encoder creation and an updated chunking strategy schema featuring a sentence-based approach have been introduced.

Changes

File Change Summary
src/.../openapi.yaml - Updated file upload endpoint description to clarify two chunking strategies and added a 415 error code.
- Added GET and DELETE endpoints for LLM management with associated parameters and response codes.
- Introduced a POST endpoint for encoder creation with new schemas and updated the ChunkingStrategy schema.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API_Server
    Client->>API_Server: POST /v2/corpora/{corpus_key}/upload_file<br/>(with chunking strategy)
    API_Server-->>Client: 200 OK or 415 Unsupported Media Type
Loading
sequenceDiagram
    participant Client
    participant API_Server
    Client->>API_Server: GET /v2/llms/{llm_id}
    API_Server-->>Client: 200 OK / 403 / 404
    Client->>API_Server: DELETE /v2/llms/{llm_id}
    API_Server-->>Client: Confirmation or error (403/404)
Loading
sequenceDiagram
    participant Client
    participant API_Server
    Client->>API_Server: POST /v2/encoders<br/>(with CreateEncoderRequest)
    API_Server-->>Client: 201 Created / 400 / 403
Loading

Poem

I'm a bunny who loves to code all day,
Hopping through endpoints in a playful way.
New LLM and encoder flows make me cheer,
With YAML tales that are crisp and clear.
Nibble on these changes with a joyful heart,
Hopping into progress—let’s make a fresh start! 🐇

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 719706d and 91cf481.

⛔ Files ignored due to path filters (30)
  • src/libs/Vectara/Generated/JsonConverters.ChunkingStrategy.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/JsonConverters.CreateEncoderRequest.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/JsonConverters.CreateEncoderRequestDiscriminatorType.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/JsonConverters.CreateEncoderRequestDiscriminatorTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.EncodersClient.CreateEncoder.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IEncodersClient.CreateEncoder.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.ILargeLanguageModelsClient.DeleteLLM.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.ILargeLanguageModelsClient.GetLLM.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IUploadClient.UploadFile.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.IUsersClient.ListUsers.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.LargeLanguageModelsClient.DeleteLLM.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.LargeLanguageModelsClient.GetLLM.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ChunkingStrategy.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.ChunkingStrategyDiscriminatorType.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CreateEncoderRequest.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CreateEncoderRequest.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CreateEncoderRequestDiscriminator.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CreateEncoderRequestDiscriminator.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CreateEncoderRequestDiscriminatorType.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CreateOpenAIEncoderRequest.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.CreateOpenAIEncoderRequest.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.Encoder.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.SentenceChunkingStrategy.Json.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.SentenceChunkingStrategy.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.StructuredDocument.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.Models.UploadFileRequest.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.UploadClient.UploadFile.g.cs is excluded by !**/generated/**
  • src/libs/Vectara/Generated/Vectara.UsersClient.ListUsers.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Vectara/openapi.yaml (10 hunks)
🔇 Additional comments (6)
src/libs/Vectara/openapi.yaml (6)

479-480: Enhanced File Upload Description with Chunking Options
The updated description now clearly explains the two available chunking strategies (sentence‐ and max‐chars–based) along with examples. This added detail improves usability and clarity for API users.


532-537: Addition of 415 Response for Unsupported Media Types
A new response code (415) has been added to handle unsupported media types during file upload. Please ensure that the referenced error schema (#/components/schemas/Error) is adequate to convey the error details to clients.


1035-1098: New LLM Management Endpoints Added
The pull request introduces two new endpoints for managing large language models: one for retrieving (GET) LLM details and another for deleting (DELETE) a custom LLM connection. Ensure that the llm_id parameter is consistently validated and that permissions for built-in versus custom LLMs are enforced appropriately.


1423-1456: New Encoder Creation Endpoint (POST /v2/encoders) Introduced
A new POST endpoint has been added under the Encoders section to allow creation of an encoder. The operationId, request body, and responses have been defined in line with the design. Double-check that any client integrations that depend on encoder creation are updated to call this endpoint correctly.


3167-3204: Addition of SentenceChunkingStrategy in ChunkingStrategy Schema
The schema for ChunkingStrategy now includes a new option—the SentenceChunkingStrategy—which creates one chunk per sentence, as reflected in the discriminator mapping. This change clearly documents the behavior when no custom strategy is specified. Verify that this option remains backward compatible and that all internal processing uses the expected defaults.


3988-4040: New Encoder Request Schemas for OpenAI-Compatible Encoders
The new CreateEncoderRequest and its specialized CreateOpenAIEncoderRequest have been added. They require important fields such as name, description, output_dimensions, endpoint_url, model, and auth. This change standardizes encoder creation for OpenAI–compatible endpoints. Please confirm that the external OpenAI integration will correctly handle these parameters and that client code is updated to use these new schemas.


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.

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 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.

@github-actions github-actions bot merged commit eb67c8f into main Mar 14, 2025
1 of 3 checks passed
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Update API docs: file upload chunking, LLM and encoder endpoints Mar 14, 2025
@HavenDV HavenDV deleted the bot/update-openapi_202503141829 branch March 14, 2025 19:57
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