-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Update AI21 OpenAPI: new endpoints, schema overhaul, MCP/HTTP tools #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughOpenAPI spec in src/libs/AI21/openapi.yaml updated to add new endpoints, overhaul tool/assistant schemas, introduce MCP and HTTP tool models, extend Maestro results, and add vector store fields. Assistant create/modify/run flows and tool definitions were restructured with new enums and language-wrapped schemas. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant API as Studio API
participant Assist as Assistant Service
participant Exec as Execution Engine
participant Tools as Tools (HTTP/File/Web/MCP)
participant Maestro as Maestro
rect rgb(240,248,255)
note over Client,API: Assistant lifecycle (create → modify → run)
Client->>API: POST /studio/v1/assistants (CreateAssistantRequest)
API->>Assist: Create assistant (schemas, tools, requirements)
Assist-->>API: Assistant created (id)
API-->>Client: 201 Assistant
Client->>API: PATCH /studio/v1/assistants/{id} (ModifyAssistantRequest)
API->>Assist: Update assistant config
Assist-->>API: Updated assistant
API-->>Client: 200 Assistant
end
rect rgb(245,255,245)
note over Client,API: Run flow
Client->>API: POST /studio/v1/assistants/{id}/run (RunAssistantRequest)
API->>Exec: Start run (tools, optimization, flags)
Exec->>Tools: Invoke tool(s) as defined (HTTP/File/Web/MCP)
Tools-->>Exec: Tool responses
Exec->>Maestro: Orchestrate run (may error)
Maestro-->>Exec: Result or MaestroRunError
Exec-->>API: Run result (possibly error)
API-->>Client: 200 Run result
end
sequenceDiagram
autonumber
actor Client
participant API as Studio API
participant MCP as MCP Integration
rect rgb(255,250,240)
note over Client,API: MCP tool discovery
Client->>API: POST /studio/v1/mcp/discover
API->>MCP: Discover tools (MCPDefinition)
MCP-->>API: MCPDiscoveryResponse (MCPTool list)
API-->>Client: 200 MCPDiscoveryResponse
end
sequenceDiagram
autonumber
actor Client
participant API as Studio API
participant Vec as Vector Store Service
rect rgb(250,250,255)
note over Client,API: Vector store fetch
Client->>API: GET /.../vector-store/{vector_store_id}
API->>Vec: Fetch vector store by id
Vec-->>API: Vector store details
API-->>Client: 200 Vector store
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60–90 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests
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. Comment |
There was a problem hiding this 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 (2)
src/libs/AI21/openapi.yaml (2)
3496-3507
: Typo in public schema name: IgnestionBatchStatusCount.Rename to IngestionBatchStatusCount and update references.
- IgnestionBatchStatusCount: + IngestionBatchStatusCount: title: IngestionBatchStatusCount @@ - $ref: '#/components/schemas/IgnestionBatchStatusCount' + $ref: '#/components/schemas/IngestionBatchStatusCount'Also applies to: 3528-3529
1-4703
: Fix enum casing and schema-name typo in src/libs/AI21/openapi.yaml
- Budget enum mismatch — BudgetLevel uses lowercase (low/medium/high) but some usages use uppercase (e.g., "LOW, MEDIUM, or HIGH" and default: MEDIUM). Update descriptions/defaults to lowercase to match enum. Locations: src/libs/AI21/openapi.yaml lines 2284–2285, 2303.
- Typo in schema name — rename IgnestionBatchStatusCount → IngestionBatchStatusCount and update all $ref occurrences. Definition at lines 3495–3496; example ref at 3528.
- Verify casing of inputSchema in MCPTool (found at lines 3706, 3715) matches the external contract; normalize if it should be snake_case.
- Verification note: the automated check for empty response schemas (responses with schema: {}) failed due to a quoting error in the earlier script — re-run the empty-response check with a corrected pattern.
🧹 Nitpick comments (11)
src/libs/AI21/openapi.yaml (11)
1619-1647
: Run Assistant should be async-friendly (202) and document idempotency.Long-running runs benefit from 202 Accepted and an execution URL. Consider adding 202 and Location header behavior.
- responses: - '200': + responses: + '202': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/MaestroRunResult'
1948-1969
: MCP discover: casing and rate limiting.Title says “Mcp”; prefer “MCP”. Also document rate limits and auth expectations (Bearer vs additional headers).
- summary: Mcp Tool Discovery + summary: MCP Tool Discovery
2282-2286
: Budget default case mismatch (MEDIUM vs enum 'medium').Bodies use default: MEDIUM (uppercase), but BudgetLevel enum values are lowercase. Unify to lowercase or switch to BudgetLevel ref.
- budget: - title: Budget - type: string - description: 'Budget level: LOW, MEDIUM, or HIGH' - default: MEDIUM + budget: + allOf: [ { $ref: '#/components/schemas/BudgetLevel' } ] + default: mediumRepeat this change for upload_check_compliance payload.
Also applies to: 2301-2304
2723-2729
: ConversationalRagConfig: add bounds.Add minimums for max_documents and 0–1 for thresholds to prevent invalid inputs.
- max_documents: - title: Max Documents - type: integer + max_documents: + title: Max Documents + type: integer + minimum: 1Also applies to: 2753-2756
3307-3363
: FileSearchToolResource: add minimums and format hints.Suggest minimum: 0 for retrieval_similarity_threshold (<=1), and file_ids as uuid format if applicable.
- retrieval_similarity_threshold: + retrieval_similarity_threshold: title: Retrieval Similarity Threshold type: number + minimum: 0 + maximum: 1 @@ - file_ids: + file_ids: title: File Ids type: array items: - type: string + type: string + format: uuid
2830-2873
: CreateAssistantRequest: parity with Assistant and ModifyAssistant.
- Use RunOptimization for optimization.
- Reuse AssistantToolResource for tool_resources.
- Consider exposing response_language here too for symmetry.
- optimization: - title: Optimization - type: string + optimization: + $ref: '#/components/schemas/RunOptimization' @@ - tool_resources: - title: Tool Resources - type: object + tool_resources: + $ref: '#/components/schemas/AssistantToolResource' + response_language: + $ref: '#/components/schemas/Assistant/properties/response_language'
3674-3745
: MCP schemas: field naming consistency.Prefer snake_case (input_schema) to match the rest of the spec; today MCPTool.inputSchema breaks style.
- inputSchema: + input_schema: title: Inputschema type: objectIf clients already depend on inputSchema, add both via allOf/oneOf or document aliasing before changing.
4118-4166
: RunAssistantRequest: tighten input and includes.
- Add minItems: 1 to input.
- Consider enum for include values to prevent typos.
input: title: Input type: array items: $ref: '#/components/schemas/Message' + minItems: 1
4348-4355
: ToolResource: consider MCP/http resource slots if needed.If runs need to pass per-run MCP/http resources, mirror these here; otherwise document why only file/web are allowed.
115-119
: Large default limit (500000) on listing files.Risky for performance. Drop default to e.g., 100 and add pagination guidance.
- default: 500000 + default: 100
3402-3413
: HTTPToolEndpoint: missing method/timeout/auth fields.Add method (GET/POST/PUT/DELETE), timeout_ms, and optional auth reference for safe external calls.
HTTPToolEndpoint: title: HTTPToolEndpoint required: - url type: object properties: url: title: Url type: string + method: + title: Method + enum: [GET, POST, PUT, DELETE, PATCH] + type: string + default: GET + timeout_ms: + title: Timeout Ms + type: integer + minimum: 1 + default: 10000 + headers: title: Headers type: object
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ 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)
2132-2167
: Assistant schema: new fields LGTM; watch default/value mismatches elsewhere.Good move to ToolDefinition union and response_language default. Ensure all request bodies (Create/Modify/Run) accept the same enum values for response_language.
2304-2307
: Copy-paste description: RFI mention in compliance endpoint.Change “RFI processing” to “compliance processing”.
[raise_nitpick_issue]- description: Vector store ID to use for RFI processing + description: Vector store ID to use for compliance processing
3487-3495
: HTTPValidationError: OK.Schema shape is standard and consistent with prior usage.
2898-2901
: CreateMaestroRunsPayload.tool_resources now typed: good.Switch to ToolResource is an improvement for validation and docs.
3790-3791
: MaestroRunResult.error: good addition.Capturing run-level error improves debuggability.
2242-2247
: New enums (AssistantType, Visibility): LGTM.Values and defaults align with endpoints.
Also applies to: 4472-4477
2472-2473
: ChatRequest.tools ToolDefinition wrapper: LGTM.Separation between chat vs execution_engine tool defs is clear.
3867-3873
: ModelName additions: verify against backend.Ensure these IDs exist server-side to avoid 422s.
'/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 | ||
responses: | ||
'200': | ||
description: Successful Response | ||
content: | ||
application/json: | ||
schema: | ||
title: Response Get Vector Store Studio V1 Demos Regulations Vector Store Vector Store Id Get | ||
type: object | ||
'422': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a VectorStore schema and add 404 for not found.
200 currently returns a generic object; expose a typed schema (e.g., VectorStore) and add a 404 response for unknown IDs.
Apply:
'/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
@@
responses:
- '200':
+ '200':
description: Successful Response
content:
application/json:
schema:
- title: Response Get Vector Store Studio V1 Demos Regulations Vector Store Vector Store Id Get
- type: object
+ $ref: '#/components/schemas/VectorStore'
+ '404':
+ description: Not Found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/HTTPValidationError'
And under components.schemas:
+ VectorStore:
+ title: VectorStore
+ type: object
+ required: [id, name, created_at]
+ properties:
+ id: { type: string }
+ name: { type: string }
+ metadata: { type: object }
+ created_at: { type: string, format: date-time }
📝 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.
'/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 | |
responses: | |
'200': | |
description: Successful Response | |
content: | |
application/json: | |
schema: | |
title: Response Get Vector Store Studio V1 Demos Regulations Vector Store Vector Store Id Get | |
type: object | |
'422': | |
'/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 | |
responses: | |
'200': | |
description: Successful Response | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/VectorStore' | |
'404': | |
description: Not Found | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/HTTPValidationError' | |
'422': |
'/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 | |
responses: | |
'200': | |
description: Successful Response | |
content: | |
application/json: | |
schema: | |
title: Response Get Vector Store Studio V1 Demos Regulations Vector Store Vector Store Id Get | |
type: object | |
'422': | |
components: | |
schemas: | |
VectorStore: | |
title: VectorStore | |
type: object | |
required: | |
- id | |
- name | |
- created_at | |
properties: | |
id: | |
type: string | |
name: | |
type: string | |
metadata: | |
type: object | |
created_at: | |
type: string | |
format: date-time |
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 1018 to 1038, the GET
/studio/v1/demos/regulations/vector-store/{vector_store_id} response uses a
generic object for 200 and lacks a 404; define a concrete VectorStore schema
under components.schemas and change the 200 response schema to reference that
VectorStore ($ref: '#/components/schemas/VectorStore'), then add a 404 response
with a suitable error schema or a simple message schema reference (e.g.,
'#/components/schemas/Error' or a small object with code/message) to represent
"not found".
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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CreateAssistant: use enums consistently and return 201.
- optimization should reuse RunOptimization, not raw string.
- tool_resources should reuse AssistantToolResource for parity with Assistant.
- Prefer 201 for creation.
post:
summary: Create Assistant
@@
- application/json:
- schema:
- $ref: '#/components/schemas/CreateAssistantRequest'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateAssistantRequest'
@@
- responses:
- '200':
+ responses:
+ '201':
description: Successful Response
And in CreateAssistantRequest:
- optimization:
- title: Optimization
- type: string
+ optimization:
+ $ref: '#/components/schemas/RunOptimization'
@@
- tool_resources:
- title: Tool Resources
- type: object
+ tool_resources:
+ $ref: '#/components/schemas/AssistantToolResource'
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
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' |
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' | |
components: | |
schemas: | |
CreateAssistantRequest: | |
type: object | |
properties: | |
- optimization: | |
- title: Optimization | |
optimization: | |
$ref: '#/components/schemas/RunOptimization' | |
- tool_resources: | |
- title: Tool Resources | |
tool_resources: | |
$ref: '#/components/schemas/AssistantToolResource' | |
# … other properties … |
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 1520 to 1541, the Create Assistant
operation uses raw strings and wrong types and returns 200; update the POST to
return HTTP 201 for resource creation, change the CreateAssistantRequest schema
to reference the existing RunOptimization enum/type for the optimization field
(instead of a raw string), and change tool_resources to reuse the
AssistantToolResource schema (same type used by Assistant) so types are
consistent with Assistant; make corresponding adjustments inside the
CreateAssistantRequest definition to use those referenced components.
summary: Modify Assistant | ||
operationId: v1_modify_assistant | ||
parameters: | ||
- name: assistant_id | ||
in: path | ||
required: true | ||
schema: | ||
title: Assistant Id | ||
type: string | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/ModifyAssistantRequest' | ||
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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ModifyAssistant: align Assistant.optimization type with enum.
Assistant.optimization (Line 2103) is string, but ModifyAssistantRequest.optimization uses RunOptimization. Make Assistant.optimization also RunOptimization for consistency.
- optimization:
- title: Optimization
- type: string
+ optimization:
+ $ref: '#/components/schemas/RunOptimization'
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 1590-1617 (ModifyAssistant operation)
and the Assistant schema at line ~2103, the Assistant.optimization property is
defined as type: string while ModifyAssistantRequest.optimization uses the
RunOptimization enum; update the Assistant schema so its optimization property
references the same RunOptimization schema (use $ref:
'#/components/schemas/RunOptimization' or the appropriate path) instead of plain
string to keep types consistent across request and response models, and validate
any required enum naming/nullable options match the ModifyAssistantRequest
definition.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTTPToolFunctionParameters: incorrect use of additionalProperties.
Currently modeled as a property; it should be a schema keyword at the root. This breaks validation.
HTTPToolFunctionParameters:
title: HTTPToolFunctionParameters
required:
- properties
- required
type: object
- properties:
+ additionalProperties: false
+ properties:
type:
title: Type
enum:
- object
type: string
default: object
@@
- additionalProperties:
- title: Additionalproperties
- type: boolean
- default: false
Also consider adding an HTTP method enum and timeout fields to HTTPToolEndpoint for safety.
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 3402 to 3486, the
HTTPToolFunctionParameters schema incorrectly defines additionalProperties as a
property inside "properties" instead of as a schema-level keyword — move the
"additionalProperties" entry out of the "properties" block to be directly under
HTTPToolFunctionParameters (type: object) with its boolean value and
default:false so OpenAPI validation works; additionally, extend HTTPToolEndpoint
by adding a "method" property with an enum of allowed HTTP verbs (e.g., GET,
POST, PUT, DELETE, PATCH, HEAD, OPTIONS) and a "timeout" property (integer or
number, e.g., seconds or ms) to provide safety/timeouts for requests.
Summary by CodeRabbit
New Features
Refactor