Skip to content

feat:OpenAPI: Add assistants/MCP/vector-store endpoints, schema updates#163

Closed
HavenDV wants to merge 1 commit into
mainfrom
bot/update-openapi_202509141240
Closed

feat:OpenAPI: Add assistants/MCP/vector-store endpoints, schema updates#163
HavenDV wants to merge 1 commit into
mainfrom
bot/update-openapi_202509141240

Conversation

@HavenDV

@HavenDV HavenDV commented Sep 14, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added endpoints to create and update Assistants.
    • Introduced MCP tool discovery.
    • Enabled fetching a vector store by ID.
    • Added new tool resource types: HTTP, MCP, File Search, and Web Search.
    • Expanded Assistant properties with requirements, budget levels, and visibility.
    • Introduced new enums: BudgetLevel, RunOptimization, Visibility.
  • Enhancements

    • Maestro run payload tools now use a clear, typed union by tool type.
    • Library uploads now support budget selection.
    • Added vector_store_id to relevant request bodies.
    • Replaced generic requirements with specialized Assistant and Execution Engine requirements.

@coderabbitai

coderabbitai Bot commented Sep 14, 2025

Copy link
Copy Markdown

Walkthrough

Adds new endpoints for assistants, MCP discovery, and vector-store retrieval. Expands and restructures public schemas: introduces assistant requests, MCP entities, new tool resource models, discriminated unions for tools, new enums, requirement type split, vector_store_id fields in bodies, and budget linkage in library upload. All changes occur in the OpenAPI spec.

Changes

Cohort / File(s) Summary of Changes
Assistant lifecycle APIs and schemas
src/libs/AI21/openapi.yaml
Added POST /studio/v1/assistants and PATCH /studio/v1/assistants/{assistant_id}. Introduced CreateAssistantRequest and ModifyAssistantRequest with fields for tools, tool_resources, requirements, budget, visibility, and optimization.
MCP discovery and entities
src/libs/AI21/openapi.yaml
Added POST /studio/v1/mcp/discover. Added MCPDefinition, MCPDiscoveryResponse, MCPTool, MCPToolResource schemas.
Tool resource model evolution
src/libs/AI21/openapi.yaml
Introduced HTTPToolResource, FileSearchToolResource, WebSearchToolResource and related HTTP function/endpoint schemas. Renamed ToolResources -> ToolResource and updated references. MaestroRunsPayload.tools now a discriminated union over http/mcp/file_search/web_search.
Vector store support
src/libs/AI21/openapi.yaml
Added GET /studio/v1/demos/regulations/vector-store/{vector_store_id}. Added vector_store_id to RFI process and compliance upload request bodies.
Enums and optimization
src/libs/AI21/openapi.yaml
Added BudgetLevel (low, medium, high), RunOptimization (cost, latency), Visibility (public, private). Applied to assistant and library upload schemas.
Requirements refactor
src/libs/AI21/openapi.yaml
Removed generic Requirement. Added language_studio_api_server__data_types__assistant__Requirement and ...__execution_engine__Requirement.
Library upload budget
src/libs/AI21/openapi.yaml
Body_v1_library_upload.budget now references BudgetLevel.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant API as Studio API
  participant Store as Data Store

  rect rgb(230,245,255)
    note over Client,API: Assistant Creation (new)
    Client->>API: POST /studio/v1/assistants (CreateAssistantRequest)
    API->>Store: Validate & persist assistant, tools, tool_resources
    Store-->>API: Assistant record
    API-->>Client: 201 Created (Assistant)
  end

  rect rgb(240,240,240)
    note over Client,API: Assistant Modification (new)
    Client->>API: PATCH /studio/v1/assistants/{assistant_id} (ModifyAssistantRequest)
    API->>Store: Update fields (models, tools, budget, visibility, etc.)
    Store-->>API: Updated assistant
    API-->>Client: 200 OK (Assistant)
  end
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as Studio API
  participant MCP as MCP Server (per MCPDefinition)

  rect rgb(235,255,235)
    note over Client,API: MCP Tool Discovery (new)
    Client->>API: POST /studio/v1/mcp/discover (MCPDefinition)
    API->>MCP: Connect using server_url, headers
    MCP-->>API: Tools description
    API-->>Client: 200 OK (MCPDiscoveryResponse)
  end
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as Studio API
  participant VS as Vector Store

  rect rgb(255,245,230)
    note over Client,API: Vector Store Fetch (new)
    Client->>API: GET /studio/v1/demos/regulations/vector-store/{vector_store_id}
    API->>VS: Retrieve vector store by ID
    VS-->>API: Vector store details
    API-->>Client: 200 OK (VectorStore)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

A hare taps keys with gentle might,
New tools and routes now see the light.
Assistants born, requirements split—
A vector winks, the payloads fit.
MCP whispers where tools abide,
Budget moons in careful tide.
Thump-thump—ship it with pride! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The pull request title "feat:@coderabbitai" is vague and does not summarize the primary changes in this PR (which add multiple OpenAPI paths and schemas such as assistant lifecycle endpoints, MCP discovery, new tool/resource types, enums, and updates to MaestroRunsPayload). It uses a prefix and an @-mention but gives no meaningful information about the main change, so it's not possible to determine if the title accurately reflects the changeset. Therefore the title check is inconclusive. Please update the title to a concise single-sentence summary of the primary change (for example: "OpenAPI: add assistant lifecycle endpoints, MCP discovery, and new tool resource schemas" or "feat(openapi): add assistants, MCP and multi-type tool resources") so reviewers can quickly understand the PR's intent; avoid mentions, emojis, or generic labels.
✅ 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_202509141240

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 14, 2025 12:41
@coderabbitai coderabbitai Bot changed the title feat:@coderabbitai feat:OpenAPI: Add assistants/MCP/vector-store endpoints, schema updates Sep 14, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

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

1018-1043: Add 404 and tag; consider ID format.

  • Missing 404 for unknown vector_store_id.
  • No tags; add one for consistency with other demo/regulations endpoints.
  • If IDs are UUIDs, add format: uuid.

Apply this diff:

   '/studio/v1/demos/regulations/vector-store/{vector_store_id}':
     get:
+      tags:
+        - Regulations
       summary: Get Vector Store
       description: Get a vector store by ID.
       operationId: get_vector_store_studio_v1_demos_regulations_vector_store__vector_store_id__get
       parameters:
         - name: vector_store_id
           in: path
           required: true
           schema:
             title: Vector Store Id
             type: string
+            format: uuid
       responses:
         '200':
           description: Successful Response
           content:
             application/json:
               schema:
                 title: Response Get Vector Store Studio V1 Demos Regulations Vector Store  Vector Store Id  Get
                 type: object
+        '404':
+          description: Vector store not found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HTTPValidationError'

2258-2262: Fix misleading description for vector_store_id.

This payload is for “upload-check-compliance”; description says “RFI processing”.

         vector_store_id:
           title: Vector Store Id
           type: string
-          description: Vector store ID to use for RFI processing
+          description: Vector store ID to use for compliance checks

2677-2683: ConversationalRagConfig: add constraints.

  • max_documents lacks minimum.
  • response_language default ‘unset’ is good.
       retrieval_strategy:
         allOf:
           - $ref: '#/components/schemas/RetrievalStrategy'
         default: segments
       max_documents:
         title: Max Documents
         type: integer
+        minimum: 1

Also applies to: 2707-2710


3270-3331: FileSearchToolResource: add bounds and minima.

  • retrieval_similarity_threshold and hybrid_search_alpha should be [0.0,1.0].
  • max_neighbors should be ≥1.
  • Consider minItems for file_ids/labels when provided.
         retrieval_similarity_threshold:
           title: Retrieval Similarity Threshold
           type: number
-          default: 0
+          default: 0
+          minimum: 0.0
+          maximum: 1.0
...
         max_neighbors:
           title: Max Neighbors
           type: integer
           default: 1
+          minimum: 1
...
         hybrid_search_alpha:
           title: Hybrid Search Alpha
           type: number
           default: 1
+          minimum: 0.0
+          maximum: 1.0

3371-3455: HTTP tool schemas: add URI format and header typing; require ‘type’.

  • url fields should be format: uri.
  • headers should constrain values to strings.
  • Require ‘type’ to satisfy the discriminator.
     HTTPToolEndpoint:
       title: HTTPToolEndpoint
       required:
         - url
       type: object
       properties:
         url:
           title: Url
           type: string
+          format: uri
         headers:
           title: Headers
-          type: object
+          type: object
+          additionalProperties:
+            type: string
...
     HTTPToolResource:
       title: HTTPToolResource
-      required:
-        - function
-        - endpoint
+      required:
+        - type
+        - function
+        - endpoint

3643-3713: MCP schemas: add URI format, require ‘type’, and type headers.

     MCPDefinition:
       title: MCPDefinition
       required:
         - server_url
       type: object
       properties:
         server_url:
           title: Server Url
           type: string
+          format: uri
         server_label:
           title: Server Label
           type: string
         headers:
           title: Headers
-          type: object
+          type: object
+          additionalProperties:
+            type: string
...
     MCPToolResource:
       title: MCPToolResource
-      required:
-        - server_label
-        - server_url
+      required:
+        - type
+        - server_label
+        - server_url

4388-4405: WebSearchToolResource: add minItems for urls.

Also consider clarifying precedence when both urls and fallback_to_web are set.

         urls:
           title: Urls
           type: array
           items:
             type: string
+          minItems: 1

4548-4564: Distinct titles to avoid codegen confusion.

Both schemas have title “Requirement”; give unique titles.

-    language_studio_api_server__data_types__assistant__Requirement:
-      title: Requirement
+    language_studio_api_server__data_types__assistant__Requirement:
+      title: AssistantRequirement
...
-    language_studio_api_server__data_types__execution_engine__Requirement:
-      title: Requirement
+    language_studio_api_server__data_types__execution_engine__Requirement:
+      title: ExecutionEngineRequirement

Also applies to: 4565-4580


2873-2879: Unify budget typing.

This payload inlines low/medium/high. Prefer referencing BudgetLevel for consistency and single source of truth.

Proposed change (outside this hunk):

     CreateMaestroRunsPayload:
       properties:
         budget:
-          title: Budget
-          enum: [low, medium, high]
-          type: string
+          allOf:
+            - $ref: '#/components/schemas/BudgetLevel'
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3376f54 and 2eca7ca.

⛔ Files ignored due to path filters (111)
  • 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.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.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.CreateMaestroRunsPayloadToolDiscriminatorType.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.JsonConverters.CreateMaestroRunsPayloadToolDiscriminatorTypeNullable.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.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.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.ToolsItem.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.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.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.CreateAssistantRequestTool.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestTool.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.CreateMaestroRunsPayloadToolDiscriminator.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadToolDiscriminator.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadToolDiscriminatorType.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.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.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.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.ModifyAssistantRequestTool.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestTool.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.ToolsItem.Json.g.cs is excluded by !**/generated/**
  • src/libs/AI21/Generated/AI21.Models.ToolsItem.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 (20 hunks)
🔇 Additional comments (5)
src/libs/AI21/openapi.yaml (5)

1520-1541: Create Assistant: path looks fine; ensure schema consistency.

CreateAssistantRequest currently differs from ModifyAssistantRequest/Assistant (optimization type, tool_resources ref, missing visibility). See suggested schema fixes below on Lines 2784–2824.


1590-1617: LGTM on PATCH route shape.

Endpoint wiring and 200 return type are consistent with GET/DELETE.


1917-1939: Capitalize “MCP” in summary.

Minor copy fix for consistency.

[raise_nitpick_refactor]

-      summary: Mcp Tool Discovery
+      summary: MCP Tool Discovery

2871-2871: OK to reference execution_engine requirement.

Consistent with new split requirement types.


3865-3905: ModifyAssistantRequest — looks consistent.

Once CreateAssistantRequest is aligned, both will match.

Comment on lines 2106 to +2119
$ref: '#/components/schemas/AssistantToolResource'
requirements:
title: Requirements
type: array
items:
$ref: '#/components/schemas/language_studio_api_server__data_types__assistant__Requirement'
budget:
allOf:
- $ref: '#/components/schemas/BudgetLevel'
default: medium
visibility:
allOf:
- $ref: '#/components/schemas/Visibility'
default: public

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Assistant: new requirements/budget/visibility — OK; align optimization type.

  • Good defaults for budget/visibility.
  • Consider changing Assistant.optimization to RunOptimization for parity with ModifyAssistantRequest.

Proposed change (outside this hunk):

 components:
   schemas:
     Assistant:
       properties:
         optimization:
-          title: Optimization
-          type: string
+          $ref: '#/components/schemas/RunOptimization'
📝 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
$ref: '#/components/schemas/AssistantToolResource'
requirements:
title: Requirements
type: array
items:
$ref: '#/components/schemas/language_studio_api_server__data_types__assistant__Requirement'
budget:
allOf:
- $ref: '#/components/schemas/BudgetLevel'
default: medium
visibility:
allOf:
- $ref: '#/components/schemas/Visibility'
default: public
components:
schemas:
Assistant:
properties:
optimization:
$ref: '#/components/schemas/RunOptimization'
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2106 to 2119, the Assistant schema
uses an optimization field type that should be aligned with
ModifyAssistantRequest; update the Assistant.optimization property to reference
the RunOptimization schema/type (the same one used by ModifyAssistantRequest) so
both APIs share the same type, and ensure any default/enum values and
documentation match RunOptimization's definition.

Comment on lines +2298 to +2303
title: BudgetLevel
enum:
- low
- medium
- high
description: An enumeration.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

BudgetLevel enum added — good; reuse it.

Elsewhere (e.g., CreateMaestroRunsPayload.budget) a duplicate enum is inlined. Prefer referencing BudgetLevel.

🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2298-2303, the BudgetLevel enum is
defined but elsewhere (notably CreateMaestroRunsPayload.budget) the same enum is
duplicated inline; update those inlined definitions to reference the existing
BudgetLevel schema instead of redefining it (use a $ref to the BudgetLevel
component), ensuring the payload's budget property points to the shared enum
schema and remove the duplicated enum entries.

Comment on lines +2784 to +2824
title: CreateAssistantRequest
required:
- name
type: object
properties:
name:
title: Name
type: string
description:
title: Description
type: string
optimization:
title: Optimization
type: string
avatar:
title: Avatar
type: string
models:
title: Models
type: array
items:
type: string
tools:
title: Tools
type: array
items:
type: object
additionalProperties:
$ref: '#/components/schemas/AssistantTool'
tool_resources:
title: Tool Resources
type: object
requirements:
title: Requirements
type: array
items:
$ref: '#/components/schemas/language_studio_api_server__data_types__assistant__Requirement'
budget:
allOf:
- $ref: '#/components/schemas/BudgetLevel'
default: medium

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

CreateAssistantRequest: align with ModifyAssistantRequest/Assistant.

  • Make optimization use RunOptimization.
  • tool_resources should reference AssistantToolResource (not bare object).
  • Add visibility property with default.
  • Optional: make models allow UUIDs (match Assistant.anyOf) if intended.
     CreateAssistantRequest:
       title: CreateAssistantRequest
       required:
         - name
       type: object
       properties:
         name:
           title: Name
           type: string
         description:
           title: Description
           type: string
         optimization:
-          title: Optimization
-          type: string
+          $ref: '#/components/schemas/RunOptimization'
         avatar:
           title: Avatar
           type: string
         models:
           title: Models
           type: array
           items:
             type: string
         tools:
           title: Tools
           type: array
           items:
             type: object
             additionalProperties:
               $ref: '#/components/schemas/AssistantTool'
-        tool_resources:
-          title: Tool Resources
-          type: object
+        tool_resources:
+          $ref: '#/components/schemas/AssistantToolResource'
         requirements:
           title: Requirements
           type: array
           items:
             $ref: '#/components/schemas/language_studio_api_server__data_types__assistant__Requirement'
         budget:
           allOf:
             - $ref: '#/components/schemas/BudgetLevel'
           default: medium
+        visibility:
+          allOf:
+            - $ref: '#/components/schemas/Visibility'
+          default: public
📝 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: CreateAssistantRequest
required:
- name
type: object
properties:
name:
title: Name
type: string
description:
title: Description
type: string
optimization:
title: Optimization
type: string
avatar:
title: Avatar
type: string
models:
title: Models
type: array
items:
type: string
tools:
title: Tools
type: array
items:
type: object
additionalProperties:
$ref: '#/components/schemas/AssistantTool'
tool_resources:
title: Tool Resources
type: object
requirements:
title: Requirements
type: array
items:
$ref: '#/components/schemas/language_studio_api_server__data_types__assistant__Requirement'
budget:
allOf:
- $ref: '#/components/schemas/BudgetLevel'
default: medium
title: CreateAssistantRequest
required:
- name
type: object
properties:
name:
title: Name
type: string
description:
title: Description
type: string
optimization:
$ref: '#/components/schemas/RunOptimization'
avatar:
title: Avatar
type: string
models:
title: Models
type: array
items:
type: string
tools:
title: Tools
type: array
items:
type: object
additionalProperties:
$ref: '#/components/schemas/AssistantTool'
tool_resources:
$ref: '#/components/schemas/AssistantToolResource'
requirements:
title: Requirements
type: array
items:
$ref: '#/components/schemas/language_studio_api_server__data_types__assistant__Requirement'
budget:
allOf:
- $ref: '#/components/schemas/BudgetLevel'
default: medium
visibility:
allOf:
- $ref: '#/components/schemas/Visibility'
default: public
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2784-2824, Update
CreateAssistantRequest so optimization is typed as RunOptimization (use $ref
'#/components/schemas/RunOptimization'), change tool_resources from a bare
object to reference AssistantToolResource ($ref
'#/components/schemas/AssistantToolResource'), add a visibility property (type:
string) with a sensible default (e.g., "private") and include it in the schema,
and optionally update models.items to allow UUIDs as well (e.g., use anyOf to
accept a plain string or a UUID schema reference to match Assistant.anyOf).

Comment on lines +2850 to 2864
oneOf:
- $ref: '#/components/schemas/HTTPToolResource'
- $ref: '#/components/schemas/MCPToolResource'
- $ref: '#/components/schemas/FileSearchToolResource'
- $ref: '#/components/schemas/WebSearchToolResource'
discriminator:
propertyName: type
mapping:
http: '#/components/schemas/HTTPToolResource'
mcp: '#/components/schemas/MCPToolResource'
file_search: '#/components/schemas/FileSearchToolResource'
web_search: '#/components/schemas/WebSearchToolResource'
tool_resources:
$ref: '#/components/schemas/ToolResources'
$ref: '#/components/schemas/ToolResource'
context:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Discriminated union for tools — good; ensure ‘type’ is required.

The discriminator relies on a present ‘type’. Add ‘type’ to required arrays of each resource schema.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="src/libs/AI21/openapi.yaml"
if [ ! -f "$FILE" ]; then
  echo "ERROR: $FILE not found in repository root."
  echo "Searching for any openapi.yaml files..."
  rg -n --hidden --no-ignore "openapi.yaml" || true
  exit 0
fi

python3 - <<'PY'
import sys, json, subprocess
fn="src/libs/AI21/openapi.yaml"
try:
    import yaml
except Exception:
    subprocess.check_call([sys.executable, "-m", "pip", "install", "PyYAML"], stdout=subprocess.DEVNULL)
    import yaml

with open(fn, 'r') as f:
    doc = yaml.safe_load(f)

components = doc.get('components', {})
schemas = components.get('schemas', {})

target_names = ["HTTPToolResource","MCPToolResource","FileSearchToolResource","WebSearchToolResource","ToolResource"]
out = {"found_file": fn, "checked_schemas": {}}

for name in target_names:
    sch = schemas.get(name)
    if sch is None:
        out["checked_schemas"][name] = {"exists": False}
    else:
        req = sch.get('required')
        props = sch.get('properties', {})
        type_prop = props.get('type')
        out["checked_schemas"][name] = {
            "exists": True,
            "required": req,
            "has_type_property": ('type' in props),
            "type_property": type_prop
        }

# find schemas that include a discriminator
discriminators = {}
for sname, sdef in schemas.items():
    if isinstance(sdef, dict) and 'discriminator' in sdef:
        discriminators[sname] = {
            "discriminator": sdef.get('discriminator'),
            "oneOf": sdef.get('oneOf')
        }

out["schemas_with_discriminator"] = discriminators

print(json.dumps(out, indent=2))
PY

Length of output: 1448


Discriminated union for tools — make 'type' required on each concrete resource schema

  • Add "type" to the required arrays of components.schemas.HTTPToolResource, MCPToolResource, FileSearchToolResource, and WebSearchToolResource in src/libs/AI21/openapi.yaml (each defines a "type" property but it's not listed as required).
  • components.schemas.ToolResource has no "type" property; either add a required "type" there or ensure ToolResource is only a oneOf wrapper and the discriminator is declared at the union level.
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2850-2864, the concrete tool schemas
used by the discriminated union declare a "type" property but do not list it as
required, and components.schemas.ToolResource lacks a "type" definition; update
each concrete schema (components.schemas.HTTPToolResource, MCPToolResource,
FileSearchToolResource, WebSearchToolResource) to include "type" in their
required arrays so the discriminator is enforced, and then either (A) keep
ToolResource as a pure oneOf wrapper (remove any "type" from ToolResource and
ensure the discriminator is declared at the union level only), or (B) if
ToolResource must include a type, add a "type" property to ToolResource and mark
it required there as well—pick one approach and apply consistently so the
discriminator mapping and required properties align.

Comment on lines +4064 to 4069
title: RunOptimization
enum:
- cost
- latency
description: An enumeration.
SecretResponse:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

RunOptimization enum — good addition.

Recommend referencing this in Assistant and CreateAssistantRequest (see suggestions).

🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 4064 to 4069, the new RunOptimization
enum is defined but not referenced from the Assistant and CreateAssistantRequest
schemas; update those two schemas to use the RunOptimization enum by adding a
$ref to '#/components/schemas/RunOptimization' (or set the property type to that
enum) where the optimization setting/property belongs so the models reference
the shared enum instead of duplicating values; ensure required/nullable
semantics match existing usage and regenerate any clients/docs if applicable.

Comment on lines +4258 to 4265
title: ToolResource
type: object
properties:
file_search:
title: File Search
type: object
$ref: '#/components/schemas/FileSearchToolResource'
web_search:
title: Web Search
type: object
$ref: '#/components/schemas/WebSearchToolResource'
TopLogprobsData:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

ToolResource missing http/mcp branches.

Tools union allows http/mcp, but ToolResource only has file_search/web_search. Add http and mcp for symmetry.

     ToolResource:
       title: ToolResource
       type: object
       properties:
         file_search:
           $ref: '#/components/schemas/FileSearchToolResource'
         web_search:
           $ref: '#/components/schemas/WebSearchToolResource'
+        http:
+          $ref: '#/components/schemas/HTTPToolResource'
+        mcp:
+          $ref: '#/components/schemas/MCPToolResource'
📝 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: ToolResource
type: object
properties:
file_search:
title: File Search
type: object
$ref: '#/components/schemas/FileSearchToolResource'
web_search:
title: Web Search
type: object
$ref: '#/components/schemas/WebSearchToolResource'
TopLogprobsData:
title: ToolResource
type: object
properties:
file_search:
$ref: '#/components/schemas/FileSearchToolResource'
web_search:
$ref: '#/components/schemas/WebSearchToolResource'
http:
$ref: '#/components/schemas/HTTPToolResource'
mcp:
$ref: '#/components/schemas/MCPToolResource'
TopLogprobsData:
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 4258 to 4265, the ToolResource object
only defines file_search and web_search but the tools union also permits http
and mcp; add properties for http and mcp to ToolResource using $ref entries
(e.g. $ref: '#/components/schemas/HttpToolResource' and $ref:
'#/components/schemas/McpToolResource') so the schema matches the allowed tool
types, and if those component schemas do not exist create them under
components/schemas with the expected structure.

@HavenDV HavenDV closed this Mar 10, 2026
auto-merge was automatically disabled March 10, 2026 22:21

Pull request was closed

@HavenDV HavenDV deleted the bot/update-openapi_202509141240 branch March 21, 2026 00:40
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