Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 18, 2025

Summary by CodeRabbit

  • New Features
    • Added endpoints to create, update, and run assistants.
    • Introduced MCP tool discovery and broader tool integrations (HTTP, file search, web search).
    • Expanded assistant settings: type, visibility, budget level, and response language (including unset).
    • Added vector store details endpoint and vector_store_id support across related workflows.
    • Enhanced retrieval configuration with strategy defaults and max_documents.
    • Improved error responses for tool and endpoint validation.
    • Added demos and workspace updates aligned with the new tool and language options.

@coderabbitai
Copy link

coderabbitai bot commented Sep 18, 2025

Walkthrough

Refactors tool modeling to a discriminated-union ToolDefinition, introduces unified ToolResource backends (HTTP, MCP, FileSearch, WebSearch), adds assistant lifecycle APIs (create, modify, run) and related models/enums, integrates MCP discovery, updates RAG retrieval configs, adjusts error/tool endpoint schemas, and threads vector_store_id through applicable requests.

Changes

Cohort / File(s) Summary of changes
Tool model refactor
src/libs/AI21/openapi.yaml
Replaced AssistantTool enum and old ToolDefinition with discriminated language_studio_api_server__data_types__execution_engine__ToolDefinition; added ToolResource wrapper; introduced concrete tool resources: HTTP, MCP, FileSearch, WebSearch; updated all tool references accordingly.
Assistant APIs and models
src/libs/AI21/openapi.yaml
Added CreateAssistantRequest, ModifyAssistantRequest, RunAssistantRequest; extended Assistant with requirements, budget, visibility, assistant_type, response_language; added endpoints: POST /studio/v1/assistants, PATCH /studio/v1/assistants/{assistant_id}, POST /studio/v1/assistants/{assistant_id}/run.
MCP support
src/libs/AI21/openapi.yaml
Added MCPDefinition, MCPDiscoveryResponse, MCPTool, MCPToolResource; added POST /studio/v1/mcp/discover endpoint; wired MCP into ToolDefinition discriminator and ToolResource.
Retrieval/RAG updates
src/libs/AI21/openapi.yaml
Standardized RetrievalStrategy via allOf with default segments; introduced max_documents in RFI/Conversations; adjusted defaults and references to centralized retrieval types.
Error and endpoint schema updates
src/libs/AI21/openapi.yaml
Replaced certain validation/error structures with HTTP tool-focused schemas: HTTPToolEndpoint, HTTPToolFunction, HTTPToolFunctionParameters, HTTPToolResource; aligned endpoint error/validation modeling with tool system.
Vector store and demos
src/libs/AI21/openapi.yaml
Added GET /studio/v1/demos/regulations/vector-store/{vector_store_id}; propagated vector_store_id to relevant demo and processing bodies.
Language and enums
src/libs/AI21/openapi.yaml
Added AssistantType, BudgetLevel, Visibility; expanded RunOptimization; broadened response language enum and added unset default across assistant and run schemas.
Typing consistency and refactors
src/libs/AI21/openapi.yaml
Consolidated tool-related schemas to ...execution_engine__ToolDefinition and related resource/requirement types; removed/renamed legacy schemas; updated ToolParameters/ToolCall family to new types.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant API as Studio API
  participant Store as Assistant Store
  participant Cfg as Tool Registry

  Client->>API: POST /studio/v1/assistants (CreateAssistantRequest)
  API->>Store: Persist Assistant (tools: ToolDefinition[], metadata)
  Store-->>API: Assistant
  API-->>Client: Assistant

  Client->>API: PATCH /studio/v1/assistants/{id} (ModifyAssistantRequest)
  API->>Store: Update Assistant fields
  Store-->>API: Assistant
  API-->>Client: Assistant
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as Studio API
  participant Exec as Execution Engine
  participant HTTP as HTTP Tool
  participant MCP as MCP Tool
  participant FS as FileSearch Tool
  participant WS as WebSearch Tool

  Client->>API: POST /studio/v1/assistants/{id}/run (RunAssistantRequest)
  API->>Exec: Start run (assistant, ToolDefinition[], options)
  Note over Exec: Discriminator selects backend via ToolResource
  alt HTTP tool
    Exec->>HTTP: Invoke endpoint (HTTPToolFunction)
    HTTP-->>Exec: Result or validation error
  else MCP tool
    Exec->>MCP: Invoke MCPTool
    MCP-->>Exec: Result
  else FileSearch
    Exec->>FS: Query vector store
    FS-->>Exec: Documents
  else WebSearch
    Exec->>WS: Search
    WS-->>Exec: Snippets
  end
  Exec-->>API: MaestroRunResult
  API-->>Client: MaestroRunResult
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as Studio API
  participant Disc as MCP Discovery

  Client->>API: POST /studio/v1/mcp/discover
  API->>Disc: Discover MCP tools
  Disc-->>API: MCPDiscoveryResponse
  API-->>Client: MCPDiscoveryResponse
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60–90 minutes

Poem

I thump my paws—new tools abound!
Unioned wands in one neat mound.
Assistants spin, then swiftly run,
MCP stars join in the fun.
Vectors hum, retrieval sings—
A rabbit ships these tidy things. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The PR title "feat:@coderabbitai" is not a descriptive summary of the changes in this pull request. The changeset is a substantial OpenAPI refactor (centralizing ToolDefinition, adding assistant create/modify/run endpoints, MCP and new tool resources, and many schema updates) and the current title only functions as an author/tag reference rather than conveying the primary change. Because the title is vague and does not communicate the main change, the check is inconclusive. Please update the PR title to a concise, one-sentence summary of the primary change (for example: "refactor(openapi): centralize ToolDefinition and add assistants create/modify/run endpoints with MCP support"); include an optional scope like "openapi" or "studio/v1" and avoid author tags or emojis. After renaming the title to clearly reflect the main change, re-run this check so it can be reassessed.
✅ 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_202509181247

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 18, 2025 12:48
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Refactor tools; add ToolResource backends; assistant lifecycle APIs Sep 18, 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-3507: Typo: IgnestionBatchStatusCount → IngestionBatchStatusCount (breaking).

The schema name is misspelled and referenced by IngestionBatchStatusResponse.statuses. Fix the name and update references; keep a deprecated alias for backward compat if the misspelling shipped previously.

-    IgnestionBatchStatusCount:
-      title: IgnestionBatchStatusCount
+    IngestionBatchStatusCount:
+      title: IngestionBatchStatusCount
...
-            $ref: '#/components/schemas/IgnestionBatchStatusCount'
+            $ref: '#/components/schemas/IngestionBatchStatusCount'

(Optional) add a deprecated alias:

+    IgnestionBatchStatusCount:
+      deprecated: true
+      allOf:
+        - $ref: '#/components/schemas/IngestionBatchStatusCount'
🧹 Nitpick comments (10)
src/libs/AI21/openapi.yaml (10)

1018-1043: Define a proper response schema + tidy title.

200 response is an untyped object and the generated title contains double spaces. Define and $ref a concrete schema (e.g., VectorStore) and fix the title.

Apply:

-              schema:
-                title: Response Get Vector Store Studio V1 Demos Regulations Vector Store  Vector Store Id  Get
-                type: object
+              schema:
+                $ref: '#/components/schemas/VectorStore'

(And add a VectorStore schema in components.)


1948-1969: Use consistent capitalization in summary ("MCP").

Nit: “Mcp Tool Discovery” → “MCP Tool Discovery”.

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

2305-2308: Copy/paste description mismatch.

vector_store_id description says “RFI processing” under Regulations upload-check-compliance. Adjust to “compliance processing” (or similar).

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

2723-2756: ConversationalRagConfig: add bounds for max_documents and keep enum default cohesive.

  • Add a minimum for max_documents (e.g., ≥1) and optionally a sensible max.
  • Response language defaults to unset consistently across models — good.
         max_documents:
           title: Max Documents
           type: integer
+          minimum: 1
+          maximum: 100

3307-3362: FileSearchToolResource: consider parity with ConversationalRagConfig.

  • Optionally add max_documents (and bounds) for symmetry with ConversationalRag.
  • Add bounds for numeric fields (retrieval_similarity_threshold, max_neighbors).
         retrieval_similarity_threshold:
           title: Retrieval Similarity Threshold
           type: number
+          minimum: 0.0
+          maximum: 1.0
+        max_documents:
+          title: Max Documents
+          type: integer
+          minimum: 1
+          maximum: 100
         max_neighbors:
           title: Max Neighbors
           type: integer
+          minimum: 1
+          maximum: 10

3402-3413: HTTPToolEndpoint: strengthen typing.

  • url should declare format: uri.
  • headers should use additionalProperties: { type: string }.
         url:
           title: Url
-          type: string
+          type: string
+          format: uri
         headers:
           title: Headers
-          type: object
+          type: object
+          additionalProperties:
+            type: string

3674-3701: MCPDefinition/MCP Discovery: add URL format and minimal constraints.

  • server_url should be format: uri.
  • Consider requiring at least one tool in discovery response (minItems: 1).
         server_url:
           title: Server Url
-          type: string
+          type: string
+          format: uri
...
         tools:
           title: Tools
           type: array
           items:
             $ref: '#/components/schemas/MCPTool'
+          minItems: 1

3719-3745: MCPToolResource: allow header values as strings, document allowed_tools.

  • Add additionalProperties: { type: string } to headers.
  • If allowed_tools is constrained to discovered names, consider documenting or validating pattern.
         headers:
           title: Headers
-          type: object
+          type: object
+          additionalProperties:
+            type: string

4107-4155: RunAssistantRequest: consider enumerating include-values.

include is free-form; consider an enum (or documented allowed values) to aid clients and codegen. Default set looks fine.

         include:
           title: Include
-          type: array
-          items:
-            type: string
+          type: array
+          items:
+            enum:
+              - data_sources
+              - requirements_result
+              - requirements_result.metadata
+            type: string

4467-4484: WebSearchToolResource: tighten typing.

  • urls should use format: uri and minItems: 1.
  • Consider default fallback_to_web: false.
         urls:
           title: Urls
           type: array
+          minItems: 1
           items:
-            type: string
+            type: string
+            format: uri
         fallback_to_web:
           title: Fallback To Web
           type: boolean
+          default: false
📜 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 07f992b.

⛔ Files ignored due to path filters (133)
  • 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.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 (22 hunks)
🔇 Additional comments (14)
src/libs/AI21/openapi.yaml (14)

1520-1541: New Create Assistant endpoint looks good.

Path, operationId, and wiring to CreateAssistantRequest/Assistant are coherent.


1590-1617: Modify Assistant endpoint is wired correctly.


1619-1647: Run Assistant endpoint is consistent with MaestroRunResult.


2242-2247: AssistantType enum addition is clear and sensible.


2344-2349: BudgetLevel enum addition LGTM.


2943-2957: Response language default to unset is consistent with Assistant and Rag.


3470-3486: HTTPToolResource discriminated union piece reads well.


3487-3495: HTTPValidationError retained — OK given widespread references.


4461-4466: Visibility enum LGTM.


4627-4643: Assistant.Requirement shape is reasonable.


4644-4657: Chat ToolDefinition (function-only) is clean and discriminated by type.


2898-2901: Maestro run: Tool resources typed via ToolResource — good. Confirmed: ToolResource schema only defines file_search and web_search; HTTPToolResource and MCPToolResource are separate schemas and are not used under ToolResource.


4337-4344: ToolResource missing http/mcp entries — confirm design or add parity

ToolResource currently exposes only file_search and web_search (components/schemas/ToolResource — src/libs/AI21/openapi.yaml:4336–4343); HTTPToolResource and MCPToolResource exist separately (src/libs/AI21/openapi.yaml:3469 and 3718) and are included in ToolDefinition oneOf. If HTTP/MCP require resource configs (timeouts, auth, tool allow‑lists) extend ToolResource to include them; otherwise document that the omission is intentional.


4674-4687: Approve — ToolDefinition union is well-formed: all variants expose the correct type discriminator values.
Verified each schema's properties.type.enum contains 'http', 'mcp', 'file_search', and 'web_search' respectively.

Comment on lines +2132 to 2167
$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
AssistantMessage:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Tooling and assistant fields: type consistency gaps across models.

  • Assistant.optimization is type: string, but ModifyAssistantRequest.optimization uses RunOptimization enum and CreateAssistantRequest.optimization is type: string.
  • Assistant.tool_resources uses AssistantToolResource, CreateAssistantRequest.tool_resources is type: object (untyped), Maestro run uses ToolResource.
  • Assistant has visibility and assistant_type; ModifyAssistantRequest lacks assistant_type; CreateAssistantRequest lacks visibility.

Align these three schemas to the same types/availability to avoid client/codegen drift.

Suggested minimal fix (unify types immediately; broader consolidation to ToolResource can follow in a separate PR):

# Assistant (keep as-is or switch optimization to enum for parity)
-        optimization:
-          title: Optimization
-          type: string
+        optimization:
+          allOf:
+            - $ref: '#/components/schemas/RunOptimization'

# CreateAssistantRequest
-        optimization:
-          title: Optimization
-          type: string
+        optimization:
+          allOf:
+            - $ref: '#/components/schemas/RunOptimization'
-        tool_resources:
-          title: Tool Resources
-          type: object
+        tool_resources:
+          $ref: '#/components/schemas/AssistantToolResource'
+        visibility:
+          allOf:
+            - $ref: '#/components/schemas/Visibility'
+          default: public

# ModifyAssistantRequest
+        assistant_type:
+          allOf:
+            - $ref: '#/components/schemas/AssistantType'

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

🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2132 to 2167, multiple
assistant-related schemas are inconsistent: unify the three schemas (Assistant,
CreateAssistantRequest, ModifyAssistantRequest) so they expose the same types
and fields — change optimization in Assistant and CreateAssistantRequest to use
the RunOptimization enum (as ModifyAssistantRequest does), make tool_resources
reference the same AssistantToolResource schema (replace untyped object in
CreateAssistantRequest and ToolResource mismatches), and ensure visibility and
assistant_type fields exist on CreateAssistantRequest and ModifyAssistantRequest
with the same allOf refs and defaults as Assistant; apply these changes
consistently in the YAML so codegen/clients see identical types and defaults
across the three models.

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

CreateAssistantRequest: type gaps for tool_resources and visibility.

tool_resources is untyped; visibility is missing while present on Assistant. Make both consistent with Assistant.

See diff in the earlier consolidated suggestion (Assistant block).

🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2830 to 2872, the
CreateAssistantRequest schema leaves tool_resources untyped and omits the
visibility field; make both consistent with the Assistant schema by replacing
the loose tool_resources: type: object with the same schema or $ref used by
Assistant for tool_resources (or the explicit properties/type definition from
the Assistant block), and add a visibility property that mirrors the Assistant's
visibility definition (same type/enum/$ref and default if present). Ensure
required/default values match Assistant’s implementation so
CreateAssistantRequest and Assistant use the same shape for tool_resources and
visibility.

Comment on lines +3443 to +3469
title: HTTPToolFunctionParameters
required:
- properties
- required
type: object
properties:
type:
title: Type
enum:
- object
type: string
default: object
properties:
title: Properties
type: object
additionalProperties:
$ref: '#/components/schemas/HTTPToolFunctionParamProperties'
required:
title: Required
type: array
items:
type: string
additionalProperties:
title: Additionalproperties
type: boolean
default: false
HTTPToolResource:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

HTTPToolFunctionParameters: additionalProperties is misplaced.

You added an additionalProperties field inside properties, which creates a payload field rather than constraining the schema. Move it to the schema level to enforce no extras.

-    HTTPToolFunctionParameters:
+    HTTPToolFunctionParameters:
       title: HTTPToolFunctionParameters
       required:
         - properties
         - required
       type: object
-      properties:
+      properties:
         type:
           title: Type
           enum:
             - object
           type: string
           default: object
         properties:
           title: Properties
           type: object
           additionalProperties:
             $ref: '#/components/schemas/HTTPToolFunctionParamProperties'
         required:
           title: Required
           type: array
           items:
             type: string
-        additionalProperties:
-          title: Additionalproperties
-          type: boolean
-          default: false
+      additionalProperties: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
title: HTTPToolFunctionParameters
required:
- properties
- required
type: object
properties:
type:
title: Type
enum:
- object
type: string
default: object
properties:
title: Properties
type: object
additionalProperties:
$ref: '#/components/schemas/HTTPToolFunctionParamProperties'
required:
title: Required
type: array
items:
type: string
additionalProperties:
title: Additionalproperties
type: boolean
default: false
HTTPToolResource:
HTTPToolFunctionParameters:
title: HTTPToolFunctionParameters
required:
- properties
- required
type: object
properties:
type:
title: Type
enum:
- object
type: string
default: object
properties:
title: Properties
type: object
additionalProperties:
$ref: '#/components/schemas/HTTPToolFunctionParamProperties'
required:
title: Required
type: array
items:
type: string
additionalProperties: false
HTTPToolResource:
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 3443 to 3469, the
HTTPToolFunctionParameters schema incorrectly places an additionalProperties
field inside the properties object (creating a payload field) instead of at the
schema level; remove the nested additionalProperties entry under properties and
add additionalProperties: false (or keep the existing title/default boolean)
directly under the HTTPToolFunctionParameters schema so the schema forbids extra
properties rather than creating a new property named additionalProperties.

Comment on lines +3896 to 3949
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.

⚠️ Potential issue

ModifyAssistantRequest vs Assistant/Create: finalize alignment.

As noted earlier, align optimization type, add assistant_type, and ensure tool_resources matches Assistant. This avoids partial updates being typed differently than full objects.

See consolidated diff under the Assistant block.

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