-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Add Studio Assistant endpoints, MCP discovery, vector-store fetch #197
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
WalkthroughAdds multiple new Studio Assistant endpoints, MCP discovery, and a vector-store fetch. Overhauls tool/resource schemas with a new discriminated union, introduces new request/response models, enums, and requirement types, and wires vector_store_id into certain demo payloads. Updates Assistant and run payloads to use new tool/resource definitions. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant API as Studio API
participant Assist as Assistant Service
participant Plan as Plans/Routes
participant Exec as Execution Engine
rect rgb(240,248,255)
note over Client,API: Create Assistant
Client->>API: POST /studio/v1/assistants (CreateAssistantRequest)
API->>Assist: Create
Assist-->>API: Assistant
API-->>Client: Assistant
end
rect rgb(248,250,240)
note over Client,API: Run Assistant
Client->>API: POST /studio/v1/assistants/{id}/run (RunAssistantRequest)
API->>Plan: Fetch plan/routes
API->>Exec: Execute with tools (http/mcp/file_search/web_search)
Exec-->>API: MaestroRunResult
API-->>Client: MaestroRunResult
end
sequenceDiagram
autonumber
actor Client
participant API as Studio API
participant MCP as MCP Server
rect rgb(240,240,255)
note over Client,API: MCP Discovery
Client->>API: POST /studio/v1/mcp/discover (MCPDefinition)
API->>MCP: Discover tools (server_url, headers)
MCP-->>API: Tools metadata
API-->>Client: MCPDiscoveryResponse
end
sequenceDiagram
autonumber
actor Client
participant API as Demos API
participant VS as Vector Store
rect rgb(255,248,240)
note over Client,API: Vector Store Lookup
Client->>API: GET /demos/regulations/vector-store/{vector_store_id}
API->>VS: Fetch by id
VS-->>API: Vector store data
API-->>Client: Vector store data
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
🧹 Nitpick comments (8)
src/libs/AI21/openapi.yaml (8)
1018-1043
: Add 404 and a concrete schema for vector store.Return 404 when the vector store isn’t found and reference a typed schema (e.g., VectorStore) instead of an untyped object for 200.
Apply:
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'
1520-1541
: Response codes for create/run; consider async 202.
- Create Assistant should return 201 Created (and optionally Location), not 200.
- Run Assistant appears async (status can be in_progress). Consider 202 Accepted with polling, or document sync semantics.
- '200': + '201': description: Successful Response- '200': + '202': description: AcceptedAlso applies to: 1590-1617, 1619-1647
1948-1969
: MCP discovery: validate URL format.Mark server_url as a URI and add basic constraints to improve client generation.
schema: $ref: '#/components/schemas/MCPDefinition'And in MCPDefinition (see lines 3674-3682):
- server_url: + server_url: title: Server Url type: string + format: uri
2287-2290
: vector_store_id should be typed as UUID.Likely a UUID. Add format to both RFI and compliance payloads.
vector_store_id: title: Vector Store Id type: string + format: uuid
Also applies to: 2304-2307
3307-3362
: FileSearchToolResource: add stronger typing.
- file_ids likely UUIDs; add format.
- retrieval_similarity_threshold and max_neighbors could have sensible bounds.
file_ids: title: File Ids type: array items: - type: string + type: string + format: uuid retrieval_similarity_threshold: title: Retrieval Similarity Threshold type: number + minimum: 0.0 + maximum: 1.0 max_neighbors: title: Max Neighbors type: integer + minimum: 1
2723-2756
: ConversationalRagConfig: add bounds for new fields.Add minimum for max_documents and reuse same response_language default pattern (already good).
max_documents: title: Max Documents type: integer + minimum: 1
3674-3688
: Mark URLs with uri format.Add format: uri to MCPDefinition.server_url, HTTPToolEndpoint.url, and WebSearchToolResource.urls items.
HTTPToolEndpoint: properties: url: title: Url - type: string + type: string + format: uriWebSearchToolResource: properties: urls: title: Urls type: array items: - type: string + type: string + format: uriMCPDefinition: properties: server_url: title: Server Url - type: string + type: string + format: uriAlso applies to: 4467-4484, 3407-3413
2079-2093
: Nit: copy-pasted “request ID” description on entity IDs.“unique ID for the request” appears on entity types like Assistant. Consider revising to entity-appropriate wording.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (133)
src/libs/AI21/Generated/AI21..JsonSerializerContext.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Ai21Api.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Ai21Api.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Ai21Api.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Ai21Api.V1CreateAssistant.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Ai21Api.V1MaestroRun.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Ai21Api.V1ModifyAssistant.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Ai21Api.V1RunAssistant.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.IAi21Api.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.IAi21Api.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.IAi21Api.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.IAi21Api.V1ConversationalRag.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.IAi21Api.V1CreateAssistant.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.IAi21Api.V1MaestroRun.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.IAi21Api.V1ModifyAssistant.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.IAi21Api.V1RunAssistant.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.AssistantResponseLanguage.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.AssistantResponseLanguageNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.AssistantType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.AssistantTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.BudgetLevel.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.BudgetLevelNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceLabelsFilterMode.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceLabelsFilterModeNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceResponseLanguage.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceResponseLanguageNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.FileSearchToolResourceTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolFunctionParametersType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolFunctionParametersTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolResourceType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.HTTPToolResourceTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesChatToolDefinitionType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesChatToolDefinitionTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.MCPToolResourceType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.MCPToolResourceTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.ModifyAssistantRequestResponseLanguage.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.ModifyAssistantRequestResponseLanguageNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.RunAssistantRequestResponseLanguage.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.RunAssistantRequestResponseLanguageNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.RunOptimization.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.RunOptimizationNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.Visibility.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.VisibilityNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.WebSearchToolResourceType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonConverters.WebSearchToolResourceTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.JsonSerializerContextTypes.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.Assistant.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.AssistantResponseLanguage.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.AssistantType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.BudgetLevel.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.ChatRequest.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.ConversationalRagConfigResponseLanguage.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.ConversationalRagConfigRetrievalStrategy.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestToolResources.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestToolResources.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadResponseLanguage.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.FileSearchToolResourceLabelsFilterMode.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.FileSearchToolResourceResponseLanguage.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.FileSearchToolResourceType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolResource.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolResource.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.HTTPToolResourceType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinitionType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPDefinition.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPDefinition.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPTool.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPTool.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPToolResource.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPToolResource.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.MCPToolResourceType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestResponseLanguage.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.RunAssistantRequestResponseLanguage.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.RunOptimization.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.ToolResource.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.ToolResource.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.Visibility.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.Json.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.g.cs
is excluded by!**/generated/**
src/libs/AI21/Generated/AI21.Models.WebSearchToolResourceType.g.cs
is excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/AI21/openapi.yaml
(22 hunks)
🔇 Additional comments (5)
src/libs/AI21/openapi.yaml (5)
2132-2166
: Assistants: new enums/fields look good; watch tool_resources shape.Assistant.tools switch to discriminated union is good. Defaults for budget/visibility/assistant_type/response_language look sane.
Confirm consumers tolerate Assistant.tool_resources (AssistantToolResource) differing from CreateMaestroRunsPayload.tool_resources (ToolResource).
2898-2901
: Maestro run payloads: good move to typed ToolResource and union Tools.The unionized tools and typed tool_resources improve codegen and validation.
Also applies to: 2908-2909, 2943-2956
3896-3949
: Consider allowing assistant_type changes or document immutability.ModifyAssistantRequest omits assistant_type. If immutable, document it; if mutable, add the field.
4107-4155
: RunAssistantRequest: input shape and defaults look good.Array-of-Message input with include defaults and toggles is clear. No issues.
2469-2473
: Tool definitions: discriminated union and chat function tools are well-modeled.Discriminator matches enum literals across resources; chat tools constrained to function type is appropriate.
Also applies to: 4644-4656, 4674-4687
title: BudgetLevel | ||
enum: | ||
- low | ||
- medium | ||
- high | ||
description: An enumeration. |
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.
Budget and optimization types are inconsistent across schemas.
- BudgetLevel is lowercase enum; elsewhere budgets are free-form strings (and uppercase in descriptions). Unify to BudgetLevel.
- CreateAssistantRequest.optimization is string, ModifyAssistantRequest.optimization uses RunOptimization. Align CreateAssistantRequest (and Assistant) to RunOptimization.
- optimization:
- title: Optimization
- type: string
+ optimization:
+ $ref: '#/components/schemas/RunOptimization'
- budget:
- title: Budget
- type: string
- description: 'Budget level: LOW, MEDIUM, or HIGH'
- default: MEDIUM
+ budget:
+ allOf:
+ - $ref: '#/components/schemas/BudgetLevel'
+ default: medium
Also applies to: 2830-2872, 3896-3949
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2344-2349 (also review ranges
2830-2872 and 3896-3949), enum values and budget/optimization types are
inconsistent: BudgetLevel is defined with lowercase enum values while other
schemas use free-form strings or uppercase, and
CreateAssistantRequest.optimization is a plain string whereas
ModifyAssistantRequest references RunOptimization. Update schemas to use a
single canonical BudgetLevel enum (normalize values/casing across all
occurrences), replace any free-form budget string fields with the BudgetLevel
type, and change CreateAssistantRequest and any Assistant objects to use the
RunOptimization schema (same type as ModifyAssistantRequest) so optimization is
consistently typed across the spec.
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 |
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.
CreateAssistantRequest.tool_resources should mirror Assistant.
Use AssistantToolResource instead of untyped object for consistency.
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: | |
$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 | |
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: | |
$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 | |
assistant_type: | |
allOf: | |
- $ref: '#/components/schemas/AssistantType' | |
default: default |
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2830 to 2872, the
CreateAssistantRequest.schema currently defines tool_resources as an untyped
object; replace that with the same schema used by Assistant (use a $ref to the
AssistantToolResource component) so CreateAssistantRequest.tool_resources
mirrors Assistant. Update the tool_resources property to reference the
AssistantToolResource component (e.g. replace the type: object block with a
$ref: '#/components/schemas/AssistantToolResource') and keep the existing title.
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.
Bug: HTTPToolFunctionParameters.additionalProperties is misplaced.
additionalProperties must be at the schema level, not inside properties. Current spec defines a field named additionalProperties rather than constraining the schema.
Apply:
properties:
type:
title: Type
enum:
- object
type: string
default: object
properties:
title: Properties
type: object
additionalProperties:
$ref: '#/components/schemas/HTTPToolFunctionParamProperties'
required:
title: Required
type: array
items:
type: string
- additionalProperties:
- title: Additionalproperties
- type: boolean
- default: false
+ additionalProperties: false
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
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: HTTPToolEndpoint | |
required: | |
- url | |
type: object | |
properties: | |
url: | |
title: Url | |
type: string | |
headers: | |
title: Headers | |
type: object | |
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: 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: |
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 3402 to 3486 the
HTTPToolFunctionParameters schema incorrectly places additionalProperties as a
property inside the "properties" object (creating a field named
additionalProperties) instead of declaring it at the schema level; move the
additionalProperties entry out of the properties map to the same level as
"type", "properties", and "required", e.g. add an additionalProperties: { title:
Additionalproperties, type: boolean, default: false } directly under
HTTPToolFunctionParameters (not nested under properties) so the schema properly
constrains additional properties.
title: IgnestionBatchStatusCount | ||
required: | ||
- status | ||
- count | ||
type: object |
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.
Typo in schema name: Ignestion ➜ Ingestion (breaking for SDKs).
Rename the schema and update all $refs.
- IgnestionBatchStatusCount:
+ IngestionBatchStatusCount:
title: Ingestion Batch Status Count
- items:
- $ref: '#/components/schemas/IgnestionBatchStatusCount'
+ items:
+ $ref: '#/components/schemas/IngestionBatchStatusCount'
Also applies to: 3525-3529
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 3496-3500 (and similarly 3525-3529)
the schema name "IgnestionBatchStatusCount" is misspelled; rename the schema to
"IngestionBatchStatusCount" and update every $ref that points to the old name
accordingly across the OpenAPI file (search/replace all
"IgnestionBatchStatusCount" -> "IngestionBatchStatusCount"), ensuring the schema
definition and any examples/links are updated; after renaming, validate the
OpenAPI YAML and regenerate any SDKs or code that consume this spec to pick up
the corrected name.
Summary by CodeRabbit
New Features
API Changes