Skip to content

Conversation

HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 20, 2025

Summary by CodeRabbit

  • New Features
    • Introduced Assistant management APIs (create, update, run).
    • Added MCP tool discovery endpoint.
    • Enabled fetching a vector store by ID.
  • Enhancements
    • Expanded Assistant capabilities: requirements, budget levels, visibility, assistant type, and response language (with unset/default support).
    • Unified tool system with support for HTTP, MCP, file search, and web search resources.
    • Added run optimization options (cost, latency).
    • Improved run results with structured error reporting.

Copy link

coderabbitai bot commented Sep 20, 2025

Walkthrough

Adds new OpenAPI paths for assistants (create, modify, run), MCP tool discovery, and vector store retrieval. Overhauls tool and resource schemas with discriminator-based ToolDefinition and specialized ToolResource types. Extends Assistant and Maestro run schemas with new enums and fields. All changes occur within src/libs/AI21/openapi.yaml.

Changes

Cohort / File(s) Summary
Assistant endpoints
src/libs/AI21/openapi.yaml
Added POST /studio/v1/assistants, PATCH /studio/v1/assistants/{assistant_id}, POST /studio/v1/assistants/{assistant_id}/run; introduced CreateAssistantRequest, ModifyAssistantRequest, RunAssistantRequest; Assistant schema expanded (requirements, budget, visibility, assistant_type, response_language).
MCP discovery
src/libs/AI21/openapi.yaml
Added POST /studio/v1/mcp/discover with MCPDefinition -> MCPDiscoveryResponse; introduced MCPTool, MCPToolResource schemas.
Tool system refactor
src/libs/AI21/openapi.yaml
Replaced AssistantTool with language_studio_api_server__data_types__execution_engine__ToolDefinition (discriminator-based); renamed ToolResources -> ToolResource; added HTTPToolResource, MCPToolResource, FileSearchToolResource, WebSearchToolResource; added HTTPToolEndpoint/Function/FunctionParameters.
Maestro run updates
src/libs/AI21/openapi.yaml
MaestroRunResult extended with error (MaestroRunError); RunAssistantRequest and CreateMaestroRunsPayload updated (ToolDefinition, ToolResource, Requirement, response_language unset support).
Enums and requirements
src/libs/AI21/openapi.yaml
New enums: AssistantType, BudgetLevel, Visibility, RunOptimization; new Requirement schemas under execution_engine and assistant namespaces.
Vector store retrieval
src/libs/AI21/openapi.yaml
Added GET /studio/v1/demos/regulations/vector-store/{vector_store_id} returning vector store object; includes 422 Validation Error.
Payload alignments
src/libs/AI21/openapi.yaml
Updated CreateOrganizationSchemaRequest, CreatePlanPayload, UpdateRoutePayload, route/plan-related payloads to use new ToolDefinition/Requirement references; various collection/response schemas expanded accordingly.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant API as Studio API
  participant Assist as Assistants Service
  participant Exec as Execution Engine

  rect rgba(230,245,255,0.6)
  note over Client,API: Create Assistant
  Client->>API: POST /studio/v1/assistants (CreateAssistantRequest)
  API->>Assist: CreateAssistantRequest
  Assist-->>API: Assistant
  API-->>Client: 200 Assistant | 422
  end

  rect rgba(235,255,235,0.6)
  note over Client,Exec: Run Assistant
  Client->>API: POST /studio/v1/assistants/{id}/run (RunAssistantRequest)
  API->>Assist: Resolve Assistant + tools/requirements
  Assist->>Exec: Start run with ToolDefinition/ToolResource
  Exec-->>Assist: MaestroRunResult (success or error)
  Assist-->>API: MaestroRunResult
  API-->>Client: 200 MaestroRunResult (may include error)
  end
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as Studio API
  participant MCP as MCP Discovery

  rect rgba(255,245,230,0.6)
  note over Client,MCP: MCP Tool Discovery
  Client->>API: POST /studio/v1/mcp/discover (MCPDefinition)
  API->>MCP: Discover tools
  MCP-->>API: MCPDiscoveryResponse (tools, definition)
  API-->>Client: 200 MCPDiscoveryResponse | 422
  end
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as Studio API
  participant VS as Vector Store

  note over Client,VS: Fetch Vector Store by ID
  Client->>API: GET /studio/v1/demos/regulations/vector-store/{vector_store_id}
  API->>VS: Retrieve vector store
  VS-->>API: Vector store object
  API-->>Client: 200 object | 422
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I thump my paw—new routes appear,
Tools discriminate, the paths are clear.
Assistants learn to run and play,
MCP maps the warren’s way.
A vector burrow, fetched by key—
I nibble docs with glee: v1 to v3! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "feat:@coderabbitai" is a short tag/handle and does not describe the PR's primary changes (the OpenAPI additions and schema changes such as new Studio assistants endpoints, MCP discovery, and ToolDefinition/ToolResource updates in src/libs/AI21/openapi.yaml), so it is too vague to be useful for reviewers or changelogs. Please replace the title with a concise single sentence summarizing the main change, for example: "feat(openapi): add Studio assistants API, MCP discovery endpoint, and tool schema updates (openapi.yaml)"; keep it short, specific, and without emojis or handles.
✅ 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_202509200143

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.

@github-actions github-actions bot enabled auto-merge September 20, 2025 01:44
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:AI21 OpenAPI: add assistants, MCP, vector paths; update tool/resources Sep 20, 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: 2

🧹 Nitpick comments (5)
src/libs/AI21/openapi.yaml (5)

1018-1043: Add standard responses and IDs’ formats; use 201 for creations.

  • Add 404 for not‑found resources.
  • Prefer 201 Created for POST creations; optionally include a Location header.
  • Use format: uuid for path params that are UUID-like (e.g., vector_store_id, assistant_id).

Apply:

@@
 '/studio/v1/demos/regulations/vector-store/{vector_store_id}':
   get:
@@
-        - name: vector_store_id
+        - name: vector_store_id
           in: path
           required: true
           schema:
             title: Vector Store Id
             type: string
+            format: uuid
@@
       responses:
         '200':
@@
-        '422':
+        '404':
+          description: Not Found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HTTPValidationError'
+        '422':
           description: Validation Error
@@
 /studio/v1/assistants:
   get:
@@
-  post:
+  post:
     summary: Create Assistant
@@
-      responses:
-        '200':
+      responses:
+        '201':
           description: Successful Response
           content:
             application/json:
               schema:
                 $ref: '#/components/schemas/Assistant'
+          headers:
+            Location:
+              description: URL of the created resource
+              schema: { type: string }
+        '404':
+          description: Not Found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HTTPValidationError'
         '422':
           description: Validation Error
@@
 '/studio/v1/assistants/{assistant_id}':
@@
-  patch:
+  patch:
     summary: Modify Assistant
@@
-        - name: assistant_id
+        - name: assistant_id
           in: path
           required: true
           schema:
             title: Assistant Id
             type: string
+            format: uuid
@@
       responses:
         '200':
@@
+        '404':
+          description: Not Found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HTTPValidationError'
         '422':
           description: Validation Error
@@
-'/studio/v1/assistants/{assistant_id}/run':
+'/studio/v1/assistants/{assistant_id}/run':
   post:
@@
-        - name: assistant_id
+        - name: assistant_id
           in: path
           required: true
           schema:
             title: Assistant Id
             type: string
+            format: uuid
@@
       responses:
         '200':
@@
+        '404':
+          description: Not Found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HTTPValidationError'
         '422':
           description: Validation Error
@@
 /studio/v1/mcp/discover:
   post:
@@
       responses:
         '200':
@@
+        '404':
+          description: Not Found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HTTPValidationError'
         '422':
           description: Validation Error

Also applies to: 1520-1541, 1590-1617, 1619-1647, 1948-1969


2132-2167: Align Assistant optimization/types and tool_resources across schemas.

  • Assistant.optimization is string, but ModifyAssistantRequest.optimization uses RunOptimization. Make Assistant.optimization and CreateAssistantRequest.optimization use RunOptimization for consistency.
  • CreateAssistantRequest.tool_resources is an untyped object, while Assistant/ModifyAssistantRequest use AssistantToolResource. Make CreateAssistantRequest.tool_resources reference the same schema.
  • CreateAssistantRequest lacks visibility/response_language while Assistant exposes them with defaults; consider exposing them on create for parity.
@@ components:
   schemas:
     Assistant:
@@
-        optimization:
-          title: Optimization
-          type: string
+        optimization:
+          $ref: '#/components/schemas/RunOptimization'
@@
     CreateAssistantRequest:
@@
-        optimization:
-          title: Optimization
-          type: string
+        optimization:
+          $ref: '#/components/schemas/RunOptimization'
@@
-        tool_resources:
-          title: Tool Resources
-          type: object
+        tool_resources:
+          $ref: '#/components/schemas/AssistantToolResource'
@@
+        visibility:
+          allOf:
+            - $ref: '#/components/schemas/Visibility'
+          default: public
+        response_language:
+          title: Response Language
+          enum: [arabic, dutch, english, french, german, hebrew, italian, portuguese, spanish, unset]
+          type: string
+          default: unset

Also applies to: 2830-2873, 3907-3960


3496-3508: Typo: IgnestionBatchStatusCount → IngestionBatchStatusCount (and update refs).

Misspelling leaks into the public schema and the $ref in IngestionBatchStatusResponse.statuses.

-    IgnestionBatchStatusCount:
-      title: IgnestionBatchStatusCount
+    IngestionBatchStatusCount:
+      title: IngestionBatchStatusCount
@@
     IngestionBatchStatusResponse:
@@
-        statuses:
+        statuses:
           title: Statuses
           type: array
           items:
-            $ref: '#/components/schemas/IgnestionBatchStatusCount'
+            $ref: '#/components/schemas/IngestionBatchStatusCount'

Also applies to: 3525-3529


3307-3363: ToolResource family: tighten validation and defaults.

  • FileSearchToolResource: add bounds (e.g., 0.0–1.0) for retrieval_similarity_threshold; add minimums for max_neighbors; optionally add default for max_neighbors to mirror other places.
  • WebSearchToolResource: consider max_results or allowed_domains to limit scope (if applicable).
  • ToolResource: consider adding mcp/http when corresponding ToolDefinitions are present, or clarify that ToolResource is intentionally only for file/web search.

Also applies to: 4348-4355, 4478-4495


4118-4166: Input shape parity between RunAssistantRequest and CreateMaestroRunsPayload.

One allows string or array (CreateMaestroRunsPayload.input), the other only array of Message (RunAssistantRequest.input). If intentional, ignore; otherwise consider allowing both for symmetry.

Also applies to: 2879-2960

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fed30ee and 3130191.

⛔ Files ignored due to path filters (136)
  • src/libs/AI21/Generated/AI21..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Ai21Api.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Ai21Api.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Ai21Api.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Ai21Api.V1CreateAssistant.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Ai21Api.V1MaestroRun.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Ai21Api.V1ModifyAssistant.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Ai21Api.V1RunAssistant.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.IAi21Api.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.IAi21Api.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.IAi21Api.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.IAi21Api.V1ConversationalRag.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.IAi21Api.V1CreateAssistant.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.IAi21Api.V1MaestroRun.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.IAi21Api.V1ModifyAssistant.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.IAi21Api.V1RunAssistant.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.AssistantResponseLanguage.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.AssistantResponseLanguageNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.AssistantType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.AssistantTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.BudgetLevel.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.BudgetLevelNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceLabelsFilterMode.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceLabelsFilterModeNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceResponseLanguage.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceResponseLanguageNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolFunctionParametersType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolFunctionParametersTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolResourceType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolResourceTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesChatToolDefinitionType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesChatToolDefinitionTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.MCPToolResourceType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.MCPToolResourceTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.ModifyAssistantRequestResponseLanguage.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.ModifyAssistantRequestResponseLanguageNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.RunAssistantRequestResponseLanguage.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.RunAssistantRequestResponseLanguageNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.RunOptimization.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.RunOptimizationNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.Visibility.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.VisibilityNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.WebSearchToolResourceType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.WebSearchToolResourceTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.Assistant.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.AssistantResponseLanguage.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.AssistantType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.BudgetLevel.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.ChatRequest.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.ConversationalRagConfigResponseLanguage.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.ConversationalRagConfigRetrievalStrategy.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestToolResources.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestToolResources.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadResponseLanguage.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.FileSearchToolResourceLabelsFilterMode.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.FileSearchToolResourceResponseLanguage.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.FileSearchToolResourceType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolResource.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolResource.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.HTTPToolResourceType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinitionType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPDefinition.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPDefinition.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPTool.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPTool.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPToolResource.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPToolResource.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MCPToolResourceType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MaestroRunError.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MaestroRunError.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.MaestroRunResult.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestResponseLanguage.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.RunAssistantRequestResponseLanguage.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.RunOptimization.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.ToolResource.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.ToolResource.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.Visibility.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.WebSearchToolResourceType.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/AI21/openapi.yaml (23 hunks)
🔇 Additional comments (2)
src/libs/AI21/openapi.yaml (2)

3674-3688: Add URI formats to MCP URL fields.

These are URLs; add format: uri for better validation.

[raise_nitpick_refactor]

     MCPDefinition:
@@
-        server_url:
+        server_url:
           title: Server Url
           type: string
+          format: uri
@@
     MCPToolResource:
@@
-        server_url:
+        server_url:
           title: Server Url
           type: string
+          format: uri

Also applies to: 3719-3745


2304-2308: Vector store IDs: consider UUID format consistently.

Body_upload_check_compliance.vector_store_id and the vector-store path param should both declare format: uuid if that is the actual type.

[raise_nitpick_refactor]

     Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post:
@@
-        vector_store_id:
+        vector_store_id:
           title: Vector Store Id
           type: string
           description: Vector store ID to use for RFI processing
+          format: uuid

Also applies to: 1018-1030

Comment on lines +1520 to +1541
post:
summary: Create Assistant
operationId: v1_create_assistant
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateAssistantRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Assistant'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

🧩 Analysis chain

Run OpenAPI lint to catch spec issues and operationId uniqueness.

Recommend linting to surface remaining issues (e.g., schema keyword usage, response codes, duplicates).

Also applies to: 1590-1617, 1619-1647, 1948-1969, 1018-1043, 2132-2167, 2830-2873, 3402-3486, 3496-3508


🏁 Script executed:

#!/bin/bash
# Lint and basic checks
if ! command -v npx >/dev/null 2>&1; then
  echo "Please run with Node.js/npm available."
  exit 1
fi

# Install Redocly CLI locally and lint
npx --yes @redocly/cli@latest lint src/libs/AI21/openapi.yaml

# Check for duplicate operationIds
awk '/operationId:/{print $2}' src/libs/AI21/openapi.yaml | sort | uniq -d

# Validate YAML parses
python - <<'PY'
import sys, yaml
with open("src/libs/AI21/openapi.yaml") as f:
    yaml.safe_load(f)
print("YAML OK")
PY

Length of output: 8322


Fix OpenAPI validation failures (server URL, duplicate operationIds, missing license, missing 4XX responses)

  • Remove trailing slash in servers[0].url (src/libs/AI21/openapi.yaml:7) — change https://api.ai21.com/https://api.ai21.com.
  • Make all operationId values unique. Lint shows duplicate IDs: v1_library_management and v1_secret_storage (occurrences flagged at lines 167, 194, 288, 311, 336, 367, 394, 420). Rename per-operation (include method/path or a unique suffix).
  • Add an info.license object to the top-level info (src/libs/AI21/openapi.yaml, ~line 2).
  • Add at least one 4XX response for each flagged operation (lines/operationId): 281 v1_secret_storage (Get Secret List); 601 get_website_connector_studio_v1_connectors_website_get; 700 forward_paragon_webhook_studio_v1_connectors_paragon_webhook_post; 758 list_demos_studio_v1_demos_get; 1502 v1_list_models_info; 1513 v1_list_assistants; 1974 get_workspace_models_by_organization_endpoint_studio_v1_settings_models_get; 1985 get_available_models_endpoint_studio_v1_settings_models_available_get.
  • Re-run Redocly lint until validation passes. Current run: YAML parses OK; redocly lint reported 8 errors and 9 warnings.
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 1520-1541 and across the file, the
OpenAPI spec fails linting; remove the trailing slash from servers[0].url
(change https://api.ai21.com/ → https://api.ai21.com), add a top-level
info.license object under info (name and url), ensure all operationId values are
unique by renaming the duplicate v1_library_management and v1_secret_storage
entries (append method/path or a short unique suffix), and add at least one 4XX
response (e.g., 400 or 404 with a reference to the existing HTTPValidationError
or a new Error schema) to each flagged operation (lines/operationIds noted in
the comment: occurrences at ~167, 194, 281, 288, 311, 336, 367, 394, 420 and the
specific operations at ~601, ~700, ~758, ~1502, ~1513, ~1974, ~1985). After
making these edits, re-run redocly lint and iterate until no validation errors
remain.

Comment on lines +3402 to +3486
title: HTTPToolEndpoint
required:
- url
type: object
properties:
detail:
title: Detail
type: array
items:
$ref: '#/components/schemas/ValidationError'
IgnestionBatchStatusCount:
title: IgnestionBatchStatusCount
url:
title: Url
type: string
headers:
title: Headers
type: object
HTTPToolFunction:
title: HTTPToolFunction
required:
- status
- count
- name
- description
- parameters
type: object
properties:
name:
title: Name
type: string
description:
title: Description
type: string
parameters:
$ref: '#/components/schemas/HTTPToolFunctionParameters'
HTTPToolFunctionParamProperties:
title: HTTPToolFunctionParamProperties
required:
- type
- description
type: object
properties:
type:
title: Type
type: string
description:
title: Description
type: string
HTTPToolFunctionParameters:
title: HTTPToolFunctionParameters
required:
- properties
- required
type: object
properties:
type:
title: Type
enum:
- object
type: string
default: object
properties:
title: Properties
type: object
additionalProperties:
$ref: '#/components/schemas/HTTPToolFunctionParamProperties'
required:
title: Required
type: array
items:
type: string
additionalProperties:
title: Additionalproperties
type: boolean
default: false
HTTPToolResource:
title: HTTPToolResource
required:
- function
- endpoint
type: object
properties:
type:
title: Type
enum:
- http
type: string
default: http
function:
$ref: '#/components/schemas/HTTPToolFunction'
endpoint:
$ref: '#/components/schemas/HTTPToolEndpoint'
HTTPValidationError:
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 JSON Schema semantics for HTTPToolFunctionParameters.additionalProperties.

You added a property named “additionalProperties”; schema validators expect the JSON Schema keyword additionalProperties at the schema level. The current design forces clients to send a field named “additionalProperties”.

     HTTPToolFunctionParameters:
       title: HTTPToolFunctionParameters
       required:
         - properties
         - required
       type: object
+      additionalProperties: false
       properties:
         type:
           title: Type
           enum:
             - object
           type: string
           default: object
         properties:
           title: Properties
           type: object
           additionalProperties:
             $ref: '#/components/schemas/HTTPToolFunctionParamProperties'
         required:
           title: Required
           type: array
           items:
             type: string
-        additionalProperties:
-          title: Additionalproperties
-          type: boolean
-          default: false
📝 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
title: HTTPToolEndpoint
required:
- url
type: object
properties:
detail:
title: Detail
type: array
items:
$ref: '#/components/schemas/ValidationError'
IgnestionBatchStatusCount:
title: IgnestionBatchStatusCount
url:
title: Url
type: string
headers:
title: Headers
type: object
HTTPToolFunction:
title: HTTPToolFunction
required:
- status
- count
- name
- description
- parameters
type: object
properties:
name:
title: Name
type: string
description:
title: Description
type: string
parameters:
$ref: '#/components/schemas/HTTPToolFunctionParameters'
HTTPToolFunctionParamProperties:
title: HTTPToolFunctionParamProperties
required:
- type
- description
type: object
properties:
type:
title: Type
type: string
description:
title: Description
type: string
HTTPToolFunctionParameters:
title: HTTPToolFunctionParameters
required:
- properties
- required
type: object
properties:
type:
title: Type
enum:
- object
type: string
default: object
properties:
title: Properties
type: object
additionalProperties:
$ref: '#/components/schemas/HTTPToolFunctionParamProperties'
required:
title: Required
type: array
items:
type: string
additionalProperties:
title: Additionalproperties
type: boolean
default: false
HTTPToolResource:
title: HTTPToolResource
required:
- function
- endpoint
type: object
properties:
type:
title: Type
enum:
- http
type: string
default: http
function:
$ref: '#/components/schemas/HTTPToolFunction'
endpoint:
$ref: '#/components/schemas/HTTPToolEndpoint'
HTTPValidationError:
HTTPToolFunctionParameters:
title: HTTPToolFunctionParameters
required:
- properties
- required
type: object
additionalProperties: false
properties:
type:
title: Type
enum:
- object
type: string
default: object
properties:
title: Properties
type: object
additionalProperties:
$ref: '#/components/schemas/HTTPToolFunctionParamProperties'
required:
title: Required
type: array
items:
type: string
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 3402 to 3486 the
HTTPToolFunctionParameters schema incorrectly defines a property called
"additionalProperties" (forcing clients to send that field) instead of using the
JSON Schema keyword; remove the "additionalProperties" entry from the schema's
properties and instead set additionalProperties: false (or true as intended) at
the HTTPToolFunctionParameters schema level (alongside type/properties/required)
so validators treat it as the schema-level keyword; update required list if
necessary to no longer include "additionalProperties".

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.

1 participant