Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 21, 2025

Summary by CodeRabbit

  • New Features
    • Create, update, and run assistants via new endpoints.
    • Discover MCP tools and connect them to assistants.
    • Fetch vector stores by ID.
    • Configure assistants with budget levels, visibility (public/private), types, and response language (including unset).
    • Enhanced run controls: verbose mode, include options, structured RAG, dynamic planning, and optimization for cost/latency.
    • Broader tool support: HTTP endpoints/functions, MCP tools, file search, and web search.
  • Refactor
    • Unified tool definitions and resource models to simplify configuration.

@coderabbitai
Copy link

coderabbitai bot commented Sep 21, 2025

Walkthrough

The OpenAPI spec was expanded with new endpoints (assistants create/modify/run, MCP discovery, vector-store fetch), new and refactored schemas (tooling, MCP, run payloads), enum additions (visibility, assistant type, budget levels, response language), and broad schema reference updates consolidating ToolDefinition and ToolResource structures.

Changes

Cohort / File(s) Summary of changes
Assistant lifecycle endpoints
src/libs/AI21/openapi.yaml
Added POST /studio/v1/assistants (CreateAssistantRequest → Assistant), PATCH /studio/v1/assistants/{assistant_id} (ModifyAssistantRequest → Assistant), POST /studio/v1/assistants/{assistant_id}/run (RunAssistantRequest → MaestroRunResult).
Vector store retrieval
src/libs/AI21/openapi.yaml
Added GET /studio/v1/demos/regulations/vector-store/{vector_store_id} returning vector store or HTTPValidationError (422).
MCP tool discovery
src/libs/AI21/openapi.yaml
Added POST /studio/v1/mcp/discover with MCPDefinition → MCPDiscoveryResponse; introduced MCPTool, MCPToolResource.
Tooling unification and refactor
src/libs/AI21/openapi.yaml
Introduced language_studio_api_server__data_types__execution_engine__ToolDefinition; replaced prior ToolDefinition references; renamed ToolResources → ToolResource; added HTTPToolEndpoint/Function/Parameters/Resource; integrated FileSearchToolResource, WebSearchToolResource.
Assistant schema expansion
src/libs/AI21/openapi.yaml
Assistant now includes requirements, budget, visibility, assistant_type, response_language; Assistant.tools now references unified ToolDefinition.
Run-related payloads
src/libs/AI21/openapi.yaml
Added RunAssistantRequest; added RunOptimization (cost, latency); MaestroRunResult expanded with error (MaestroRunError).
Enums and shared types
src/libs/AI21/openapi.yaml
Added BudgetLevel, AssistantType, Visibility; response_language extended (including unset default handling).
RFI/demo payload extensions
src/libs/AI21/openapi.yaml
Added/updated payloads including vector_store_id, budget and related fields for demos/RFI; new CreateOrganizationSchemaRequest, CreatePlanPayload, CreateRoutePayload wiring.
Reference reorganizations
src/libs/AI21/openapi.yaml
Broad updates from ToolDefinition → language_studio_api_server__data_types__execution_engine__ToolDefinition across schemas; adoption of language_studio_api_server__data_types__... naming; minor adjustments to HTTPValidationError placements.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant API as Studio API
  participant S as Assistant Service

  rect rgb(238,248,255)
  note over C,API: Create Assistant
  C->>API: POST /studio/v1/assistants (CreateAssistantRequest)
  API->>S: validate + create(request)
  S-->>API: Assistant
  API-->>C: 200 Assistant | 422 HTTPValidationError
  end
Loading
sequenceDiagram
  autonumber
  participant C as Client
  participant API as Studio API
  participant R as Run Orchestrator
  participant T as Tools (HTTP/MCP/File/Web)
  participant M as Model

  rect rgb(245,255,245)
  note over C,API: Run Assistant
  C->>API: POST /studio/v1/assistants/{id}/run (RunAssistantRequest)
  API->>R: initiateRun(assistantId, options)
  R->>T: discover/resolve tools (via unified ToolDefinition)
  alt structured RAG / planning
    R->>T: invoke tool(s)
    T-->>R: tool result(s)
  end
  R->>M: generate with context
  M-->>R: output
  R-->>API: MaestroRunResult (incl. error/optimizations)
  API-->>C: 200 MaestroRunResult | 422 HTTPValidationError
  end
Loading
sequenceDiagram
  autonumber
  participant C as Client
  participant API as Studio API
  participant D as MCP Discovery

  rect rgb(255,248,240)
  note over C,API: MCP Discover
  C->>API: POST /studio/v1/mcp/discover (MCPDefinition)
  API->>D: discover(definition)
  D-->>API: MCPDiscoveryResponse (tools/resources)
  API-->>C: 200 MCPDiscoveryResponse | 422 HTTPValidationError
  end
Loading
sequenceDiagram
  autonumber
  participant C as Client
  participant API as Studio API
  participant VS as Vector Store

  rect rgb(248,248,255)
  note over C,API: Fetch Vector Store
  C->>API: GET /studio/v1/demos/regulations/vector-store/{vector_store_id}
  API->>VS: fetchById(id)
  VS-->>API: vector store
  API-->>C: 200 object | 422 HTTPValidationError
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Poem

I twitch my ears at endpoints new,
Assistants born, then off they flew—
Tools aligned, one spec to rule,
MCPs discovered (such a tool!).
Vectors fetched, runs optimized—
My paws approve, well itemized.
Thump-thump: the backlog’s civilized. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "feat:@coderabbitai" is not a meaningful summary of the changes; it reads like a bot/author tag rather than a description of the primary work in this PR (new assistant endpoints, MCP discovery, ToolDefinition/type refactors, etc.), so it does not help reviewers or changelog readers. Because it is generic and does not convey the main change, the check cannot conclusively pass. Rename the PR to a concise, descriptive single-sentence title that highlights the primary change, for example: "feat: add assistant create/modify/run endpoints, MCP discovery, and ToolDefinition refactor". Begin with the conventional prefix (e.g., "feat:"), keep it short, and mention the main area(s) modified; optionally include the issue/PR number for traceability.
✅ 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_202509211241

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 21, 2025 12:42
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Expand OpenAPI: new assistant/MCP/vector endpoints schema/enum updates Sep 21, 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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/libs/AI21/openapi.yaml (1)

3496-3529: Typo breaks references: IgnestionBatchStatusCount → IngestionBatchStatusCount.

This will confuse generators and validators; fix name and reference.

-    IgnestionBatchStatusCount:
-      title: IgnestionBatchStatusCount
+    IngestionBatchStatusCount:
+      title: IngestionBatchStatusCount
...
-            $ref: '#/components/schemas/IgnestionBatchStatusCount'
+            $ref: '#/components/schemas/IngestionBatchStatusCount'
🧹 Nitpick comments (9)
src/libs/AI21/openapi.yaml (9)

1018-1043: Define a concrete VectorStore schema and add 404.

Response currently returns an untyped object and lacks a 404 for unknown IDs. Also, the title has a duplicate space. Consider uuid format on path param.

Apply:

-              schema:
-                title: Response Get Vector Store Studio V1 Demos Regulations Vector Store  Vector Store Id  Get
-                type: object
+              schema:
+                $ref: '#/components/schemas/VectorStore'
+        '404':
+          description: Not Found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HTTPValidationError'

And under components/schemas:

+    VectorStore:
+      title: VectorStore
+      required: [id, name]
+      type: object
+      properties:
+        id:
+          type: string
+          format: uuid
+        name:
+          type: string
+        metadata:
+          type: object

1521-1541: Use 201 Created for resource creation and add Location header.

POST creates a server-side resource; 201 is more appropriate and improves client tooling.

-      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

1590-1617: PATCH semantics: consider JSON Merge Patch content type or clarify partial update.

If this is a partial update, set content-type to application/merge-patch+json or document merge behavior.

-      requestBody:
-        content:
-          application/json:
+      requestBody:
+        content:
+          application/merge-patch+json:
             schema:
               $ref: '#/components/schemas/ModifyAssistantRequest'

2135-2166: Consolidate response_language into a shared schema.

Response language enum appears in multiple places; define a single ResponseLanguage enum to avoid drift.

+    ResponseLanguage:
+      title: ResponseLanguage
+      enum: [arabic, dutch, english, french, german, hebrew, italian, portuguese, spanish, unset]
+      type: string
...
-        response_language:
-          title: Response Language
-          enum: ...
-          type: string
-          default: unset
+        response_language:
+          allOf: [{$ref: '#/components/schemas/ResponseLanguage'}]
+          default: unset

2723-2729: Minor: Add bounds/validation for max_documents.

Specify minimum and a sensible upper bound to aid validation.

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

Also applies to: 2753-2756


3307-3362: FileSearchToolResource: consider parity fields with ConversationalRagConfig.

If used by the same retriever, add optional max_documents for symmetry.

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

3674-3744: LGTM: MCP types look good; minor nit—capitalize summary as “MCP Tool Discovery”.

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

4348-4355: ToolResource excludes HTTP/MCP—verify intended scope.

If tool_resources should also configure HTTP/MCP, extend ToolResource oneOf or add corresponding fields.

-    ToolResource:
+    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'

4478-4495: LGTM: WebSearchToolResource looks consistent; consider rate limiting knobs later.

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

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

2132-2132: LGTM: Tools now reference execution_engine ToolDefinition.

Good discriminator-based oneOf for tool resources.


2304-2307: LGTM: Added vector_store_id for regulations upload.

Keeps RFI flows consistent with vector-store fetch.


2344-2349: LGTM: BudgetLevel enum introduced.

Matches defaults used elsewhere.


2898-2901: LGTM: Maestro payloads wired to new ToolDefinition/ToolResource and response_language.

Also applies to: 2905-2909, 2954-2957


3487-3495: LGTM: Keep HTTPValidationError for compatibility.


3753-3791: LGTM: MaestroRunError added and referenced in MaestroRunResult.


4118-4166: Include shape: verify keys match what backend supports.

Default include contains requirements_result.metadata; ensure backend recognizes dot-paths. If not, model as nested fields.

Would you confirm accepted values for include? If needed, I can draft a schema with an enum.


4472-4476: LGTM: Visibility enum added and referenced with defaults.


4655-4668: LGTM: Separate ToolDefinition variants for chat vs execution engine with discriminator.

Also applies to: 4685-4698

Comment on lines +1619 to +1647
post:
summary: Run Assistant
operationId: v1_run_assistant
parameters:
- name: assistant_id
in: path
required: true
schema:
title: Assistant Id
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RunAssistantRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/MaestroRunResult'
'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

Async run: prefer 202 Accepted or clarify sync behavior; align input shape with CreateMaestroRunsPayload.

Run likely starts an async job (MaestroRunResult has in_progress). Consider 202 and allow input to be string OR messages (oneOf) for parity.

-      responses:
-        '200':
+      responses:
+        '202':
           description: Successful Response

And in RunAssistantRequest (see lines 4118-4166):

-        input:
-          title: Input
-          type: array
-          items:
-            $ref: '#/components/schemas/Message'
+        input:
+          title: Input
+          anyOf:
+            - type: array
+              items:
+                $ref: '#/components/schemas/Message'
+            - type: string
📝 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
post:
summary: Run Assistant
operationId: v1_run_assistant
parameters:
- name: assistant_id
in: path
required: true
schema:
title: Assistant Id
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RunAssistantRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/MaestroRunResult'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
post:
summary: Run Assistant
operationId: v1_run_assistant
parameters:
- name: assistant_id
in: path
required: true
schema:
title: Assistant Id
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RunAssistantRequest'
required: true
responses:
'202':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/MaestroRunResult'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'

Comment on lines +2830 to 2873
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
CreateMaestroRunsPayload:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Schema inconsistency: tool_resources type and optimization enum.

  • tool_resources here is a plain object but elsewhere ($ref in ModifyAssistantRequest) it’s AssistantToolResource.
  • optimization is string here, but ModifyAssistantRequest uses RunOptimization enum.
-        optimization:
-          title: Optimization
-          type: string
+        optimization:
+          allOf: [{$ref: '#/components/schemas/RunOptimization'}]
-        tool_resources:
-          title: Tool Resources
-          type: object
+        tool_resources:
+          $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
CreateMaestroRunsPayload:
title: CreateAssistantRequest
required:
- name
type: object
properties:
name:
title: Name
type: string
description:
title: Description
type: string
optimization:
allOf:
- $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

Comment on lines +3402 to +3413
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:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

HTTP tool resources missing HTTP method and request specs.

Without an HTTP method (GET/POST/PUT/DELETE/PATCH) and optional body/query schema, execution is underspecified.

     HTTPToolEndpoint:
       title: HTTPToolEndpoint
       required:
-        - url
+        - url
+        - method
       type: object
       properties:
         url:
           title: Url
           type: string
+        method:
+          title: Method
+          type: string
+          enum: [GET, POST, PUT, DELETE, PATCH]
         headers:
           title: Headers
           type: object
+        query:
+          title: Query
+          type: object
+        body:
+          title: Body
+          type: object

Also applies to: 3414-3469, 3470-3486

Comment on lines +3907 to 3960
title: ModifyAssistantRequest
type: object
properties:
name:
title: Name
type: string
description:
title: Description
type: string
optimization:
$ref: '#/components/schemas/RunOptimization'
avatar:
title: Avatar
type: string
is_archived:
title: Is Archived
type: boolean
default: false
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:
$ref: '#/components/schemas/BudgetLevel'
visibility:
$ref: '#/components/schemas/Visibility'
response_language:
title: Response Language
enum:
- arabic
- dutch
- english
- french
- german
- hebrew
- italian
- portuguese
- spanish
- unset
type: string
OrgSchema:
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Align Assistant.optimization with enum and unify across Create/Modify/Assistant.

Assistant uses string; Modify uses RunOptimization. Recommend making Assistant and Create use RunOptimization too (see suggested diff in respective blocks).

🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 3907 to 3960, the
ModifyAssistantRequest schema uses $ref: '#/components/schemas/RunOptimization'
while the Assistant (and CreateAssistantRequest) schemas still define
optimization as a plain string/enum; update those schemas so they all reference
the same RunOptimization component. Locate the Assistant and
CreateAssistantRequest schema blocks and replace their optimization property
definition with: $ref: '#/components/schemas/RunOptimization' (ensuring
imports/refs resolve), then run a schema validation to confirm no remaining type
mismatches across Create/Modify/Assistant.

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