Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 20, 2025

Summary by CodeRabbit

  • New Features

    • Added Assistant create/modify/run APIs with optimization options and richer properties (requirements, budget levels, visibility, response language, assistant types).
    • Introduced unified tool ecosystem (HTTP, MCP, FileSearch, WebSearch) plus MCP discovery/workflows.
    • Added vector_store_id support across relevant operations.
    • Enhanced run results with structured errors and outcomes.
  • Refactor

    • Replaced legacy tool enums with a ToolDefinition/ToolResource model and discriminator-based polymorphism.
    • Renamed validation/error structures to HTTPTool*.
    • Updated Assistant.tools to use ToolDefinition.
    • Expanded public enums and schemas for broader interoperability.

@coderabbitai
Copy link

coderabbitai bot commented Sep 20, 2025

Walkthrough

OpenAPI schema updated extensively: adds assistant lifecycle (create/modify/run), refactors tool representations to ToolDefinition/ToolResource with polymorphism, exposes MCP types and discovery, expands assistant fields (requirements, budget, visibility, types), adds web/file search resources, introduces new error shapes, and surfaces vector_store_id in multiple payloads and a GET parameter.

Changes

Cohort / File(s) Summary of changes
Assistant lifecycle schemas
src/libs/AI21/openapi.yaml
Added CreateAssistantRequest, ModifyAssistantRequest, RunAssistantRequest; introduced RunOptimization; expanded Assistant response with requirements, budget, visibility, assistant_type, response_language.
Tool model refactor
src/libs/AI21/openapi.yaml
Replaced AssistantTool with ToolDefinition; introduced ToolResource variants (HTTPToolResource, MCPToolResource, FileSearchToolResource, WebSearchToolResource) with discriminator-based polymorphism; unified tool refs across assistant/runner payloads.
HTTP tool schema renames
src/libs/AI21/openapi.yaml
Deprecated HTTPValidationError; added HTTPToolEndpoint, HTTPToolFunction, HTTPToolResource schemas; updated references throughout.
MCP public exposure
src/libs/AI21/openapi.yaml
Added MCPDefinition, MCPDiscoveryResponse, MCPTool, MCPToolResource; exposed discovery and tool schemas.
Maestro run observables
src/libs/AI21/openapi.yaml
Added MaestroRunError; extended MaestroRunResult with error field; integrated into run-related responses.
Vector store propagation
src/libs/AI21/openapi.yaml
Added public vector_store_id fields to multiple request/response bodies; added vector_store_id parameter to vector-store GET path for regulations demos.
Enums and typing expansions
src/libs/AI21/openapi.yaml
Introduced AssistantType {default, chat, maestro}, BudgetLevel {low, medium, high}, Visibility; updated RetrievalStrategy references via allOf.
Requirements/Dependencies structures
src/libs/AI21/openapi.yaml
Added nested assistant requirements/dependencies referencing language_studio_api_server definitions; integrated into Assistant and requests.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant API as Public API
  participant Assist as Assistant Service
  participant Tools as Tool Registry
  participant HTTP as HTTP Tool
  participant MCP as MCP Tool
  participant FS as File Search
  participant WS as Web Search

  Client->>API: CreateAssistantRequest
  API->>Assist: Create assistant (name, models, tools, requirements, budget)
  Assist-->>API: Assistant
  API-->>Client: Assistant

  Client->>API: RunAssistantRequest (input, options)
  API->>Assist: Run (structured_rag, planning, response_language)
  Assist->>Tools: Resolve ToolDefinition (discriminator)
  alt HTTP tool
    Tools-->>Assist: HTTPToolResource
    Assist->>HTTP: Call endpoint/function
    HTTP-->>Assist: Result
  else MCP tool
    Tools-->>Assist: MCPToolResource
    Assist->>MCP: Invoke tool
    MCP-->>Assist: Result
  else File/Web search
    Tools-->>Assist: FileSearch/WebSearch resource
    Assist->>FS: Query / retrieve
    FS-->>Assist: Docs
    Assist->>WS: Search
    WS-->>Assist: Snippets
  end
  Assist-->>API: Run result or MaestroRunError
  API-->>Client: Response
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as Public API
  participant MCP as MCP Discovery

  Client->>API: MCPDiscovery request
  API->>MCP: Discover (MCPDefinition)
  MCP-->>API: MCPDiscoveryResponse (tools, resources)
  API-->>Client: MCPDiscoveryResponse
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I thump my paws on schema ground,
New tools hop in, polymorphs abound.
Assistants sprout with names and plans,
MCP burrows, shaking hands.
If errors nibble, Maestro squeaks—
Vector trails through docs and peaks.
Carrots of types for future tweaks. 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The PR title "feat:@coderabbitai" is an author/bot tag and does not describe the primary change in the changeset; it gives no clue that this PR is a large OpenAPI refactor introducing unified ToolDefinition/ToolResource models, assistant lifecycle schemas (Create/Modify/RunAssistant), MCP types, new enums, and fields like vector_store_id. Because it fails to summarize the main change or intent, it does not meet the project's title guidance for clarity. Please rename the PR to a short, specific summary of the primary change (for example: "feat(openapi): unify ToolDefinition/ToolResource and add assistant lifecycle (Create/Modify/RunAssistant) + MCP types"); keep it concise and focused so reviewers can quickly understand the intent.
✅ 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_202509200631

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot enabled auto-merge September 20, 2025 06:31
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:OpenAPI: assistant lifecycle, tool model refactor, MCP, new fields Sep 20, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

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

1018-1043: Add UUID format for vector_store_id and define a response schema.

  • Suggest marking vector_store_id as format: uuid.
  • Consider introducing a dedicated response schema instead of type: object to keep the surface stable.
       schema:
         title: Vector Store Id
-        type: string
+        type: string
+        format: uuid
...
       content:
         application/json:
-          schema:
-            title: Response Get Vector Store Studio V1 Demos Regulations Vector Store  Vector Store Id  Get
-            type: object
+          schema:
+            $ref: '#/components/schemas/VectorStoreResponse'

1521-1541: Endpoint looks fine; ensure auth error responses are documented.

Add 401/403 responses for consistency across secured endpoints.

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

1590-1617: PATCH response set is good; mirror 401/403 as well.

Keep auth errors consistent across assistant endpoints.

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

1948-1969: MCP discovery: add minimal validation errors shape examples.

Looks good; optional suggestion to add examples for happy/error paths.


2135-2166: Assistant fields expansion: verify defaults and privacy posture.

  • Default visibility: public may surprise users; consider private by default.
  • Descriptions for id/object mention “request ID” which is misleading for a persisted Assistant.
-        visibility:
+        visibility:
           allOf:
             - $ref: '#/components/schemas/Visibility'
-          default: public
+          default: private

2304-2307: Fix misleading description for vector_store_id in compliance upload.

This is a regulations-compliance endpoint, not RFI.

         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 regulations compliance checks

2723-2756: Add constraints for max_documents; response_language defaults consistent.

  • Set minimum: 1 for max_documents.
         max_documents:
           title: Max Documents
           type: integer
+          minimum: 1

2898-2901: Tooling on Maestro runs: good, but consider consistent budget typing.

budget here is a string enum; elsewhere BudgetLevel is introduced. Consider using BudgetLevel for consistency.

       budget:
-        title: Budget
-        enum:
-          - low
-          - medium
-          - high
-        type: string
+        allOf:
+          - $ref: '#/components/schemas/BudgetLevel'

3307-3363: FileSearchToolResource: add bounds/defaults to avoid undefined behavior.

  • Add 0.0–1.0 bounds to retrieval_similarity_threshold to match other schemas.
  • Add default: 1 and minimum: 1 to max_neighbors.
         retrieval_similarity_threshold:
           title: Retrieval Similarity Threshold
-          type: number
+          type: number
+          minimum: 0.0
+          maximum: 1.0
...
         max_neighbors:
           title: Max Neighbors
-          type: integer
+          type: integer
+          minimum: 1
+          default: 1

3674-3745: MCP types look solid.

Optional: document auth expectations for headers (e.g., reference to Secrets).


3753-3760: MaestroRunError addition LGTM.

Consider adding a machine-readable code field for programmatic handling.

     MaestroRunError:
       title: MaestroRunError
       required:
         - message
       type: object
       properties:
         message:
           title: Message
           type: string
+        code:
+          title: Code
+          type: string

3790-3791: Document when error is present.

Clarify that error is set when status=failed.

     MaestroRunResult:
       properties:
         ...
-        error:
+        error:
           $ref: '#/components/schemas/MaestroRunError'
+      description: error is populated when status is "failed".

3907-3960: ModifyAssistantRequest mostly consistent; align optimization type with Assistant.

Assistant uses string for optimization; prefer RunOptimization across Assistant, Create, and Modify for consistency.

-        optimization:
-          $ref: '#/components/schemas/RunOptimization'
+        optimization:
+          $ref: '#/components/schemas/RunOptimization'
# Follow-up: also align Assistant.optimization and CreateAssistantRequest (see other comments).

4118-4166: RunAssistantRequest: consider allowing input as string (parity with Maestro).

Non-blocking; could improve ergonomics.

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

4348-4355: ToolResource vs AssistantToolResource divergence.

AssistantToolResource includes plan_approval; ToolResource does not. Either document the difference or add parity to avoid confusion.

     ToolResource:
       title: ToolResource
       type: object
       properties:
         file_search:
           $ref: '#/components/schemas/FileSearchToolResource'
         web_search:
           $ref: '#/components/schemas/WebSearchToolResource'
+        plan_approval:
+          title: Plan Approval
+          type: object

4478-4495: WebSearchToolResource: specify at least one of urls or fallback_to_web.

Add validation constraints to prevent empty config.

     WebSearchToolResource:
       type: object
       properties:
         type:
           title: Type
           enum:
             - web_search
           type: string
           default: web_search
         urls:
           title: Urls
           type: array
           items:
             type: string
         fallback_to_web:
           title: Fallback To Web
           type: boolean
+      anyOf:
+        - required: [urls]
+        - required: [fallback_to_web]
📜 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 6b113af.

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

1619-1647: Run endpoint LGTM; consider streaming variant or 202 Accepted for async.

If execution is long-running, returning 202 with polling link can be clearer.


2129-2135: Good move to ToolDefinition; confirm discriminator alignment.

Assistant.tools now references execution_engine ToolDefinition. Ensure all tool objects include a type discriminant matching the oneOf mapping.


2242-2247: AssistantType enum addition looks good.

No issues spotted.


2344-2349: BudgetLevel enum addition LGTM.


2472-2472: ChatRequest.tools now uses chat ToolDefinition – good.

Ensure every tool entry includes type: "function" and valid parameters.


4168-4172: RunOptimization enum LGTM.


4472-4477: Visibility enum LGTM; ensure defaults wired (see Assistant comment).


4638-4654: Assistant Requirement type published – good.

Ensure IDs are UUIDs if that’s the invariant; currently plain string.


4655-4668: Chat ToolDefinition LGTM.


4669-4684: Execution-engine Requirement LGTM.


4685-4698: Execution-engine ToolDefinition discriminator mapping LGTM.

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 shape inconsistencies (must fix).

  • optimization is string here but RunOptimization elsewhere. Align to enum.
  • tool_resources is type: object; elsewhere it’s AssistantToolResource. Align.
  • Missing response_language although present on Assistant and ModifyAssistantRequest.
       optimization:
-        title: Optimization
-        type: string
+        allOf:
+          - $ref: '#/components/schemas/RunOptimization'
...
-      tool_resources:
-        title: Tool Resources
-        type: object
+      tool_resources:
+        $ref: '#/components/schemas/AssistantToolResource'
...
+      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:
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'
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:
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2830 to 2873, the
CreateAssistantRequest schema is inconsistent with other schemas: change the
optimization property from type: string to reference the existing
RunOptimization enum schema; change tool_resources from type: object to
reference the existing AssistantToolResource schema; and add the missing
response_language property with the same schema/ref used by Assistant and
ModifyAssistantRequest (including any default or enum constraints they use) so
the shape matches across definitions.

Comment on lines +3402 to +3495
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:
title: HTTPToolFunction
required:
- status
- count
- name
- description
- parameters
type: object
properties:
name:
title: Name
type: string
description:
title: Description
type: string
parameters:
$ref: '#/components/schemas/HTTPToolFunctionParameters'
HTTPToolFunctionParamProperties:
title: HTTPToolFunctionParamProperties
required:
- type
- description
type: object
properties:
type:
title: Type
type: string
description:
title: Description
type: string
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:
title: Additionalproperties
type: boolean
default: false
HTTPToolResource:
title: HTTPToolResource
required:
- function
- endpoint
type: object
properties:
type:
title: Type
enum:
- http
type: string
default: http
function:
$ref: '#/components/schemas/HTTPToolFunction'
endpoint:
$ref: '#/components/schemas/HTTPToolEndpoint'
HTTPValidationError:
title: HTTPValidationError
type: object
properties:
detail:
title: Detail
type: array
items:
$ref: '#/components/schemas/ValidationError'
IgnestionBatchStatusCount:
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 shapes: add HTTP method, timeout, and retry/backoff fields.

Without these, calls risk hanging or being unsafe.

     HTTPToolEndpoint:
       title: HTTPToolEndpoint
       required:
-        - url
+        - url
+        - method
       type: object
       properties:
         url:
           title: Url
           type: string
+        method:
+          title: Method
+          enum: [GET, POST, PUT, PATCH, DELETE]
+          type: string
+          default: POST
+        timeout_seconds:
+          title: Timeout Seconds
+          type: number
+          minimum: 0.1
+          default: 30
         headers:
           title: Headers
           type: object
+        retry:
+          title: Retry
+          type: object
+          properties:
+            max_attempts:
+              type: integer
+              minimum: 0
+              default: 2
+            backoff_seconds:
+              type: number
+              minimum: 0
+              default: 0.5
📝 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: 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:
title: HTTPToolFunction
required:
- status
- count
- name
- description
- parameters
type: object
properties:
name:
title: Name
type: string
description:
title: Description
type: string
parameters:
$ref: '#/components/schemas/HTTPToolFunctionParameters'
HTTPToolFunctionParamProperties:
title: HTTPToolFunctionParamProperties
required:
- type
- description
type: object
properties:
type:
title: Type
type: string
description:
title: Description
type: string
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:
title: Additionalproperties
type: boolean
default: false
HTTPToolResource:
title: HTTPToolResource
required:
- function
- endpoint
type: object
properties:
type:
title: Type
enum:
- http
type: string
default: http
function:
$ref: '#/components/schemas/HTTPToolFunction'
endpoint:
$ref: '#/components/schemas/HTTPToolEndpoint'
HTTPValidationError:
title: HTTPValidationError
type: object
properties:
detail:
title: Detail
type: array
items:
$ref: '#/components/schemas/ValidationError'
IgnestionBatchStatusCount:
HTTPToolEndpoint:
title: HTTPToolEndpoint
required:
- url
- method
type: object
properties:
url:
title: Url
type: string
method:
title: Method
enum:
- GET
- POST
- PUT
- PATCH
- DELETE
type: string
default: POST
timeout_seconds:
title: Timeout Seconds
type: number
minimum: 0.1
default: 30
headers:
title: Headers
type: object
retry:
title: Retry
type: object
properties:
max_attempts:
type: integer
minimum: 0
default: 2
backoff_seconds:
type: number
minimum: 0
default: 0.5
HTTPToolFunction:
title: HTTPToolFunction
required:
- name
- description
- parameters
type: object
properties:
name:
title: Name
type: string
description:
title: Description
type: string
parameters:
$ref: '#/components/schemas/HTTPToolFunctionParameters'
HTTPToolFunctionParamProperties:
title: HTTPToolFunctionParamProperties
required:
- type
- description
type: object
properties:
type:
title: Type
type: string
description:
title: Description
type: string
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:
title: Additionalproperties
type: boolean
default: false
HTTPToolResource:
title: HTTPToolResource
required:
- function
- endpoint
type: object
properties:
type:
title: Type
enum:
- http
type: string
default: http
function:
$ref: '#/components/schemas/HTTPToolFunction'
endpoint:
$ref: '#/components/schemas/HTTPToolEndpoint'
HTTPValidationError:
title: HTTPValidationError
type: object
properties:
detail:
title: Detail
type: array
items:
$ref: '#/components/schemas/ValidationError'
IgnestionBatchStatusCount:
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 3402-3495, the HTTP tool schema lacks
method, timeout and retry/backoff settings; update the HTTPToolEndpoint schema
to add optional properties: method (string enum: GET, POST, PUT, PATCH, DELETE,
HEAD, OPTIONS), timeout_ms (integer, >=0) to cap request duration, retries
(integer, >=0) to control retry attempts, and retry_backoff (object) with fields
like strategy (enum: fixed, exponential), base_delay_ms (integer), max_delay_ms
(integer) and multiplier (number) to configure backoff behavior; ensure these
new properties are documented, typed, not required (so existing callers are
compatible), and include sensible defaults where appropriate (e.g., timeout_ms
default 30000, retries default 0, strategy default fixed).

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

Choose a reason for hiding this comment

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

⚠️ Potential issue

Typo in schema name: Ignestion ➜ Ingestion (breaking for clients).

Rename the schema and update references (e.g., in IngestionBatchStatusResponse.statuses.items).

-    IgnestionBatchStatusCount:
-      title: IgnestionBatchStatusCount
+    IngestionBatchStatusCount:
+      title: IngestionBatchStatusCount
...
-            $ref: '#/components/schemas/IgnestionBatchStatusCount'
+            $ref: '#/components/schemas/IngestionBatchStatusCount'
📝 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: IgnestionBatchStatusCount
required:
- status
- count
type: object
title: IngestionBatchStatusCount
required:
- status
- count
type: object
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 3496-3500, the schema name
"IgnestionBatchStatusCount" is misspelled and must be renamed to
"IngestionBatchStatusCount"; update the components.schemas key to the correct
name and then find and replace all $ref references (for example
IngestionBatchStatusResponse.statuses.items and any other occurrences) to point
to components/schemas/IngestionBatchStatusCount, ensuring required/fields remain
unchanged and the OpenAPI refs validate after the rename.

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