Skip to content

Conversation

HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 19, 2025

Summary by CodeRabbit

  • New Features
    • Added endpoints for creating, modifying, and running assistants; MCP tool discovery; and vector-store retrieval.
    • Enhanced assistants with requirements, budget levels, visibility, assistant type, and response language (including unset default).
    • Overhauled tools with richer resources (HTTP, MCP, File Search, Web Search) and updated assistant tool selection.
    • Introduced run options: optimization (cost/latency), dynamic planning, structured RAG, and clearer error reporting.
    • Improved library/upload and RFI flows with budget level support and vector_store_id integration.

Copy link

coderabbitai bot commented Sep 19, 2025

Walkthrough

Expands the OpenAPI spec with new endpoints for vector-store retrieval, assistant lifecycle (create/modify/run), and MCP discovery. Replaces the prior ToolDefinition with a discriminated union and updates Assistant schemas. Adds HTTP/MCP/FileSearch/WebSearch tool resources, new enums/types, and integrates vector_store_id and BudgetLevel in relevant payloads.

Changes

Cohort / File(s) Summary
Endpoints: Assistants & MCP & Vector Store
src/libs/AI21/openapi.yaml
Added POST /studio/v1/assistants, PATCH /studio/v1/assistants/{assistant_id}, POST /studio/v1/assistants/{assistant_id}/run, POST /studio/v1/mcp/discover, GET /studio/v1/demos/regulations/vector-store/{vector_store_id}; corresponding request/response schemas and operationIds.
Assistant lifecycle schemas
src/libs/AI21/openapi.yaml
Introduced CreateAssistantRequest, ModifyAssistantRequest, RunAssistantRequest, RunOptimization; extended Assistant with requirements, budget, visibility, assistant_type, response_language; MaestroRunError added; MaestroRunResult extended with error.
Tooling: Union and resources
src/libs/AI21/openapi.yaml
Replaced top-level ToolDefinition with language_studio_api_server__data_types__execution_engine__ToolDefinition (discriminated union: http, mcp, file_search, web_search); Assistant.tools updated to use new union; added ToolResource wrapper.
MCP definitions
src/libs/AI21/openapi.yaml
Added MCPDefinition, MCPDiscoveryResponse, MCPTool, MCPToolResource; new discovery endpoint consumes/returns these.
HTTP tool support
src/libs/AI21/openapi.yaml
Added HTTPToolEndpoint, HTTPToolFunction, HTTPToolFunctionParameters, HTTPToolResource; updated HTTPValidationError usage.
File/Web search resources
src/libs/AI21/openapi.yaml
Added FileSearchToolResource and WebSearchToolResource; included retrieval parameters, labels filtering, URLs, and fallback options.
Vector-store integration
src/libs/AI21/openapi.yaml
Added vector_store_id to Body_upload_check_compliance and Body_process_rfi_document payloads.
Budget & visibility enums
src/libs/AI21/openapi.yaml
Introduced BudgetLevel, Visibility, AssistantType; response_language enums expanded with unset default; applied to Assistant and run-related schemas; Body_v1_library_upload updated to use BudgetLevel.
Chat/tool cross-cutting types
src/libs/AI21/openapi.yaml
Added language_studio_api_server__data_types__chat__ToolDefinition and execution_engine/assistant Requirement types for reuse.
Removals/Renames
src/libs/AI21/openapi.yaml
Removed AssistantTool enum and old top-level ToolDefinition; migrated references to new execution_engine ToolDefinition and resource types.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant API as Studio API
  participant Assist as Assistant Service
  participant Maestro as Maestro Runner
  participant Tools as Tooling (HTTP/MCP/File/Web)

  rect rgb(235, 245, 255)
  note over Client,API: Assistant creation/modification
  Client->>API: POST /studio/v1/assistants (CreateAssistantRequest)
  API->>Assist: Create assistant (models, tools, resources, settings)
  Assist-->>API: Assistant
  Client->>API: PATCH /studio/v1/assistants/{id} (ModifyAssistantRequest)
  API->>Assist: Update assistant
  Assist-->>API: Assistant
  end

  rect rgb(245, 235, 255)
  note over Client,API: Run assistant
  Client->>API: POST /studio/v1/assistants/{id}/run (RunAssistantRequest)
  API->>Maestro: Start run (input, options)
  Maestro->>Tools: Invoke tool(s) as needed (discriminated union)
  Tools-->>Maestro: Tool results/errors
  Maestro-->>API: MaestroRunResult (may include error)
  API-->>Client: 200 MaestroRunResult | 422 Validation
  end
Loading
sequenceDiagram
  autonumber
  participant Client
  participant API as Studio API
  participant MCP as MCP Server

  rect rgb(240, 255, 240)
  note over Client,API: MCP tool discovery
  Client->>API: POST /studio/v1/mcp/discover (MCPDefinition)
  API->>MCP: Connect using server_url/headers
  MCP-->>API: Tools metadata
  API-->>Client: MCPDiscoveryResponse (definition, tools)
  end
Loading
sequenceDiagram
  autonumber
  participant Client
  participant API as Studio API
  participant VS as Vector Store

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

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I thump my paws on specs so wide,
New routes hop in, tools unified.
MCP burrows, secrets found,
Assistants run with gentle sound.
Vectors stored, budgets set—
A tidy warren, perfect yet.
Carrot-shaped commits? Best bet! 🥕🐇

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 summarize the PR's main changes; it reads like a tag or mention rather than a descriptive summary. The changeset actually adds multiple new endpoints (assistants create/modify/run, MCP discovery, vector-store retrieval), repatterns ToolDefinition to a discriminated union, and introduces many new schema types and tool resources, none of which are communicated by the title. Because the title provides no meaningful context for reviewers or future history, it is inconclusive with respect to the required title quality. Please rename the PR to a concise, descriptive title before merging; for example: "feat(studio): add assistants create/modify/run endpoints, MCP discovery, tool-definition refactor, and vector-store support". A clear title that highlights the primary API and schema changes will help reviewers and make the project history easier to scan.
✅ 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_202509191522

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 19, 2025 15:23
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Expand OpenAPI: assistant lifecycle, vector-store, MCP endpoints Sep 19, 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

♻️ Duplicate comments (1)
src/libs/AI21/openapi.yaml (1)

3907-3960: Create vs Modify Assistant: optimization type inconsistency.

Modify uses RunOptimization (enum) but Create uses string. Align Create to enum (see earlier diff).

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

1018-1043: Add 404 and tighten path param format for Vector Store GET.

  • Add a 404 response for unknown vector_store_id.
  • Set path param format to uuid if applicable.
  • Optional: clean up the autogenerated 200 schema title.
   '/studio/v1/demos/regulations/vector-store/{vector_store_id}':
     get:
       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
+            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
+                title: Vector Store
                 type: object
+        '404':
+          description: Not Found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HTTPValidationError'
         '422':
           description: Validation Error

1618-1647: Run Assistant: consider async semantics.

If runs are long-lived, consider 202 Accepted with polling via /maestro/runs/{execution_id}. Otherwise OK.


1947-1969: MCP endpoint naming/style nit.

Capitalize MCP consistently in summary (“MCP Tool Discovery”).


2132-2166: Assistant schema: unify tool_resources typing and defaults.

  • tools now use the new union (good).
  • tool_resources points to AssistantToolResource, while Maestro payloads use ToolResource. Pick one and standardize (prefer ToolResource with explicit shapes).
  • Double-check default visibility=public is desired.
- tool_resources:
-   $ref: '#/components/schemas/AssistantToolResource'
+ tool_resources:
+   $ref: '#/components/schemas/ToolResource'

2304-2307: Wrong description: references “RFI processing” in Regulations payload.

Change to “compliance 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 processing

2723-2756: ConversationalRagConfig: add validation bounds.

Add min/max for retrieval_similarity_threshold (0..1) and max_documents (>=1) for parity with LibrarySearchRequest.

 retrieval_similarity_threshold:
   title: Retrieval Similarity Threshold
-  type: number
+  type: number
+  minimum: 0.0
+  maximum: 1.0
 max_documents:
   title: Max Documents
   type: integer
+  minimum: 1

3307-3362: FileSearchToolResource: add constraints and docs parity.

  • retrieval_similarity_threshold should be 0..1.
  • max_neighbors/min bounds if applicable.
 retrieval_similarity_threshold:
   title: Retrieval Similarity Threshold
-  type: number
+  type: number
+  minimum: 0.0
+  maximum: 1.0
 max_neighbors:
   title: Max Neighbors
   type: integer
+  minimum: 1

3496-3529: Typo: “IgnestionBatchStatusCount” → “IngestionBatchStatusCount”.

Fix the schema name and the reference. Consider leaving a deprecated alias to avoid breaking generated clients.

-    IgnestionBatchStatusCount:
-      title: IgnestionBatchStatusCount
+    IngestionBatchStatusCount:
+      title: IngestionBatchStatusCount
       required:
         - status
         - count
       type: object
 ...
     IngestionBatchStatusResponse:
       properties:
         statuses:
           title: Statuses
           type: array
           items:
-            $ref: '#/components/schemas/IgnestionBatchStatusCount'
+            $ref: '#/components/schemas/IngestionBatchStatusCount'

Optional alias:

+    IgnestionBatchStatusCount:
+      allOf:
+        - $ref: '#/components/schemas/IngestionBatchStatusCount'
+      deprecated: true

4348-4355: Duplicate “tool_resources” models.

ToolResource (typed) vs AssistantToolResource (loose + plan_approval). Recommend consolidating on ToolResource and deprecating AssistantToolResource.

Also applies to: 2229-2241

📜 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 2864c9a.

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

1589-1617: Modify Assistant: LGTM.

PATCH shape and response look consistent with Assistant. Ensure PATCH semantics (partial update) are upheld server-side.


3402-3486: HTTP tool schemas: LGTM.

Clear separation of endpoint/function/params with a discriminated union.


3674-3745: MCP types: LGTM.

Shapes for definition, discovery response, tool resource look consistent and usable.


3753-3760: MaestroRunResult error channel: LGTM.

Error object addition is backward-compatible and explicit.

Also applies to: 3790-3791


4118-4166: RunAssistantRequest: LGTM.

Defaults/read-only fields look sane; include list is explicit.


4472-4477: Visibility/WebSearchToolResource: LGTM.

Enums and resource shape are consistent with the new union.

Also applies to: 4478-4495


4638-4698: ToolDefinition unions: LGTM.

Discriminator mappings match the concrete resources. Good.


1-4703: Action Required: Please manually verify OpenAPI spec consistency

  • Confirm all budget defaults and enum values use the correct casing (low/medium/high) consistently.
  • Ensure the optimization property in CreateAssistantRequest and ModifyAssistantRequest share the same type/schema.
  • Validate every tool_resources reference points to a defined schema.
  • Correct the typo in IgnestionBatchStatusCountIngestionBatchStatusCount.
  • Review the vector_store_id description under the RFI compliance payload to match intended behavior.

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

Choose a reason for hiding this comment

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

⚠️ Potential issue

Create Assistant: align request typing and HTTP status.

  • Use RunOptimization enum for optimization (currently string in CreateAssistantRequest).
  • tool_resources should reference AssistantToolResource or ToolResource (not a bare object).
  • Consider 201 Created for a creation endpoint.
 /studio/v1/assistants:
   post:
     summary: Create Assistant
     operationId: v1_create_assistant
     requestBody:
       content:
         application/json:
           schema:
             $ref: '#/components/schemas/CreateAssistantRequest'
       required: true
     responses:
-      '200':
+      '201':
         description: Successful Response
         content:
           application/json:
             schema:
               $ref: '#/components/schemas/Assistant'
📝 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: Create Assistant
operationId: v1_create_assistant
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateAssistantRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Assistant'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
post:
summary: Create Assistant
operationId: v1_create_assistant
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateAssistantRequest'
required: true
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Assistant'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 1520 to 1541, the Create Assistant
endpoint needs schema/type and status-code alignment: update
CreateAssistantRequest so the optimization field uses the existing
RunOptimization enum instead of a plain string; change the tool_resources
property to reference the proper schema (AssistantToolResource or ToolResource)
instead of an inline/empty object; and update the success response status from
'200' to '201' with the same Assistant schema. Ensure requestBody schema
references the corrected CreateAssistantRequest and that any examples/required
lists reflect these type changes.

Comment on lines +2344 to +2349
title: BudgetLevel
enum:
- low
- medium
- high
description: An enumeration.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Budget enum usage inconsistent (lowercase enum vs uppercase strings).

  • BudgetLevel enum uses low/medium/high (lowercase).
  • Body_process_rfi_document and Body_upload_check_compliance use uppercase strings and string type with defaults.

Unify to use BudgetLevel in both bodies.

 Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post:
   properties:
     budget:
-      title: Budget
-      type: string
-      description: 'Budget level: LOW, MEDIUM, or HIGH'
-      default: MEDIUM
+      allOf:
+        - $ref: '#/components/schemas/BudgetLevel'
+      description: Budget level
+      default: medium

 Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post:
   properties:
     budget:
-      title: Budget
-      type: string
-      default: MEDIUM
+      allOf:
+        - $ref: '#/components/schemas/BudgetLevel'
+      default: medium

Also applies to: 2279-2286, 2296-2304

🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2344-2349 (and also at 2279-2286,
2296-2304), the BudgetLevel enum is defined with lowercase values
(low/medium/high) while Body_process_rfi_document and
Body_upload_check_compliance use uppercase string literals and plain string
types with defaults; update those request body schemas to reference the
BudgetLevel enum type instead of raw strings, adjust any defaults to match the
enum values (use lowercase), and remove duplicate inline enum/string definitions
so all usages consistently use the single BudgetLevel definition.

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

CreateAssistantRequest: type mismatches vs ModifyAssistantRequest/Assistant.

  • optimization should be RunOptimization (enum) like ModifyAssistantRequest.
  • tool_resources should reference ToolResource (or AssistantToolResource) instead of raw object.
  • If response_language/visibility are settable at creation, add them to parity with Assistant.
 CreateAssistantRequest:
   properties:
     optimization:
-      title: Optimization
-      type: string
+      $ref: '#/components/schemas/RunOptimization'
     tool_resources:
-      title: Tool Resources
-      type: object
+      $ref: '#/components/schemas/ToolResource'
+    visibility:
+      allOf:
+        - $ref: '#/components/schemas/Visibility'
+      default: public
+    response_language:
+      title: Response Language
+      enum: [arabic, dutch, english, french, german, hebrew, italian, portuguese, spanish, unset]
+      type: string
+      default: unset
📝 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:
$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/ToolResource'
visibility:
allOf:
- $ref: '#/components/schemas/Visibility'
default: public
response_language:
title: Response Language
enum: [arabic, dutch, english, french, german, hebrew, italian, portuguese, spanish, unset]
type: string
default: unset
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:

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