feat:Add assistant and MCP endpoints; refactor tools; schema updates#168
feat:Add assistant and MCP endpoints; refactor tools; schema updates#168HavenDV wants to merge 1 commit into
Conversation
WalkthroughExtends the OpenAPI spec by adding assistant management and MCP discovery endpoints, introducing new schemas and enums, refactoring tool resources to a multi-type model, replacing a monolithic Requirement schema with context-specific variants, updating retrieval configs, and adding vector_store_id fields to relevant request bodies. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant API as Studio API
participant Assist as Assistant Service
Note over Client,Assist: Create Assistant
Client->>API: POST /studio/v1/assistants (CreateAssistantRequest)
API->>Assist: Validate + create Assistant
Assist-->>API: Assistant
API-->>Client: 201 Assistant or 422 ValidationError
sequenceDiagram
autonumber
actor Client
participant API as Studio API
participant Assist as Assistant Service
Note over Client,Assist: Modify Assistant
Client->>API: PATCH /studio/v1/assistants/{assistant_id} (ModifyAssistantRequest)
API->>Assist: Apply updates
Assist-->>API: Assistant
API-->>Client: 200 Assistant or 422 ValidationError
sequenceDiagram
autonumber
actor Client
participant API as Studio API
participant MCP as MCP Discovery
Note over Client,MCP: MCP Tool Discovery
Client->>API: POST /studio/v1/mcp/discover (MCPDefinition)
API->>MCP: Discover tools/resources
MCP-->>API: MCPDiscoveryResponse
API-->>Client: 200 MCPDiscoveryResponse or 422 ValidationError
sequenceDiagram
autonumber
actor Client
participant API as Studio API
participant Vec as Vector Store
Note over Client,Vec: Fetch Vector Store
Client->>API: GET /studio/v1/demos/regulations/vector-store/{id}
API->>Vec: Lookup by id
Vec-->>API: VectorStore
API-->>Client: 200 VectorStore
sequenceDiagram
autonumber
actor Client
participant API as Studio API
participant Proc as Processing Service
participant VS as Vector Store
Note over Client,VS: Processing with vector_store_id
Client->>API: POST upload_check_compliance/process_rfi_document (… vector_store_id)
API->>Proc: Start processing (with vector_store_id)
Proc->>VS: Read/Write embeddings & docs
Proc-->>API: Result
API-->>Client: 200 Result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
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.
Actionable comments posted: 3
🧹 Nitpick comments (9)
src/libs/AI21/openapi.yaml (9)
1520-1541: Use 201 Created and add auth errors for POST /assistants.Creation should return 201; also include 401/403. Keeps semantics and client expectations clear.
Apply:
responses: - '200': + '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Assistant' + '401': + description: Unauthorized + '403': + description: Forbidden '422': description: Validation Error
2239-2244: vector_store_id fields: add uuid format.Likely a uuid; add format constraints for better validation.
vector_store_id: title: Vector Store Id type: string + format: uuidAlso applies to: 2259-2262
2677-2710: ConversationalRagConfig: add min for max_documents, keep enum default.Good move to allOf on RetrievalStrategy. Add minimum: 1 to max_documents to avoid 0/negatives.
max_documents: title: Max Documents type: integer + minimum: 1
3270-3332: FileSearchToolResource: add uuid format + bounds.
- file_ids likely uuids.
- Add bounds for thresholds and alphas.
file_ids: title: File Ids type: array items: - type: string + type: string + format: uuid retrieval_similarity_threshold: title: Retrieval Similarity Threshold type: number - default: 0 + minimum: 0.0 + maximum: 1.0 + default: 0.0 hybrid_search_alpha: title: Hybrid Search Alpha type: number - default: 1 + minimum: 0.0 + maximum: 1.0 + default: 1.0
4388-4405: WebSearchToolResource: consider url format and clarify fallback semantics.
- urls: string items should set format: uri.
- Add a short description for fallback_to_web.
urls: title: Urls type: array items: - type: string + type: string + format: uri fallback_to_web: title: Fallback To Web type: boolean + description: If true, perform general web search when provided urls yield no results.
3371-3382: HTTPToolEndpoint.headers: constrain values to strings.OpenAPI “object” without value schema is too loose.
properties: headers: title: Headers - type: object + type: object + additionalProperties: + type: string
3412-3437: HTTPToolFunctionParameters: “additionalProperties” should be schema-level, not a data field.Right now it’s modeled as a user field. If intention is to express JSON Schema metadata, move it outside “properties”; otherwise rename to avoid confusion.
Two options:
- Schema metadata (preferred):
HTTPToolFunctionParameters: type: object - properties: + additionalProperties: false + properties: type: enum: [object] default: object properties: type: object additionalProperties: $ref: '#/components/schemas/HTTPToolFunctionParamProperties' required: type: array items: { type: string } - additionalProperties: - title: Additionalproperties - type: boolean - default: false
- Or keep as data but rename:
- additionalProperties: + allow_additional_properties: title: Additionalproperties type: boolean default: false
3643-3657: MCPDefinition/Resource: add uri formats and headers typing.server_url should be uri; headers should constrain values.
MCPDefinition: properties: server_url: type: string + format: uri headers: - type: object + type: object + additionalProperties: + type: string MCPToolResource: properties: server_url: type: string + format: uri headers: - type: object + type: object + additionalProperties: + type: stringAlso applies to: 3688-3713
1917-1939: /mcp/discover: add auth errors and 4xx for invalid server.Add 401/403 and a 424/502/504 if discovery depends on external MCP server availability.
responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/MCPDiscoveryResponse' + '401': + description: Unauthorized + '403': + description: Forbidden + '424': + description: Failed Dependency (MCP server not reachable) '422': description: Validation Error
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (111)
src/libs/AI21/Generated/AI21..JsonSerializerContext.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Ai21Api.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Ai21Api.McpToolDiscoveryStudioV1McpDiscoverPost.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Ai21Api.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Ai21Api.V1CreateAssistant.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Ai21Api.V1MaestroRun.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Ai21Api.V1ModifyAssistant.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.IAi21Api.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.IAi21Api.McpToolDiscoveryStudioV1McpDiscoverPost.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.IAi21Api.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.IAi21Api.V1ConversationalRag.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.IAi21Api.V1CreateAssistant.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.IAi21Api.V1MaestroRun.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.IAi21Api.V1ModifyAssistant.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.BudgetLevel.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.BudgetLevelNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.CreateMaestroRunsPayloadToolDiscriminatorType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.CreateMaestroRunsPayloadToolDiscriminatorTypeNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceLabelsFilterMode.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceLabelsFilterModeNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceResponseLanguage.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceResponseLanguageNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceTypeNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolFunctionParametersType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolFunctionParametersTypeNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolResourceType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolResourceTypeNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.MCPToolResourceType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.MCPToolResourceTypeNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.RunOptimization.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.RunOptimizationNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.ToolsItem.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.Visibility.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.VisibilityNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.WebSearchToolResourceType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.WebSearchToolResourceTypeNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.Assistant.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.BudgetLevel.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.ConversationalRagConfigResponseLanguage.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.ConversationalRagConfigRetrievalStrategy.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestTool.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestTool.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestToolResources.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestToolResources.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadResponseLanguage.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadToolDiscriminator.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadToolDiscriminator.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadToolDiscriminatorType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.FileSearchToolResourceLabelsFilterMode.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.FileSearchToolResourceResponseLanguage.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.FileSearchToolResourceType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolResource.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolResource.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.HTTPToolResourceType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPDefinition.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPDefinition.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPTool.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPTool.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPToolResource.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPToolResource.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MCPToolResourceType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestTool.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestTool.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.RunOptimization.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.ToolResource.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.ToolResource.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.ToolsItem.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.ToolsItem.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.Visibility.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.WebSearchToolResourceType.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/AI21/openapi.yaml(20 hunks)
🔇 Additional comments (9)
src/libs/AI21/openapi.yaml (9)
1589-1617: PATCH /assistants: align request schema and expand error surface.Looks fine. Recommend adding 401/403/404 to document common failures (unauthenticated, forbidden, not found).
Apply:
responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Assistant' + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found '422': description: Validation Error
2106-2119: Assistant.requirements/budget/visibility: LGTM; defaults consistent.Defaults use new enums; no blockers.
2850-2862: Maestro tools discriminator: solid. Ensure “type” is required in all variants.All variants include type with enum+default; mark “type” required to strengthen discrimination.
If generation allows, add “required: [type]” to each of HTTPToolResource, MCPToolResource, FileSearchToolResource, WebSearchToolResource.
2863-2864: tool_resources: good rename to ToolResource.Consistent with multi-type resources. No issues.
Also applies to: 4258-4265
3658-3670: MCP discovery shapes: LGTM.Names and required fields look good; no blocking issues.
Also applies to: 3672-3687
3865-3905: ModifyAssistantRequest: strong typing is consistent.Good use of RunOptimization/BudgetLevel/Visibility here.
4382-4387: Visibility enum: LGTM.Matches usage and defaults.
4548-4564: Split Requirement types: good separation; consider adding ids/formats.Assistant variant includes id; execution_engine lacks id; confirm that’s intentional. If ids are uuids, add format.
Suggested (only if applicable):
language_studio_api_server__data_types__assistant__Requirement: properties: id: - type: string + type: string + format: uuidAlso applies to: 4565-4580
2917-2920: response_language “unset” default: consistent across schemas.Good addition; ensure clients document this value.
Also applies to: 2707-2710
| '/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': | ||
| description: Validation Error | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/HTTPValidationError' |
There was a problem hiding this comment.
Vector store GET: add uuid format + 404 and a typed schema.
The path parameter should be uuid; response type should reference a concrete schema; add 404.
parameters:
- name: vector_store_id
in: path
required: true
schema:
title: Vector Store Id
- type: string
+ type: string
+ format: uuid
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
'422':
description: Validation ErrorAnd add the schema:
components:
schemas:
+ VectorStore:
+ title: VectorStore
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ name:
+ type: string
+ created_at:
+ type: string
+ format: date-time
+ metadata:
+ type: object📝 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': | |
| description: Validation Error | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/HTTPValidationError' | |
| '/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 | |
| format: uuid | |
| responses: | |
| '200': | |
| description: Successful Response | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/VectorStore' | |
| '404': | |
| description: Not Found | |
| '422': | |
| description: Validation Error | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/HTTPValidationError' | |
| components: | |
| schemas: | |
| VectorStore: | |
| title: VectorStore | |
| type: object | |
| properties: | |
| id: | |
| type: string | |
| format: uuid | |
| name: | |
| type: string | |
| created_at: | |
| type: string | |
| format: date-time | |
| metadata: | |
| type: object |
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 1018 to 1043, the GET vector-store
endpoint is missing a uuid format on the path parameter, lacks a 404 response,
and the 200 response uses an inline generic object instead of a concrete schema;
update the parameter schema to include format: uuid, change the 200 response to
reference a new components/schemas/VectorStore (or similarly named) schema, add
a 404 response with a suitable error schema reference (e.g., HTTPNotFound or
ProblemDetails), and add the VectorStore schema under components/schemas
defining the expected typed properties for a vector store (id: string, name:
string, created_at, etc.) to match the API contract.
| title: BudgetLevel | ||
| enum: | ||
| - low | ||
| - medium | ||
| - high | ||
| description: An enumeration. |
There was a problem hiding this comment.
Normalize Budget enum usage and defaults.
BudgetLevel is lower-case (low|medium|high), but Body_process_rfi_document/Body_upload_check_compliance use uppercase string defaults and free-form string types. Reference the enum and default to “medium”.
- Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post:
+ Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post:
properties:
budget:
- title: Budget
- type: string
- description: 'Budget level: LOW, MEDIUM, or HIGH'
- default: MEDIUM
+ allOf:
+ - $ref: '#/components/schemas/BudgetLevel'
+ description: 'Budget level'
+ default: medium
- Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post:
+ Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post:
properties:
budget:
- title: Budget
- type: string
- default: MEDIUM
+ allOf:
+ - $ref: '#/components/schemas/BudgetLevel'
+ default: mediumAlso applies to: 2235-2240, 2259-2262
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2298-2303 (also apply same fixes at
2235-2240 and 2259-2262): the BudgetLevel enum is defined with lowercase values
(low|medium|high) but referenced schemas use free-form strings and uppercase
defaults; update those schemas (Body_process_rfi_document and
Body_upload_check_compliance) to reference the BudgetLevel enum via $ref (or use
enum: [low, medium, high]) and set the default to "medium" (lowercase),
replacing any uppercase default values and removing loose string types so they
validate against the enum.
| 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: | ||
| type: object | ||
| additionalProperties: | ||
| $ref: '#/components/schemas/AssistantTool' | ||
| 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 | ||
| CreateMaestroRunsPayload: |
There was a problem hiding this comment.
CreateAssistantRequest: fix type mismatches for optimization and tool_resources.
- optimization is string here but RunOptimization elsewhere.
- tool_resources is a raw object here but Assistant/Modify use AssistantToolResource.
properties:
optimization:
- title: Optimization
- type: string
+ $ref: '#/components/schemas/RunOptimization'
tool_resources:
- title: Tool Resources
- type: object
+ $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.
| 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: | |
| type: object | |
| additionalProperties: | |
| $ref: '#/components/schemas/AssistantTool' | |
| 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 | |
| CreateMaestroRunsPayload: | |
| title: CreateAssistantRequest | |
| required: | |
| - name | |
| type: object | |
| properties: | |
| name: | |
| title: Name | |
| type: string | |
| description: | |
| title: Description | |
| type: string | |
| optimization: | |
| $ref: '#/components/schemas/RunOptimization' | |
| avatar: | |
| title: Avatar | |
| type: string | |
| models: | |
| title: Models | |
| type: array | |
| items: | |
| type: string | |
| tools: | |
| title: Tools | |
| type: array | |
| items: | |
| type: object | |
| additionalProperties: | |
| $ref: '#/components/schemas/AssistantTool' | |
| 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 | |
| CreateMaestroRunsPayload: |
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2784 to 2825, the
CreateAssistantRequest schema has type mismatches: change the optimization
property from type: string to reference the existing RunOptimization schema (use
$ref: '#/components/schemas/RunOptimization' or the correct path to the
RunOptimization schema), and change tool_resources from a generic object to
reference the AssistantToolResource schema used elsewhere (e.g. replace type:
object with $ref: '#/components/schemas/AssistantToolResource'); keep other
properties as-is.
Summary by CodeRabbit