-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:OpenAPI: assistant lifecycle, tool model refactor, MCP, new fields #209
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 schema updated extensively: adds assistant lifecycle (create/modify/run), refactors tool representations to ToolDefinition/ToolResource with polymorphism, exposes MCP types and discovery, expands assistant fields (requirements, budget, visibility, types), adds web/file search resources, introduces new error shapes, and surfaces vector_store_id in multiple payloads and a GET parameter. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant API as Public API
participant Assist as Assistant Service
participant Tools as Tool Registry
participant HTTP as HTTP Tool
participant MCP as MCP Tool
participant FS as File Search
participant WS as Web Search
Client->>API: CreateAssistantRequest
API->>Assist: Create assistant (name, models, tools, requirements, budget)
Assist-->>API: Assistant
API-->>Client: Assistant
Client->>API: RunAssistantRequest (input, options)
API->>Assist: Run (structured_rag, planning, response_language)
Assist->>Tools: Resolve ToolDefinition (discriminator)
alt HTTP tool
Tools-->>Assist: HTTPToolResource
Assist->>HTTP: Call endpoint/function
HTTP-->>Assist: Result
else MCP tool
Tools-->>Assist: MCPToolResource
Assist->>MCP: Invoke tool
MCP-->>Assist: Result
else File/Web search
Tools-->>Assist: FileSearch/WebSearch resource
Assist->>FS: Query / retrieve
FS-->>Assist: Docs
Assist->>WS: Search
WS-->>Assist: Snippets
end
Assist-->>API: Run result or MaestroRunError
API-->>Client: Response
sequenceDiagram
autonumber
actor Client
participant API as Public API
participant MCP as MCP Discovery
Client->>API: MCPDiscovery request
API->>MCP: Discover (MCPDefinition)
MCP-->>API: MCPDiscoveryResponse (tools, resources)
API-->>Client: MCPDiscoveryResponse
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ 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: 3
🧹 Nitpick comments (16)
src/libs/AI21/openapi.yaml (16)
1018-1043: Add UUID format for vector_store_id and define a response schema.
- Suggest marking
vector_store_idasformat: uuid.- Consider introducing a dedicated response schema instead of
type: objectto keep the surface stable.schema: title: Vector Store Id - type: string + type: string + format: uuid ... content: application/json: - schema: - title: Response Get Vector Store Studio V1 Demos Regulations Vector Store Vector Store Id Get - type: object + schema: + $ref: '#/components/schemas/VectorStoreResponse'
1521-1541: Endpoint looks fine; ensure auth error responses are documented.Add 401/403 responses for consistency across secured endpoints.
responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Assistant' + '401': + description: Unauthorized + '403': + description: Forbidden '422':
1590-1617: PATCH response set is good; mirror 401/403 as well.Keep auth errors consistent across assistant endpoints.
responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Assistant' + '401': + description: Unauthorized + '403': + description: Forbidden '422':
1948-1969: MCP discovery: add minimal validation errors shape examples.Looks good; optional suggestion to add examples for happy/error paths.
2135-2166: Assistant fields expansion: verify defaults and privacy posture.
- Default
visibility: publicmay surprise users; considerprivateby default.- Descriptions for
id/objectmention “request ID” which is misleading for a persisted Assistant.- visibility: + visibility: allOf: - $ref: '#/components/schemas/Visibility' - default: public + default: private
2304-2307: Fix misleading description forvector_store_idin compliance upload.This is a regulations-compliance endpoint, not RFI.
vector_store_id: title: Vector Store Id type: string - description: Vector store ID to use for RFI processing + description: Vector store ID to use for regulations compliance checks
2723-2756: Add constraints formax_documents; response_language defaults consistent.
- Set
minimum: 1formax_documents.max_documents: title: Max Documents type: integer + minimum: 1
2898-2901: Tooling on Maestro runs: good, but consider consistent budget typing.
budgethere is a string enum; elsewhereBudgetLevelis introduced. Consider usingBudgetLevelfor consistency.budget: - title: Budget - enum: - - low - - medium - - high - type: string + allOf: + - $ref: '#/components/schemas/BudgetLevel'
3307-3363: FileSearchToolResource: add bounds/defaults to avoid undefined behavior.
- Add 0.0–1.0 bounds to
retrieval_similarity_thresholdto match other schemas.- Add
default: 1andminimum: 1tomax_neighbors.retrieval_similarity_threshold: title: Retrieval Similarity Threshold - type: number + type: number + minimum: 0.0 + maximum: 1.0 ... max_neighbors: title: Max Neighbors - type: integer + type: integer + minimum: 1 + default: 1
3674-3745: MCP types look solid.Optional: document auth expectations for
headers(e.g., reference to Secrets).
3753-3760: MaestroRunError addition LGTM.Consider adding a machine-readable code field for programmatic handling.
MaestroRunError: title: MaestroRunError required: - message type: object properties: message: title: Message type: string + code: + title: Code + type: string
3790-3791: Document whenerroris present.Clarify that
erroris set whenstatus=failed.MaestroRunResult: properties: ... - error: + error: $ref: '#/components/schemas/MaestroRunError' + description: error is populated when status is "failed".
3907-3960: ModifyAssistantRequest mostly consistent; alignoptimizationtype with Assistant.Assistant uses
stringforoptimization; preferRunOptimizationacross Assistant, Create, and Modify for consistency.- optimization: - $ref: '#/components/schemas/RunOptimization' + optimization: + $ref: '#/components/schemas/RunOptimization' # Follow-up: also align Assistant.optimization and CreateAssistantRequest (see other comments).
4118-4166: RunAssistantRequest: consider allowinginputas string (parity with Maestro).Non-blocking; could improve ergonomics.
input: - title: Input - type: array - items: - $ref: '#/components/schemas/Message' + title: Input + anyOf: + - type: array + items: + $ref: '#/components/schemas/Message' + - type: string
4348-4355: ToolResource vs AssistantToolResource divergence.
AssistantToolResourceincludesplan_approval;ToolResourcedoes not. Either document the difference or add parity to avoid confusion.ToolResource: title: ToolResource type: object properties: file_search: $ref: '#/components/schemas/FileSearchToolResource' web_search: $ref: '#/components/schemas/WebSearchToolResource' + plan_approval: + title: Plan Approval + type: object
4478-4495: WebSearchToolResource: specify at least one ofurlsorfallback_to_web.Add validation constraints to prevent empty config.
WebSearchToolResource: type: object properties: type: title: Type enum: - web_search type: string default: web_search urls: title: Urls type: array items: type: string fallback_to_web: title: Fallback To Web type: boolean + anyOf: + - required: [urls] + - required: [fallback_to_web]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (136)
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.Ai21Api.V1RunAssistant.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.IAi21Api.V1RunAssistant.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.AssistantResponseLanguage.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.AssistantResponseLanguageNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.AssistantType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.AssistantTypeNullable.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.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.LanguageStudioApiServerDataTypesChatToolDefinitionType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesChatToolDefinitionTypeNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorTypeNullable.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.ModifyAssistantRequestResponseLanguage.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.ModifyAssistantRequestResponseLanguageNullable.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.RunAssistantRequestResponseLanguage.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.JsonConverters.RunAssistantRequestResponseLanguageNullable.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.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.AssistantResponseLanguage.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.AssistantType.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.ChatRequest.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.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.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.LanguageStudioApiServerDataTypesChatToolDefinition.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinitionType.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.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorType.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.MaestroRunError.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MaestroRunError.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.MaestroRunResult.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.ModifyAssistantRequestResponseLanguage.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.Json.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.g.csis excluded by!**/generated/**src/libs/AI21/Generated/AI21.Models.RunAssistantRequestResponseLanguage.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.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(23 hunks)
🔇 Additional comments (11)
src/libs/AI21/openapi.yaml (11)
1619-1647: Run endpoint LGTM; consider streaming variant or202 Acceptedfor async.If execution is long-running, returning 202 with polling link can be clearer.
2129-2135: Good move to ToolDefinition; confirm discriminator alignment.
Assistant.toolsnow references execution_engine ToolDefinition. Ensure all tool objects include atypediscriminant matching the oneOf mapping.
2242-2247: AssistantType enum addition looks good.No issues spotted.
2344-2349: BudgetLevel enum addition LGTM.
2472-2472: ChatRequest.tools now uses chat ToolDefinition – good.Ensure every tool entry includes
type: "function"and validparameters.
4168-4172: RunOptimization enum LGTM.
4472-4477: Visibility enum LGTM; ensure defaults wired (see Assistant comment).
4638-4654: Assistant Requirement type published – good.Ensure IDs are UUIDs if that’s the invariant; currently plain string.
4655-4668: Chat ToolDefinition LGTM.
4669-4684: Execution-engine Requirement LGTM.
4685-4698: Execution-engine ToolDefinition discriminator mapping LGTM.
| title: CreateAssistantRequest | ||
| required: | ||
| - name | ||
| type: object | ||
| properties: | ||
| name: | ||
| title: Name | ||
| type: string | ||
| description: | ||
| title: Description | ||
| type: string | ||
| optimization: | ||
| title: Optimization | ||
| type: string | ||
| avatar: | ||
| title: Avatar | ||
| type: string | ||
| models: | ||
| title: Models | ||
| type: array | ||
| items: | ||
| type: string | ||
| tools: | ||
| title: Tools | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition' | ||
| tool_resources: | ||
| title: Tool Resources | ||
| type: object | ||
| requirements: | ||
| title: Requirements | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/language_studio_api_server__data_types__assistant__Requirement' | ||
| budget: | ||
| allOf: | ||
| - $ref: '#/components/schemas/BudgetLevel' | ||
| default: medium | ||
| assistant_type: | ||
| allOf: | ||
| - $ref: '#/components/schemas/AssistantType' | ||
| default: default | ||
| CreateMaestroRunsPayload: |
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 shape inconsistencies (must fix).
optimizationisstringhere butRunOptimizationelsewhere. Align to enum.tool_resourcesistype: object; elsewhere it’sAssistantToolResource. Align.- Missing
response_languagealthough present on Assistant and ModifyAssistantRequest.
optimization:
- title: Optimization
- type: string
+ allOf:
+ - $ref: '#/components/schemas/RunOptimization'
...
- tool_resources:
- title: Tool Resources
- type: object
+ tool_resources:
+ $ref: '#/components/schemas/AssistantToolResource'
...
+ response_language:
+ title: Response Language
+ enum: [arabic, dutch, english, french, german, hebrew, italian, portuguese, spanish, unset]
+ type: string
+ default: unset📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| title: CreateAssistantRequest | |
| required: | |
| - name | |
| type: object | |
| properties: | |
| name: | |
| title: Name | |
| type: string | |
| description: | |
| title: Description | |
| type: string | |
| optimization: | |
| title: Optimization | |
| type: string | |
| avatar: | |
| title: Avatar | |
| type: string | |
| models: | |
| title: Models | |
| type: array | |
| items: | |
| type: string | |
| tools: | |
| title: Tools | |
| type: array | |
| items: | |
| $ref: '#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition' | |
| tool_resources: | |
| title: Tool Resources | |
| type: object | |
| requirements: | |
| title: Requirements | |
| type: array | |
| items: | |
| $ref: '#/components/schemas/language_studio_api_server__data_types__assistant__Requirement' | |
| budget: | |
| allOf: | |
| - $ref: '#/components/schemas/BudgetLevel' | |
| default: medium | |
| assistant_type: | |
| allOf: | |
| - $ref: '#/components/schemas/AssistantType' | |
| default: default | |
| CreateMaestroRunsPayload: | |
| title: CreateAssistantRequest | |
| required: | |
| - name | |
| type: object | |
| properties: | |
| name: | |
| title: Name | |
| type: string | |
| description: | |
| title: Description | |
| type: string | |
| optimization: | |
| allOf: | |
| - $ref: '#/components/schemas/RunOptimization' | |
| avatar: | |
| title: Avatar | |
| type: string | |
| models: | |
| title: Models | |
| type: array | |
| items: | |
| type: string | |
| tools: | |
| title: Tools | |
| type: array | |
| items: | |
| $ref: '#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition' | |
| tool_resources: | |
| $ref: '#/components/schemas/AssistantToolResource' | |
| response_language: | |
| title: Response Language | |
| enum: [arabic, dutch, english, french, german, hebrew, italian, portuguese, spanish, unset] | |
| type: string | |
| default: unset | |
| requirements: | |
| title: Requirements | |
| type: array | |
| items: | |
| $ref: '#/components/schemas/language_studio_api_server__data_types__assistant__Requirement' | |
| budget: | |
| allOf: | |
| - $ref: '#/components/schemas/BudgetLevel' | |
| default: medium | |
| assistant_type: | |
| allOf: | |
| - $ref: '#/components/schemas/AssistantType' | |
| default: default | |
| CreateMaestroRunsPayload: |
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 2830 to 2873, the
CreateAssistantRequest schema is inconsistent with other schemas: change the
optimization property from type: string to reference the existing
RunOptimization enum schema; change tool_resources from type: object to
reference the existing AssistantToolResource schema; and add the missing
response_language property with the same schema/ref used by Assistant and
ModifyAssistantRequest (including any default or enum constraints they use) so
the shape matches across definitions.
| title: HTTPToolEndpoint | ||
| required: | ||
| - url | ||
| type: object | ||
| properties: | ||
| detail: | ||
| title: Detail | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/ValidationError' | ||
| IgnestionBatchStatusCount: | ||
| title: IgnestionBatchStatusCount | ||
| url: | ||
| title: Url | ||
| type: string | ||
| headers: | ||
| title: Headers | ||
| type: object | ||
| HTTPToolFunction: | ||
| title: HTTPToolFunction | ||
| required: | ||
| - status | ||
| - count | ||
| - name | ||
| - description | ||
| - parameters | ||
| type: object | ||
| properties: | ||
| name: | ||
| title: Name | ||
| type: string | ||
| description: | ||
| title: Description | ||
| type: string | ||
| parameters: | ||
| $ref: '#/components/schemas/HTTPToolFunctionParameters' | ||
| HTTPToolFunctionParamProperties: | ||
| title: HTTPToolFunctionParamProperties | ||
| required: | ||
| - type | ||
| - description | ||
| type: object | ||
| properties: | ||
| type: | ||
| title: Type | ||
| type: string | ||
| description: | ||
| title: Description | ||
| type: string | ||
| HTTPToolFunctionParameters: | ||
| title: HTTPToolFunctionParameters | ||
| required: | ||
| - properties | ||
| - required | ||
| type: object | ||
| properties: | ||
| type: | ||
| title: Type | ||
| enum: | ||
| - object | ||
| type: string | ||
| default: object | ||
| properties: | ||
| title: Properties | ||
| type: object | ||
| additionalProperties: | ||
| $ref: '#/components/schemas/HTTPToolFunctionParamProperties' | ||
| required: | ||
| title: Required | ||
| type: array | ||
| items: | ||
| type: string | ||
| additionalProperties: | ||
| title: Additionalproperties | ||
| type: boolean | ||
| default: false | ||
| HTTPToolResource: | ||
| title: HTTPToolResource | ||
| required: | ||
| - function | ||
| - endpoint | ||
| type: object | ||
| properties: | ||
| type: | ||
| title: Type | ||
| enum: | ||
| - http | ||
| type: string | ||
| default: http | ||
| function: | ||
| $ref: '#/components/schemas/HTTPToolFunction' | ||
| endpoint: | ||
| $ref: '#/components/schemas/HTTPToolEndpoint' | ||
| HTTPValidationError: | ||
| title: HTTPValidationError | ||
| type: object | ||
| properties: | ||
| detail: | ||
| title: Detail | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/ValidationError' | ||
| IgnestionBatchStatusCount: |
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.
HTTP tool shapes: add HTTP method, timeout, and retry/backoff fields.
Without these, calls risk hanging or being unsafe.
HTTPToolEndpoint:
title: HTTPToolEndpoint
required:
- - url
+ - url
+ - method
type: object
properties:
url:
title: Url
type: string
+ method:
+ title: Method
+ enum: [GET, POST, PUT, PATCH, DELETE]
+ type: string
+ default: POST
+ timeout_seconds:
+ title: Timeout Seconds
+ type: number
+ minimum: 0.1
+ default: 30
headers:
title: Headers
type: object
+ retry:
+ title: Retry
+ type: object
+ properties:
+ max_attempts:
+ type: integer
+ minimum: 0
+ default: 2
+ backoff_seconds:
+ type: number
+ minimum: 0
+ default: 0.5📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| title: HTTPToolEndpoint | |
| required: | |
| - url | |
| type: object | |
| properties: | |
| detail: | |
| title: Detail | |
| type: array | |
| items: | |
| $ref: '#/components/schemas/ValidationError' | |
| IgnestionBatchStatusCount: | |
| title: IgnestionBatchStatusCount | |
| url: | |
| title: Url | |
| type: string | |
| headers: | |
| title: Headers | |
| type: object | |
| HTTPToolFunction: | |
| title: HTTPToolFunction | |
| required: | |
| - status | |
| - count | |
| - name | |
| - description | |
| - parameters | |
| type: object | |
| properties: | |
| name: | |
| title: Name | |
| type: string | |
| description: | |
| title: Description | |
| type: string | |
| parameters: | |
| $ref: '#/components/schemas/HTTPToolFunctionParameters' | |
| HTTPToolFunctionParamProperties: | |
| title: HTTPToolFunctionParamProperties | |
| required: | |
| - type | |
| - description | |
| type: object | |
| properties: | |
| type: | |
| title: Type | |
| type: string | |
| description: | |
| title: Description | |
| type: string | |
| HTTPToolFunctionParameters: | |
| title: HTTPToolFunctionParameters | |
| required: | |
| - properties | |
| - required | |
| type: object | |
| properties: | |
| type: | |
| title: Type | |
| enum: | |
| - object | |
| type: string | |
| default: object | |
| properties: | |
| title: Properties | |
| type: object | |
| additionalProperties: | |
| $ref: '#/components/schemas/HTTPToolFunctionParamProperties' | |
| required: | |
| title: Required | |
| type: array | |
| items: | |
| type: string | |
| additionalProperties: | |
| title: Additionalproperties | |
| type: boolean | |
| default: false | |
| HTTPToolResource: | |
| title: HTTPToolResource | |
| required: | |
| - function | |
| - endpoint | |
| type: object | |
| properties: | |
| type: | |
| title: Type | |
| enum: | |
| - http | |
| type: string | |
| default: http | |
| function: | |
| $ref: '#/components/schemas/HTTPToolFunction' | |
| endpoint: | |
| $ref: '#/components/schemas/HTTPToolEndpoint' | |
| HTTPValidationError: | |
| title: HTTPValidationError | |
| type: object | |
| properties: | |
| detail: | |
| title: Detail | |
| type: array | |
| items: | |
| $ref: '#/components/schemas/ValidationError' | |
| IgnestionBatchStatusCount: | |
| HTTPToolEndpoint: | |
| title: HTTPToolEndpoint | |
| required: | |
| - url | |
| - method | |
| type: object | |
| properties: | |
| url: | |
| title: Url | |
| type: string | |
| method: | |
| title: Method | |
| enum: | |
| - GET | |
| - POST | |
| - PUT | |
| - PATCH | |
| - DELETE | |
| type: string | |
| default: POST | |
| timeout_seconds: | |
| title: Timeout Seconds | |
| type: number | |
| minimum: 0.1 | |
| default: 30 | |
| headers: | |
| title: Headers | |
| type: object | |
| retry: | |
| title: Retry | |
| type: object | |
| properties: | |
| max_attempts: | |
| type: integer | |
| minimum: 0 | |
| default: 2 | |
| backoff_seconds: | |
| type: number | |
| minimum: 0 | |
| default: 0.5 | |
| HTTPToolFunction: | |
| title: HTTPToolFunction | |
| required: | |
| - name | |
| - description | |
| - parameters | |
| type: object | |
| properties: | |
| name: | |
| title: Name | |
| type: string | |
| description: | |
| title: Description | |
| type: string | |
| parameters: | |
| $ref: '#/components/schemas/HTTPToolFunctionParameters' | |
| HTTPToolFunctionParamProperties: | |
| title: HTTPToolFunctionParamProperties | |
| required: | |
| - type | |
| - description | |
| type: object | |
| properties: | |
| type: | |
| title: Type | |
| type: string | |
| description: | |
| title: Description | |
| type: string | |
| HTTPToolFunctionParameters: | |
| title: HTTPToolFunctionParameters | |
| required: | |
| - properties | |
| - required | |
| type: object | |
| properties: | |
| type: | |
| title: Type | |
| enum: | |
| - object | |
| type: string | |
| default: object | |
| properties: | |
| title: Properties | |
| type: object | |
| additionalProperties: | |
| $ref: '#/components/schemas/HTTPToolFunctionParamProperties' | |
| required: | |
| title: Required | |
| type: array | |
| items: | |
| type: string | |
| additionalProperties: | |
| title: Additionalproperties | |
| type: boolean | |
| default: false | |
| HTTPToolResource: | |
| title: HTTPToolResource | |
| required: | |
| - function | |
| - endpoint | |
| type: object | |
| properties: | |
| type: | |
| title: Type | |
| enum: | |
| - http | |
| type: string | |
| default: http | |
| function: | |
| $ref: '#/components/schemas/HTTPToolFunction' | |
| endpoint: | |
| $ref: '#/components/schemas/HTTPToolEndpoint' | |
| HTTPValidationError: | |
| title: HTTPValidationError | |
| type: object | |
| properties: | |
| detail: | |
| title: Detail | |
| type: array | |
| items: | |
| $ref: '#/components/schemas/ValidationError' | |
| IgnestionBatchStatusCount: |
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 3402-3495, the HTTP tool schema lacks
method, timeout and retry/backoff settings; update the HTTPToolEndpoint schema
to add optional properties: method (string enum: GET, POST, PUT, PATCH, DELETE,
HEAD, OPTIONS), timeout_ms (integer, >=0) to cap request duration, retries
(integer, >=0) to control retry attempts, and retry_backoff (object) with fields
like strategy (enum: fixed, exponential), base_delay_ms (integer), max_delay_ms
(integer) and multiplier (number) to configure backoff behavior; ensure these
new properties are documented, typed, not required (so existing callers are
compatible), and include sensible defaults where appropriate (e.g., timeout_ms
default 30000, retries default 0, strategy default fixed).
| 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 clients).
Rename the schema and update references (e.g., in IngestionBatchStatusResponse.statuses.items).
- IgnestionBatchStatusCount:
- title: IgnestionBatchStatusCount
+ IngestionBatchStatusCount:
+ title: IngestionBatchStatusCount
...
- $ref: '#/components/schemas/IgnestionBatchStatusCount'
+ $ref: '#/components/schemas/IngestionBatchStatusCount'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| title: IgnestionBatchStatusCount | |
| required: | |
| - status | |
| - count | |
| type: object | |
| title: IngestionBatchStatusCount | |
| required: | |
| - status | |
| - count | |
| type: object |
🤖 Prompt for AI Agents
In src/libs/AI21/openapi.yaml around lines 3496-3500, the schema name
"IgnestionBatchStatusCount" is misspelled and must be renamed to
"IngestionBatchStatusCount"; update the components.schemas key to the correct
name and then find and replace all $ref references (for example
IngestionBatchStatusResponse.statuses.items and any other occurrences) to point
to components/schemas/IngestionBatchStatusCount, ensuring required/fields remain
unchanged and the OpenAPI refs validate after the rename.
Summary by CodeRabbit
New Features
Refactor