Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 20, 2025

Summary by CodeRabbit

  • New Features
    • Create, update, and run Assistants through new endpoints.
    • Discover and connect MCP tools.
    • Expanded Assistant options: tools, requirements, budget levels, visibility (public/private), types (default/chat/maestro), and response language.
    • New tool integrations: HTTP, MCP, File Search, and Web Search with retrieval settings, labels/filters, URLs, and web fallback.
    • Fetch vector stores by ID.
    • Run results now include structured error details.
    • Updated defaults for budget, visibility, assistant type, and response language (unset), improving configuration clarity.

@coderabbitai
Copy link

coderabbitai bot commented Sep 20, 2025

Walkthrough

Updated src/libs/AI21/openapi.yaml to add new endpoints (assistants CRUD/run, MCP discovery, vector store fetch) and overhaul schemas for assistants, tools, MCP, retrieval, and Maestro run results, including new enums, defaults, and cross-references to a unified ToolDefinition model.

Changes

Cohort / File(s) Summary of Changes
OpenAPI spec expansion
src/libs/AI21/openapi.yaml
Added endpoints: GET /studio/v1/demos/regulations/vector-store/{vector_store_id}, POST /studio/v1/assistants, PATCH /studio/v1/assistants/{assistant_id}, POST /studio/v1/assistants/{assistant_id}/run, POST /studio/v1/mcp/discover. Introduced/updated schemas: Assistant (new fields: tools→unified ToolDefinition, requirements, budget, visibility, assistant_type, response_language), CreateAssistantRequest, ModifyAssistantRequest, RunAssistantRequest, MaestroRunResult (optional error), MaestroRunError, RunOptimization, BudgetLevel, Visibility, AssistantType. Unified tool model via language_studio_api_server__data_types__execution_engine__ToolDefinition (oneOf HTTPToolResource, MCPToolResource, FileSearchToolResource, WebSearchToolResource) with discriminator. Added HTTP tool schemas (HTTPToolEndpoint, HTTPToolFunction, ...), MCP schemas (MCPDefinition, MCPDiscoveryResponse, MCPTool, MCPToolResource), FileSearchToolResource, WebSearchToolResource. Retrieval strategy referenced via allOf; added max_documents. Defaults adjusted (response_language=unset, budget/visibility/assistant_type). Replaced legacy ToolDefinition references with new namespaced definitions.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant API as Studio API
  participant AS as Assistant Service
  participant EX as Execution Engine
  participant M as Maestro
  participant T as Tool Resource(s)

  rect rgba(230,240,255,0.4)
  note over C,API: Create or modify Assistant
  C->>API: POST /studio/v1/assistants (CreateAssistantRequest)
  API->>AS: Create assistant (schemas: Assistant, ToolDefinition)
  AS-->>API: Assistant
  C-->>API: PATCH /studio/v1/assistants/{id} (ModifyAssistantRequest)
  API->>AS: Update assistant
  AS-->>API: Assistant
  end

  rect rgba(235,255,235,0.4)
  note over C,M: Run Assistant
  C->>API: POST /studio/v1/assistants/{id}/run (RunAssistantRequest)
  API->>M: Start run (optimization, retrieval, language)
  M->>EX: Plan and execute
  EX->>T: Invoke tools (HTTP/MCP/FileSearch/WebSearch)
  T-->>EX: Tool outputs
  EX-->>M: Aggregated results
  alt success
    M-->>API: MaestroRunResult (output)
  else error
    M-->>API: MaestroRunResult.error (MaestroRunError)
  end
  API-->>C: MaestroRunResult
  end
Loading
sequenceDiagram
  autonumber
  participant C as Client
  participant API as Studio API
  participant MCP as MCP Discovery

  rect rgba(255,245,230,0.5)
  note over C,MCP: MCP Tool Discovery
  C->>API: POST /studio/v1/mcp/discover (MCPDefinition)
  API->>MCP: Discover tools
  MCP-->>API: MCPDiscoveryResponse (tools)
  API-->>C: MCPDiscoveryResponse
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I twitch my ears at endpoints new,
Assistants brew with tools in queue.
Maestro hums, plans hop in line,
MCP maps where functions shine.
A vector store, a budget tune—
I stamp my paw: ship it soon! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "feat:@coderabbitai" is vague and does not describe the substantive changes in this PR, which update the OpenAPI spec to add multiple assistant endpoints, MCP discovery, and large schema/tool model refactors; it reads like a tag or bot annotation rather than a concise summary of the main change. Because it does not communicate the primary change or scope to a reviewer scanning history, it meets the definition of a vague/generic title. Under the provided criteria this check is inconclusive. Please replace the title with a short, descriptive single-sentence summary of the primary change (for example: "feat(openapi): add assistants endpoints, MCP discovery, and unified tool schemas"). Ensure the title names the main scope (e.g., "openapi" or "assistants") and the most impactful change so reviewers can understand intent at a glance.
✅ 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_202509202117

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 21:18
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Update AI21 OpenAPI: add endpoints and overhaul schemas 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: 3

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

1018-1043: Define a VectorStore schema and add 404 for missing IDs

Returning a bare object hampers client generation and validation. Also add a 404 for non-existent IDs.

Apply:

   responses:
-        '200':
+        '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
+                $ref: '#/components/schemas/VectorStore'
+        '404':
+          description: Not Found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HTTPValidationError'

And add under components.schemas:

+    VectorStore:
+      title: VectorStore
+      type: object
+      required: [id]
+      properties:
+        id:
+          type: string
+          title: Id
+        name:
+          type: string
+        created_at:
+          type: string
+          format: date-time

1520-1541: Use 201 Created for resource creation (and Location header)

Creation should return 201 and, ideally, Location.

-      responses:
-        '200':
+      responses:
+        '201':
           description: Successful Response
           content:
             application/json:
               schema:
                 $ref: '#/components/schemas/Assistant'
+          headers:
+            Location:
+              description: URL of the created assistant
+              schema:
+                type: string
+                format: uri

1619-1647: Parity with Maestro: consider widening Run input type

RunAssistantRequest accepts only array of Message, while Maestro accepts string or array. Recommend aligning to reduce client branching.

See schema change on Lines 4118-4166 below.


1947-1969: Add 401/403 responses for auth failures

Endpoint is protected by bearer auth; reflect common error statuses.

       responses:
         '200':
           description: Successful Response
           content:
             application/json:
               schema:
                 $ref: '#/components/schemas/MCPDiscoveryResponse'
+        '401':
+          description: Unauthorized
+        '403':
+          description: Forbidden
         '422':

2304-2307: Fix mismatched description (compliance vs RFI)

The description says “RFI processing” but this payload is for compliance upload.

-          description: Vector store ID to use for RFI processing
+          description: Vector store ID to use for compliance checking

2723-2728: Add bounds/defaults for max_documents; keep response_language consistent

max_documents lacks constraints; add sane bounds. response_language defaults look good.

         max_documents:
           title: Max Documents
           type: integer
+          minimum: 1
+          maximum: 1000
+          default: 20

Also applies to: 2753-2756


3307-3362: Expose max_documents in FileSearchToolResource

Paritizes FileSearchToolResource with ConversationalRagConfig and Run payloads.

     FileSearchToolResource:
       title: FileSearchToolResource
       type: object
       properties:
+        max_documents:
+          title: Max Documents
+          type: integer
+          minimum: 1
+          maximum: 1000
+          default: 20

3402-3494: HTTP tool schemas: add URI format and optional method field

Endpoint.url should be a URI; consider optional method for future-proofing.

     HTTPToolEndpoint:
       title: HTTPToolEndpoint
       required:
         - url
       type: object
       properties:
         url:
           title: Url
-          type: string
+          type: string
+          format: uri
         headers:
           title: Headers
           type: object
+        method:
+          title: Method
+          type: string
+          enum: [GET, POST, PUT, PATCH, DELETE]
+          default: POST

3674-3745: MCP schemas: add URI format; prefer snake_case for input_schema

Use format: uri and align casing with the rest of the spec.

     MCPDefinition:
       properties:
         server_url:
           title: Server Url
-          type: string
+          type: string
+          format: uri
...
     MCPTool:
       required:
-        - name
-        - inputSchema
+        - name
+        - input_schema
       properties:
         name:
           title: Name
           type: string
-        inputSchema:
-          title: Inputschema
+        input_schema:
+          title: Input Schema
           type: object

4118-4166: Align RunAssistantRequest.input with Maestro

Allow string or array for input (same as CreateMaestroRunsPayload) to simplify clients.

     RunAssistantRequest:
       properties:
-        input:
-          title: Input
-          type: array
-          items:
-            $ref: '#/components/schemas/Message'
+        input:
+          title: Input
+          anyOf:
+            - type: array
+              items:
+                $ref: '#/components/schemas/Message'
+            - type: string

4478-4495: Add response_language to WebSearchToolResource (parity with FileSearch)

Keeps behavior consistent across tool resources.

     WebSearchToolResource:
       title: WebSearchToolResource
       type: object
       properties:
         type:
           title: Type
           enum:
             - web_search
           type: string
           default: web_search
         urls:
           title: Urls
           type: array
           items:
             type: string
         fallback_to_web:
           title: Fallback To Web
           type: boolean
+        response_language:
+          title: Response Language
+          type: string
+          enum: [arabic, dutch, english, french, german, hebrew, italian, portuguese, spanish, unset]
+          default: unset
📜 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 acd5f0d.

⛔ 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 (7)
src/libs/AI21/openapi.yaml (7)

1589-1617: LGTM on Modify Assistant endpoint

OperationId, request/response types, and 422 handling look consistent with the rest of the spec.


2343-2349: LGTM: BudgetLevel enum

Enum and defaults used elsewhere are consistent.


2472-2472: LGTM: Chat tools ref to chat ToolDefinition

Correct ref and discriminator for function tools.


2898-2901: Verify requirement type divergence (assistant vs execution_engine)

CreateMaestroRunsPayload.requirements uses execution_engine.Requirement, while Assistant/requests use assistant.Requirement. If semantics are identical, prefer one type; if not, document the difference.

Would you like me to generate a follow-up patch to consolidate on one schema?

Also applies to: 2908-2909, 2954-2957


3753-3761: LGTM: MaestroRun error surface

Adding MaestroRunError and wiring it into MaestroRunResult is clean and backwards-compatible.

Also applies to: 3790-3791


3907-3960: LGTM: ModifyAssistantRequest

Enum, defaults, and refs look coherent; matches endpoints.


4638-4698: LGTM: Unified ToolDefinition with discriminator

Good use of oneOf + discriminator to unify tool resources.

Comment on lines +2132 to +2166
$ref: '#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition'
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
assistant_type:
allOf:
- $ref: '#/components/schemas/AssistantType'
default: default
response_language:
title: Response Language
enum:
- arabic
- dutch
- english
- french
- german
- hebrew
- italian
- portuguese
- spanish
- unset
type: string
default: unset
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Unify tool_resources type across Assistant and requests

Assistant.tool_resources uses AssistantToolResource; CreateAssistantRequest.tool_resources is an untyped object; CreateMaestroRunsPayload uses ToolResource. This inconsistency hurts DX and codegen.

Prefer referencing a single, structured schema. Minimal fix: make CreateAssistantRequest.tool_resources match Assistant:

         tool_resources:
-          title: Tool Resources
-          type: object
+          $ref: '#/components/schemas/AssistantToolResource'

Alternative: migrate Assistant.tool_resources to ToolResource and add plan_approval into ToolResource for parity.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2132 to 2166, tool_resources is
defined on Assistant as AssistantToolResource while other request/ payload
schemas use different/untypeed shapes (CreateAssistantRequest has an untyped
object, CreateMaestroRunsPayload uses ToolResource); unify these by updating
CreateAssistantRequest.tool_resources to reference the same structured schema
used by Assistant (i.e., use $ref:
'#/components/schemas/AssistantToolResource'), and ensure any other places that
expect ToolResource are reconciled (either rename ToolResource to
AssistantToolResource or add AssistantToolResource as an alias referencing
ToolResource) so codegen and client types are consistent; after changing the
$ref, run schema validation and regenerate clients to pick up the unified type.

Comment on lines +2830 to +2872
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:
$ref: '#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition'
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
assistant_type:
allOf:
- $ref: '#/components/schemas/AssistantType'
default: default
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Make CreateAssistantRequest.optimization an enum; type tool_resources

Create uses plain string for optimization while Modify uses RunOptimization enum. Align now to avoid breaking later; also type tool_resources.

         optimization:
-          title: Optimization
-          type: string
+          $ref: '#/components/schemas/RunOptimization'
...
         tool_resources:
-          title: Tool Resources
-          type: object
+          $ref: '#/components/schemas/AssistantToolResource'
📝 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:
$ref: '#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition'
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
assistant_type:
allOf:
- $ref: '#/components/schemas/AssistantType'
default: default
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:
$ref: '#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition'
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
assistant_type:
allOf:
- $ref: '#/components/schemas/AssistantType'
default: default
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2830 to 2872, the
CreateAssistantRequest schema currently defines optimization as a plain string
while Modify uses a RunOptimization enum, and tool_resources is an untyped
object; change optimization to reference the existing RunOptimization enum (e.g.
replace the string type with an allOf/$ref to
'#/components/schemas/RunOptimization' and keep the same default as Modify if
present) and change tool_resources from type: object to an explicit type (set to
type: string or the correct schema reference used elsewhere for tool_resources)
so both Create and Modify align and the OpenAPI types are explicit.

Comment on lines +3496 to 3500
title: IgnestionBatchStatusCount
required:
- status
- count
type: object
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Typo in schema name: IgnestionBatchStatusCount ➜ IngestionBatchStatusCount

Public schema naming typo; fix now and update references.

-    IgnestionBatchStatusCount:
+    IngestionBatchStatusCount:
       title: IgnestionBatchStatusCount
       required:
         - status
         - count

Also update the reference in IngestionBatchStatusResponse.statuses.items:

# elsewhere in this file
items:
  $ref: '#/components/schemas/IngestionBatchStatusCount'
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 3496-3500, the schema name
"IgnestionBatchStatusCount" is misspelled; rename the schema to
"IngestionBatchStatusCount" and update all references to it (for example update
IngestionBatchStatusResponse.statuses.items to $ref:
'#/components/schemas/IngestionBatchStatusCount') so all $ref pointers use the
corrected schema name; ensure required/fields and capitalization remain
unchanged and run a YAML/schema validation after renaming to catch any remaining
references.

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