From 0d8e27b461392ad9f4f2111852445dbef1e62bc6 Mon Sep 17 00:00:00 2001 From: Raghotham Murthy Date: Mon, 27 Oct 2025 13:07:22 -0700 Subject: [PATCH] API change POST /test to GET /health --- client-sdks/stainless/openapi.yml | 923 ++++++------ .../static/experimental-llama-stack-spec.html | 617 +++++++- .../static/experimental-llama-stack-spec.yaml | 450 ++++++ docs/static/llama-stack-spec.html | 658 --------- docs/static/llama-stack-spec.yaml | 484 ------- docs/static/stainless-llama-stack-spec.html | 1261 ++++++++--------- docs/static/stainless-llama-stack-spec.yaml | 923 ++++++------ tests/unit/core/test_dynamic_providers.py | 4 +- 8 files changed, 2548 insertions(+), 2772 deletions(-) diff --git a/client-sdks/stainless/openapi.yml b/client-sdks/stainless/openapi.yml index e05d6eba1..0e27c4bad 100644 --- a/client-sdks/stainless/openapi.yml +++ b/client-sdks/stainless/openapi.yml @@ -15,178 +15,6 @@ info: servers: - url: http://any-hosted-llama-stack.com paths: - /v1/admin/providers/{api}: - post: - responses: - '200': - description: >- - RegisterProviderResponse with the registered provider info. - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterProviderResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Register a new dynamic provider. - description: >- - Register a new dynamic provider. - - Register a new provider instance at runtime. The provider will be validated, - - instantiated, and persisted to the kvstore. Requires appropriate ABAC permissions. - parameters: - - name: api - in: path - description: >- - API namespace this provider implements (e.g., 'inference', 'vector_io'). - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterProviderRequest' - required: true - deprecated: false - /v1/admin/providers/{api}/{provider_id}: - post: - responses: - '200': - description: >- - UpdateProviderResponse with updated provider info - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProviderResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: >- - Update an existing provider's configuration. - description: >- - Update an existing provider's configuration. - - Update the configuration and/or attributes of a dynamic provider. The provider - - will be re-instantiated with the new configuration (hot-reload). - parameters: - - name: api - in: path - description: API namespace the provider implements - required: true - schema: - type: string - - name: provider_id - in: path - description: ID of the provider to update - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProviderRequest' - required: true - deprecated: false - delete: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Unregister a dynamic provider. - description: >- - Unregister a dynamic provider. - - Remove a dynamic provider, shutting down its instance and removing it from - - the kvstore. - parameters: - - name: api - in: path - description: API namespace the provider implements - required: true - schema: - type: string - - name: provider_id - in: path - description: ID of the provider to unregister. - required: true - schema: - type: string - deprecated: false - /v1/admin/providers/{api}/{provider_id}/test: - post: - responses: - '200': - description: >- - TestProviderConnectionResponse with health status. - content: - application/json: - schema: - $ref: '#/components/schemas/TestProviderConnectionResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Test a provider connection. - description: >- - Test a provider connection. - - Execute a health check on a provider to verify it is reachable and functioning. - parameters: - - name: api - in: path - description: API namespace the provider implements. - required: true - schema: - type: string - - name: provider_id - in: path - description: ID of the provider to test. - required: true - schema: - type: string - deprecated: false /v1/chat/completions: get: responses: @@ -937,35 +765,6 @@ paths: schema: type: string deprecated: false - /v1/health: - get: - responses: - '200': - description: >- - Health information indicating if the service is operational. - content: - application/json: - schema: - $ref: '#/components/schemas/HealthInfo' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Inspect - summary: Get health status. - description: >- - Get health status. - - Get the current health status of the service. - parameters: [] - deprecated: false /v1/inspect/routes: get: responses: @@ -3390,6 +3189,178 @@ paths: schema: type: string deprecated: false + /v1alpha/admin/providers/{api}: + post: + responses: + '200': + description: >- + RegisterProviderResponse with the registered provider info. + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterProviderResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Providers + summary: Register a new dynamic provider. + description: >- + Register a new dynamic provider. + + Register a new provider instance at runtime. The provider will be validated, + + instantiated, and persisted to the kvstore. Requires appropriate ABAC permissions. + parameters: + - name: api + in: path + description: >- + API namespace this provider implements (e.g., 'inference', 'vector_io'). + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterProviderRequest' + required: true + deprecated: false + /v1alpha/admin/providers/{api}/{provider_id}: + post: + responses: + '200': + description: >- + UpdateProviderResponse with updated provider info + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProviderResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Providers + summary: >- + Update an existing provider's configuration. + description: >- + Update an existing provider's configuration. + + Update the configuration and/or attributes of a dynamic provider. The provider + + will be re-instantiated with the new configuration (hot-reload). + parameters: + - name: api + in: path + description: API namespace the provider implements + required: true + schema: + type: string + - name: provider_id + in: path + description: ID of the provider to update + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProviderRequest' + required: true + deprecated: false + delete: + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Providers + summary: Unregister a dynamic provider. + description: >- + Unregister a dynamic provider. + + Remove a dynamic provider, shutting down its instance and removing it from + + the kvstore. + parameters: + - name: api + in: path + description: API namespace the provider implements + required: true + schema: + type: string + - name: provider_id + in: path + description: ID of the provider to unregister. + required: true + schema: + type: string + deprecated: false + /v1alpha/admin/providers/{api}/{provider_id}/health: + get: + responses: + '200': + description: >- + TestProviderConnectionResponse with health status. + content: + application/json: + schema: + $ref: '#/components/schemas/TestProviderConnectionResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Inspect + summary: Check provider health. + description: >- + Check provider health. + + Execute a health check on a provider to verify it is reachable and functioning. + parameters: + - name: api + in: path + description: API namespace the provider implements. + required: true + schema: + type: string + - name: provider_id + in: path + description: ID of the provider to check. + required: true + schema: + type: string + deprecated: false /v1alpha/agents: get: responses: @@ -4426,273 +4397,6 @@ components: title: Error description: >- Error response from the API. Roughly follows RFC 7807. - RegisterProviderRequest: - type: object - properties: - provider_id: - type: string - description: >- - Unique identifier for this provider instance. - provider_type: - type: string - description: Provider type (e.g., 'remote::openai'). - config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Provider configuration (API keys, endpoints, etc.). - attributes: - type: object - additionalProperties: - type: array - items: - type: string - description: >- - Optional attributes for ABAC access control. - additionalProperties: false - required: - - provider_id - - provider_type - - config - title: RegisterProviderRequest - ProviderConnectionInfo: - type: object - properties: - provider_id: - type: string - description: >- - Unique identifier for this provider instance - api: - type: string - description: >- - API namespace (e.g., "inference", "vector_io", "safety") - provider_type: - type: string - description: >- - Provider type identifier (e.g., "remote::openai", "inline::faiss") - config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Provider-specific configuration (API keys, endpoints, etc.) - status: - $ref: '#/components/schemas/ProviderConnectionStatus' - description: Current connection status - health: - $ref: '#/components/schemas/ProviderHealth' - description: Most recent health check result - created_at: - type: string - format: date-time - description: Timestamp when provider was registered - updated_at: - type: string - format: date-time - description: Timestamp of last update - last_health_check: - type: string - format: date-time - description: Timestamp of last health check - error_message: - type: string - description: Error message if status is failed - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - User-defined metadata (deprecated, use attributes) - owner: - type: object - properties: - principal: - type: string - attributes: - type: object - additionalProperties: - type: array - items: - type: string - additionalProperties: false - required: - - principal - description: >- - User who created this provider connection - attributes: - type: object - additionalProperties: - type: array - items: - type: string - description: >- - Key-value attributes for ABAC access control - additionalProperties: false - required: - - provider_id - - api - - provider_type - - config - - status - - created_at - - updated_at - - metadata - title: ProviderConnectionInfo - description: >- - Information about a dynamically managed provider connection. - - This model represents a provider that has been registered at runtime - - via the /providers API, as opposed to static providers configured in run.yaml. - - - Dynamic providers support full lifecycle management including registration, - - configuration updates, health monitoring, and removal. - ProviderConnectionStatus: - type: string - enum: - - pending - - initializing - - connected - - failed - - disconnected - - testing - title: ProviderConnectionStatus - description: Status of a dynamic provider connection. - ProviderHealth: - type: object - properties: - status: - type: string - enum: - - OK - - Error - - Not Implemented - description: >- - Health status (OK, ERROR, NOT_IMPLEMENTED) - message: - type: string - description: Optional error or status message - metrics: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Provider-specific health metrics - last_checked: - type: string - format: date-time - description: Timestamp of last health check - additionalProperties: false - required: - - status - - metrics - - last_checked - title: ProviderHealth - description: >- - Structured wrapper around provider health status. - - This wraps the existing dict-based HealthResponse for API responses - - while maintaining backward compatibility with existing provider implementations. - RegisterProviderResponse: - type: object - properties: - provider: - $ref: '#/components/schemas/ProviderConnectionInfo' - description: >- - Information about the registered provider - additionalProperties: false - required: - - provider - title: RegisterProviderResponse - description: Response after registering a provider. - UpdateProviderRequest: - type: object - properties: - config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - New configuration parameters (merged with existing) - attributes: - type: object - additionalProperties: - type: array - items: - type: string - description: New attributes for access control - additionalProperties: false - title: UpdateProviderRequest - UpdateProviderResponse: - type: object - properties: - provider: - $ref: '#/components/schemas/ProviderConnectionInfo' - description: Updated provider information - additionalProperties: false - required: - - provider - title: UpdateProviderResponse - description: Response after updating a provider. - TestProviderConnectionResponse: - type: object - properties: - success: - type: boolean - description: Whether the connection test succeeded - health: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Health status from the provider - error_message: - type: string - description: Error message if test failed - additionalProperties: false - required: - - success - title: TestProviderConnectionResponse - description: >- - Response from testing a provider connection. Order: type: string enum: @@ -6746,22 +6450,6 @@ components: Response: type: object title: Response - HealthInfo: - type: object - properties: - status: - type: string - enum: - - OK - - Error - - Not Implemented - description: Current health status of the service - additionalProperties: false - required: - - status - title: HealthInfo - description: >- - Health status information for the service. RouteInfo: type: object properties: @@ -11876,6 +11564,273 @@ components: - purpose - source title: RegisterDatasetRequest + RegisterProviderRequest: + type: object + properties: + provider_id: + type: string + description: >- + Unique identifier for this provider instance. + provider_type: + type: string + description: Provider type (e.g., 'remote::openai'). + config: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + Provider configuration (API keys, endpoints, etc.). + attributes: + type: object + additionalProperties: + type: array + items: + type: string + description: >- + Optional attributes for ABAC access control. + additionalProperties: false + required: + - provider_id + - provider_type + - config + title: RegisterProviderRequest + ProviderConnectionInfo: + type: object + properties: + provider_id: + type: string + description: >- + Unique identifier for this provider instance + api: + type: string + description: >- + API namespace (e.g., "inference", "vector_io", "safety") + provider_type: + type: string + description: >- + Provider type identifier (e.g., "remote::openai", "inline::faiss") + config: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + Provider-specific configuration (API keys, endpoints, etc.) + status: + $ref: '#/components/schemas/ProviderConnectionStatus' + description: Current connection status + health: + $ref: '#/components/schemas/ProviderHealth' + description: Most recent health check result + created_at: + type: string + format: date-time + description: Timestamp when provider was registered + updated_at: + type: string + format: date-time + description: Timestamp of last update + last_health_check: + type: string + format: date-time + description: Timestamp of last health check + error_message: + type: string + description: Error message if status is failed + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + User-defined metadata (deprecated, use attributes) + owner: + type: object + properties: + principal: + type: string + attributes: + type: object + additionalProperties: + type: array + items: + type: string + additionalProperties: false + required: + - principal + description: >- + User who created this provider connection + attributes: + type: object + additionalProperties: + type: array + items: + type: string + description: >- + Key-value attributes for ABAC access control + additionalProperties: false + required: + - provider_id + - api + - provider_type + - config + - status + - created_at + - updated_at + - metadata + title: ProviderConnectionInfo + description: >- + Information about a dynamically managed provider connection. + + This model represents a provider that has been registered at runtime + + via the /providers API, as opposed to static providers configured in run.yaml. + + + Dynamic providers support full lifecycle management including registration, + + configuration updates, health monitoring, and removal. + ProviderConnectionStatus: + type: string + enum: + - pending + - initializing + - connected + - failed + - disconnected + - testing + title: ProviderConnectionStatus + description: Status of a dynamic provider connection. + ProviderHealth: + type: object + properties: + status: + type: string + enum: + - OK + - Error + - Not Implemented + description: >- + Health status (OK, ERROR, NOT_IMPLEMENTED) + message: + type: string + description: Optional error or status message + metrics: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Provider-specific health metrics + last_checked: + type: string + format: date-time + description: Timestamp of last health check + additionalProperties: false + required: + - status + - metrics + - last_checked + title: ProviderHealth + description: >- + Structured wrapper around provider health status. + + This wraps the existing dict-based HealthResponse for API responses + + while maintaining backward compatibility with existing provider implementations. + RegisterProviderResponse: + type: object + properties: + provider: + $ref: '#/components/schemas/ProviderConnectionInfo' + description: >- + Information about the registered provider + additionalProperties: false + required: + - provider + title: RegisterProviderResponse + description: Response after registering a provider. + UpdateProviderRequest: + type: object + properties: + config: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + New configuration parameters (merged with existing) + attributes: + type: object + additionalProperties: + type: array + items: + type: string + description: New attributes for access control + additionalProperties: false + title: UpdateProviderRequest + UpdateProviderResponse: + type: object + properties: + provider: + $ref: '#/components/schemas/ProviderConnectionInfo' + description: Updated provider information + additionalProperties: false + required: + - provider + title: UpdateProviderResponse + description: Response after updating a provider. + TestProviderConnectionResponse: + type: object + properties: + success: + type: boolean + description: Whether the connection test succeeded + health: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Health status from the provider + error_message: + type: string + description: Error message if test failed + additionalProperties: false + required: + - success + title: TestProviderConnectionResponse + description: >- + Response from testing a provider connection. AgentConfig: type: object properties: diff --git a/docs/static/experimental-llama-stack-spec.html b/docs/static/experimental-llama-stack-spec.html index 2ad81d4f2..d9e92d4be 100644 --- a/docs/static/experimental-llama-stack-spec.html +++ b/docs/static/experimental-llama-stack-spec.html @@ -310,6 +310,224 @@ "deprecated": false } }, + "/v1alpha/admin/providers/{api}": { + "post": { + "responses": { + "200": { + "description": "RegisterProviderResponse with the registered provider info.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterProviderResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Providers" + ], + "summary": "Register a new dynamic provider.", + "description": "Register a new dynamic provider.\nRegister a new provider instance at runtime. The provider will be validated,\ninstantiated, and persisted to the kvstore. Requires appropriate ABAC permissions.", + "parameters": [ + { + "name": "api", + "in": "path", + "description": "API namespace this provider implements (e.g., 'inference', 'vector_io').", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterProviderRequest" + } + } + }, + "required": true + }, + "deprecated": false + } + }, + "/v1alpha/admin/providers/{api}/{provider_id}": { + "post": { + "responses": { + "200": { + "description": "UpdateProviderResponse with updated provider info", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateProviderResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Providers" + ], + "summary": "Update an existing provider's configuration.", + "description": "Update an existing provider's configuration.\nUpdate the configuration and/or attributes of a dynamic provider. The provider\nwill be re-instantiated with the new configuration (hot-reload).", + "parameters": [ + { + "name": "api", + "in": "path", + "description": "API namespace the provider implements", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "provider_id", + "in": "path", + "description": "ID of the provider to update", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateProviderRequest" + } + } + }, + "required": true + }, + "deprecated": false + }, + "delete": { + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Providers" + ], + "summary": "Unregister a dynamic provider.", + "description": "Unregister a dynamic provider.\nRemove a dynamic provider, shutting down its instance and removing it from\nthe kvstore.", + "parameters": [ + { + "name": "api", + "in": "path", + "description": "API namespace the provider implements", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "provider_id", + "in": "path", + "description": "ID of the provider to unregister.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "deprecated": false + } + }, + "/v1alpha/admin/providers/{api}/{provider_id}/health": { + "get": { + "responses": { + "200": { + "description": "TestProviderConnectionResponse with health status.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestProviderConnectionResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Inspect" + ], + "summary": "Check provider health.", + "description": "Check provider health.\nExecute a health check on a provider to verify it is reachable and functioning.", + "parameters": [ + { + "name": "api", + "in": "path", + "description": "API namespace the provider implements.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "provider_id", + "in": "path", + "description": "ID of the provider to check.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "deprecated": false + } + }, "/v1alpha/agents": { "get": { "responses": { @@ -2084,6 +2302,391 @@ ], "title": "RegisterDatasetRequest" }, + "RegisterProviderRequest": { + "type": "object", + "properties": { + "provider_id": { + "type": "string", + "description": "Unique identifier for this provider instance." + }, + "provider_type": { + "type": "string", + "description": "Provider type (e.g., 'remote::openai')." + }, + "config": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "Provider configuration (API keys, endpoints, etc.)." + }, + "attributes": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Optional attributes for ABAC access control." + } + }, + "additionalProperties": false, + "required": [ + "provider_id", + "provider_type", + "config" + ], + "title": "RegisterProviderRequest" + }, + "ProviderConnectionInfo": { + "type": "object", + "properties": { + "provider_id": { + "type": "string", + "description": "Unique identifier for this provider instance" + }, + "api": { + "type": "string", + "description": "API namespace (e.g., \"inference\", \"vector_io\", \"safety\")" + }, + "provider_type": { + "type": "string", + "description": "Provider type identifier (e.g., \"remote::openai\", \"inline::faiss\")" + }, + "config": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "Provider-specific configuration (API keys, endpoints, etc.)" + }, + "status": { + "$ref": "#/components/schemas/ProviderConnectionStatus", + "description": "Current connection status" + }, + "health": { + "$ref": "#/components/schemas/ProviderHealth", + "description": "Most recent health check result" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when provider was registered" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp of last update" + }, + "last_health_check": { + "type": "string", + "format": "date-time", + "description": "Timestamp of last health check" + }, + "error_message": { + "type": "string", + "description": "Error message if status is failed" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "User-defined metadata (deprecated, use attributes)" + }, + "owner": { + "type": "object", + "properties": { + "principal": { + "type": "string" + }, + "attributes": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "principal" + ], + "description": "User who created this provider connection" + }, + "attributes": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Key-value attributes for ABAC access control" + } + }, + "additionalProperties": false, + "required": [ + "provider_id", + "api", + "provider_type", + "config", + "status", + "created_at", + "updated_at", + "metadata" + ], + "title": "ProviderConnectionInfo", + "description": "Information about a dynamically managed provider connection.\nThis model represents a provider that has been registered at runtime\nvia the /providers API, as opposed to static providers configured in run.yaml.\n\nDynamic providers support full lifecycle management including registration,\nconfiguration updates, health monitoring, and removal." + }, + "ProviderConnectionStatus": { + "type": "string", + "enum": [ + "pending", + "initializing", + "connected", + "failed", + "disconnected", + "testing" + ], + "title": "ProviderConnectionStatus", + "description": "Status of a dynamic provider connection." + }, + "ProviderHealth": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "OK", + "Error", + "Not Implemented" + ], + "description": "Health status (OK, ERROR, NOT_IMPLEMENTED)" + }, + "message": { + "type": "string", + "description": "Optional error or status message" + }, + "metrics": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "Provider-specific health metrics" + }, + "last_checked": { + "type": "string", + "format": "date-time", + "description": "Timestamp of last health check" + } + }, + "additionalProperties": false, + "required": [ + "status", + "metrics", + "last_checked" + ], + "title": "ProviderHealth", + "description": "Structured wrapper around provider health status.\nThis wraps the existing dict-based HealthResponse for API responses\nwhile maintaining backward compatibility with existing provider implementations." + }, + "RegisterProviderResponse": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/components/schemas/ProviderConnectionInfo", + "description": "Information about the registered provider" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ], + "title": "RegisterProviderResponse", + "description": "Response after registering a provider." + }, + "UpdateProviderRequest": { + "type": "object", + "properties": { + "config": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "New configuration parameters (merged with existing)" + }, + "attributes": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "New attributes for access control" + } + }, + "additionalProperties": false, + "title": "UpdateProviderRequest" + }, + "UpdateProviderResponse": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/components/schemas/ProviderConnectionInfo", + "description": "Updated provider information" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ], + "title": "UpdateProviderResponse", + "description": "Response after updating a provider." + }, + "TestProviderConnectionResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the connection test succeeded" + }, + "health": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "Health status from the provider" + }, + "error_message": { + "type": "string", + "description": "Error message if test failed" + } + }, + "additionalProperties": false, + "required": [ + "success" + ], + "title": "TestProviderConnectionResponse", + "description": "Response from testing a provider connection." + }, "AgentConfig": { "type": "object", "properties": { @@ -5520,9 +6123,19 @@ "description": "Llama Stack Evaluation API for running evaluations on model and agent candidates.", "x-displayName": "Evaluations" }, + { + "name": "Inspect", + "description": "APIs for inspecting the Llama Stack service, including health status, available API routes with methods and implementing providers.", + "x-displayName": "Inspect" + }, { "name": "PostTraining (Coming Soon)", "description": "" + }, + { + "name": "Providers", + "description": "Providers API for inspecting, listing, and modifying providers and their configurations.", + "x-displayName": "Providers" } ], "x-tagGroups": [ @@ -5534,7 +6147,9 @@ "DatasetIO", "Datasets", "Eval", - "PostTraining (Coming Soon)" + "Inspect", + "PostTraining (Coming Soon)", + "Providers" ] } ] diff --git a/docs/static/experimental-llama-stack-spec.yaml b/docs/static/experimental-llama-stack-spec.yaml index f15add8cf..64ab7146c 100644 --- a/docs/static/experimental-llama-stack-spec.yaml +++ b/docs/static/experimental-llama-stack-spec.yaml @@ -220,6 +220,178 @@ paths: schema: type: string deprecated: false + /v1alpha/admin/providers/{api}: + post: + responses: + '200': + description: >- + RegisterProviderResponse with the registered provider info. + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterProviderResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Providers + summary: Register a new dynamic provider. + description: >- + Register a new dynamic provider. + + Register a new provider instance at runtime. The provider will be validated, + + instantiated, and persisted to the kvstore. Requires appropriate ABAC permissions. + parameters: + - name: api + in: path + description: >- + API namespace this provider implements (e.g., 'inference', 'vector_io'). + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterProviderRequest' + required: true + deprecated: false + /v1alpha/admin/providers/{api}/{provider_id}: + post: + responses: + '200': + description: >- + UpdateProviderResponse with updated provider info + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProviderResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Providers + summary: >- + Update an existing provider's configuration. + description: >- + Update an existing provider's configuration. + + Update the configuration and/or attributes of a dynamic provider. The provider + + will be re-instantiated with the new configuration (hot-reload). + parameters: + - name: api + in: path + description: API namespace the provider implements + required: true + schema: + type: string + - name: provider_id + in: path + description: ID of the provider to update + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProviderRequest' + required: true + deprecated: false + delete: + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Providers + summary: Unregister a dynamic provider. + description: >- + Unregister a dynamic provider. + + Remove a dynamic provider, shutting down its instance and removing it from + + the kvstore. + parameters: + - name: api + in: path + description: API namespace the provider implements + required: true + schema: + type: string + - name: provider_id + in: path + description: ID of the provider to unregister. + required: true + schema: + type: string + deprecated: false + /v1alpha/admin/providers/{api}/{provider_id}/health: + get: + responses: + '200': + description: >- + TestProviderConnectionResponse with health status. + content: + application/json: + schema: + $ref: '#/components/schemas/TestProviderConnectionResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Inspect + summary: Check provider health. + description: >- + Check provider health. + + Execute a health check on a provider to verify it is reachable and functioning. + parameters: + - name: api + in: path + description: API namespace the provider implements. + required: true + schema: + type: string + - name: provider_id + in: path + description: ID of the provider to check. + required: true + schema: + type: string + deprecated: false /v1alpha/agents: get: responses: @@ -1495,6 +1667,273 @@ components: - purpose - source title: RegisterDatasetRequest + RegisterProviderRequest: + type: object + properties: + provider_id: + type: string + description: >- + Unique identifier for this provider instance. + provider_type: + type: string + description: Provider type (e.g., 'remote::openai'). + config: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + Provider configuration (API keys, endpoints, etc.). + attributes: + type: object + additionalProperties: + type: array + items: + type: string + description: >- + Optional attributes for ABAC access control. + additionalProperties: false + required: + - provider_id + - provider_type + - config + title: RegisterProviderRequest + ProviderConnectionInfo: + type: object + properties: + provider_id: + type: string + description: >- + Unique identifier for this provider instance + api: + type: string + description: >- + API namespace (e.g., "inference", "vector_io", "safety") + provider_type: + type: string + description: >- + Provider type identifier (e.g., "remote::openai", "inline::faiss") + config: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + Provider-specific configuration (API keys, endpoints, etc.) + status: + $ref: '#/components/schemas/ProviderConnectionStatus' + description: Current connection status + health: + $ref: '#/components/schemas/ProviderHealth' + description: Most recent health check result + created_at: + type: string + format: date-time + description: Timestamp when provider was registered + updated_at: + type: string + format: date-time + description: Timestamp of last update + last_health_check: + type: string + format: date-time + description: Timestamp of last health check + error_message: + type: string + description: Error message if status is failed + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + User-defined metadata (deprecated, use attributes) + owner: + type: object + properties: + principal: + type: string + attributes: + type: object + additionalProperties: + type: array + items: + type: string + additionalProperties: false + required: + - principal + description: >- + User who created this provider connection + attributes: + type: object + additionalProperties: + type: array + items: + type: string + description: >- + Key-value attributes for ABAC access control + additionalProperties: false + required: + - provider_id + - api + - provider_type + - config + - status + - created_at + - updated_at + - metadata + title: ProviderConnectionInfo + description: >- + Information about a dynamically managed provider connection. + + This model represents a provider that has been registered at runtime + + via the /providers API, as opposed to static providers configured in run.yaml. + + + Dynamic providers support full lifecycle management including registration, + + configuration updates, health monitoring, and removal. + ProviderConnectionStatus: + type: string + enum: + - pending + - initializing + - connected + - failed + - disconnected + - testing + title: ProviderConnectionStatus + description: Status of a dynamic provider connection. + ProviderHealth: + type: object + properties: + status: + type: string + enum: + - OK + - Error + - Not Implemented + description: >- + Health status (OK, ERROR, NOT_IMPLEMENTED) + message: + type: string + description: Optional error or status message + metrics: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Provider-specific health metrics + last_checked: + type: string + format: date-time + description: Timestamp of last health check + additionalProperties: false + required: + - status + - metrics + - last_checked + title: ProviderHealth + description: >- + Structured wrapper around provider health status. + + This wraps the existing dict-based HealthResponse for API responses + + while maintaining backward compatibility with existing provider implementations. + RegisterProviderResponse: + type: object + properties: + provider: + $ref: '#/components/schemas/ProviderConnectionInfo' + description: >- + Information about the registered provider + additionalProperties: false + required: + - provider + title: RegisterProviderResponse + description: Response after registering a provider. + UpdateProviderRequest: + type: object + properties: + config: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + New configuration parameters (merged with existing) + attributes: + type: object + additionalProperties: + type: array + items: + type: string + description: New attributes for access control + additionalProperties: false + title: UpdateProviderRequest + UpdateProviderResponse: + type: object + properties: + provider: + $ref: '#/components/schemas/ProviderConnectionInfo' + description: Updated provider information + additionalProperties: false + required: + - provider + title: UpdateProviderResponse + description: Response after updating a provider. + TestProviderConnectionResponse: + type: object + properties: + success: + type: boolean + description: Whether the connection test succeeded + health: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Health status from the provider + error_message: + type: string + description: Error message if test failed + additionalProperties: false + required: + - success + title: TestProviderConnectionResponse + description: >- + Response from testing a provider connection. AgentConfig: type: object properties: @@ -4121,8 +4560,17 @@ tags: description: >- Llama Stack Evaluation API for running evaluations on model and agent candidates. x-displayName: Evaluations + - name: Inspect + description: >- + APIs for inspecting the Llama Stack service, including health status, available + API routes with methods and implementing providers. + x-displayName: Inspect - name: PostTraining (Coming Soon) description: '' + - name: Providers + description: >- + Providers API for inspecting, listing, and modifying providers and their configurations. + x-displayName: Providers x-tagGroups: - name: Operations tags: @@ -4131,4 +4579,6 @@ x-tagGroups: - DatasetIO - Datasets - Eval + - Inspect - PostTraining (Coming Soon) + - Providers diff --git a/docs/static/llama-stack-spec.html b/docs/static/llama-stack-spec.html index 864cf118a..8382b1f9e 100644 --- a/docs/static/llama-stack-spec.html +++ b/docs/static/llama-stack-spec.html @@ -40,224 +40,6 @@ } ], "paths": { - "/v1/admin/providers/{api}": { - "post": { - "responses": { - "200": { - "description": "RegisterProviderResponse with the registered provider info.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RegisterProviderResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Providers" - ], - "summary": "Register a new dynamic provider.", - "description": "Register a new dynamic provider.\nRegister a new provider instance at runtime. The provider will be validated,\ninstantiated, and persisted to the kvstore. Requires appropriate ABAC permissions.", - "parameters": [ - { - "name": "api", - "in": "path", - "description": "API namespace this provider implements (e.g., 'inference', 'vector_io').", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RegisterProviderRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1/admin/providers/{api}/{provider_id}": { - "post": { - "responses": { - "200": { - "description": "UpdateProviderResponse with updated provider info", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateProviderResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Providers" - ], - "summary": "Update an existing provider's configuration.", - "description": "Update an existing provider's configuration.\nUpdate the configuration and/or attributes of a dynamic provider. The provider\nwill be re-instantiated with the new configuration (hot-reload).", - "parameters": [ - { - "name": "api", - "in": "path", - "description": "API namespace the provider implements", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "provider_id", - "in": "path", - "description": "ID of the provider to update", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateProviderRequest" - } - } - }, - "required": true - }, - "deprecated": false - }, - "delete": { - "responses": { - "200": { - "description": "OK" - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Providers" - ], - "summary": "Unregister a dynamic provider.", - "description": "Unregister a dynamic provider.\nRemove a dynamic provider, shutting down its instance and removing it from\nthe kvstore.", - "parameters": [ - { - "name": "api", - "in": "path", - "description": "API namespace the provider implements", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "provider_id", - "in": "path", - "description": "ID of the provider to unregister.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "deprecated": false - } - }, - "/v1/admin/providers/{api}/{provider_id}/test": { - "post": { - "responses": { - "200": { - "description": "TestProviderConnectionResponse with health status.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestProviderConnectionResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Providers" - ], - "summary": "Test a provider connection.", - "description": "Test a provider connection.\nExecute a health check on a provider to verify it is reachable and functioning.", - "parameters": [ - { - "name": "api", - "in": "path", - "description": "API namespace the provider implements.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "provider_id", - "in": "path", - "description": "ID of the provider to test.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "deprecated": false - } - }, "/v1/chat/completions": { "get": { "responses": { @@ -1223,41 +1005,6 @@ "deprecated": false } }, - "/v1/health": { - "get": { - "responses": { - "200": { - "description": "Health information indicating if the service is operational.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HealthInfo" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Inspect" - ], - "summary": "Get health status.", - "description": "Get health status.\nGet the current health status of the service.", - "parameters": [], - "deprecated": false - } - }, "/v1/inspect/routes": { "get": { "responses": { @@ -4277,391 +4024,6 @@ "title": "Error", "description": "Error response from the API. Roughly follows RFC 7807." }, - "RegisterProviderRequest": { - "type": "object", - "properties": { - "provider_id": { - "type": "string", - "description": "Unique identifier for this provider instance." - }, - "provider_type": { - "type": "string", - "description": "Provider type (e.g., 'remote::openai')." - }, - "config": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "Provider configuration (API keys, endpoints, etc.)." - }, - "attributes": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "Optional attributes for ABAC access control." - } - }, - "additionalProperties": false, - "required": [ - "provider_id", - "provider_type", - "config" - ], - "title": "RegisterProviderRequest" - }, - "ProviderConnectionInfo": { - "type": "object", - "properties": { - "provider_id": { - "type": "string", - "description": "Unique identifier for this provider instance" - }, - "api": { - "type": "string", - "description": "API namespace (e.g., \"inference\", \"vector_io\", \"safety\")" - }, - "provider_type": { - "type": "string", - "description": "Provider type identifier (e.g., \"remote::openai\", \"inline::faiss\")" - }, - "config": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "Provider-specific configuration (API keys, endpoints, etc.)" - }, - "status": { - "$ref": "#/components/schemas/ProviderConnectionStatus", - "description": "Current connection status" - }, - "health": { - "$ref": "#/components/schemas/ProviderHealth", - "description": "Most recent health check result" - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp when provider was registered" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp of last update" - }, - "last_health_check": { - "type": "string", - "format": "date-time", - "description": "Timestamp of last health check" - }, - "error_message": { - "type": "string", - "description": "Error message if status is failed" - }, - "metadata": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "User-defined metadata (deprecated, use attributes)" - }, - "owner": { - "type": "object", - "properties": { - "principal": { - "type": "string" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "additionalProperties": false, - "required": [ - "principal" - ], - "description": "User who created this provider connection" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "Key-value attributes for ABAC access control" - } - }, - "additionalProperties": false, - "required": [ - "provider_id", - "api", - "provider_type", - "config", - "status", - "created_at", - "updated_at", - "metadata" - ], - "title": "ProviderConnectionInfo", - "description": "Information about a dynamically managed provider connection.\nThis model represents a provider that has been registered at runtime\nvia the /providers API, as opposed to static providers configured in run.yaml.\n\nDynamic providers support full lifecycle management including registration,\nconfiguration updates, health monitoring, and removal." - }, - "ProviderConnectionStatus": { - "type": "string", - "enum": [ - "pending", - "initializing", - "connected", - "failed", - "disconnected", - "testing" - ], - "title": "ProviderConnectionStatus", - "description": "Status of a dynamic provider connection." - }, - "ProviderHealth": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "OK", - "Error", - "Not Implemented" - ], - "description": "Health status (OK, ERROR, NOT_IMPLEMENTED)" - }, - "message": { - "type": "string", - "description": "Optional error or status message" - }, - "metrics": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "Provider-specific health metrics" - }, - "last_checked": { - "type": "string", - "format": "date-time", - "description": "Timestamp of last health check" - } - }, - "additionalProperties": false, - "required": [ - "status", - "metrics", - "last_checked" - ], - "title": "ProviderHealth", - "description": "Structured wrapper around provider health status.\nThis wraps the existing dict-based HealthResponse for API responses\nwhile maintaining backward compatibility with existing provider implementations." - }, - "RegisterProviderResponse": { - "type": "object", - "properties": { - "provider": { - "$ref": "#/components/schemas/ProviderConnectionInfo", - "description": "Information about the registered provider" - } - }, - "additionalProperties": false, - "required": [ - "provider" - ], - "title": "RegisterProviderResponse", - "description": "Response after registering a provider." - }, - "UpdateProviderRequest": { - "type": "object", - "properties": { - "config": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "New configuration parameters (merged with existing)" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "New attributes for access control" - } - }, - "additionalProperties": false, - "title": "UpdateProviderRequest" - }, - "UpdateProviderResponse": { - "type": "object", - "properties": { - "provider": { - "$ref": "#/components/schemas/ProviderConnectionInfo", - "description": "Updated provider information" - } - }, - "additionalProperties": false, - "required": [ - "provider" - ], - "title": "UpdateProviderResponse", - "description": "Response after updating a provider." - }, - "TestProviderConnectionResponse": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Whether the connection test succeeded" - }, - "health": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "Health status from the provider" - }, - "error_message": { - "type": "string", - "description": "Error message if test failed" - } - }, - "additionalProperties": false, - "required": [ - "success" - ], - "title": "TestProviderConnectionResponse", - "description": "Response from testing a provider connection." - }, "Order": { "type": "string", "enum": [ @@ -7338,26 +6700,6 @@ "type": "object", "title": "Response" }, - "HealthInfo": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "OK", - "Error", - "Not Implemented" - ], - "description": "Current health status of the service" - } - }, - "additionalProperties": false, - "required": [ - "status" - ], - "title": "HealthInfo", - "description": "Health status information for the service." - }, "RouteInfo": { "type": "object", "properties": { diff --git a/docs/static/llama-stack-spec.yaml b/docs/static/llama-stack-spec.yaml index eab53a309..5354bd1c0 100644 --- a/docs/static/llama-stack-spec.yaml +++ b/docs/static/llama-stack-spec.yaml @@ -12,178 +12,6 @@ info: servers: - url: http://any-hosted-llama-stack.com paths: - /v1/admin/providers/{api}: - post: - responses: - '200': - description: >- - RegisterProviderResponse with the registered provider info. - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterProviderResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Register a new dynamic provider. - description: >- - Register a new dynamic provider. - - Register a new provider instance at runtime. The provider will be validated, - - instantiated, and persisted to the kvstore. Requires appropriate ABAC permissions. - parameters: - - name: api - in: path - description: >- - API namespace this provider implements (e.g., 'inference', 'vector_io'). - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterProviderRequest' - required: true - deprecated: false - /v1/admin/providers/{api}/{provider_id}: - post: - responses: - '200': - description: >- - UpdateProviderResponse with updated provider info - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProviderResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: >- - Update an existing provider's configuration. - description: >- - Update an existing provider's configuration. - - Update the configuration and/or attributes of a dynamic provider. The provider - - will be re-instantiated with the new configuration (hot-reload). - parameters: - - name: api - in: path - description: API namespace the provider implements - required: true - schema: - type: string - - name: provider_id - in: path - description: ID of the provider to update - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProviderRequest' - required: true - deprecated: false - delete: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Unregister a dynamic provider. - description: >- - Unregister a dynamic provider. - - Remove a dynamic provider, shutting down its instance and removing it from - - the kvstore. - parameters: - - name: api - in: path - description: API namespace the provider implements - required: true - schema: - type: string - - name: provider_id - in: path - description: ID of the provider to unregister. - required: true - schema: - type: string - deprecated: false - /v1/admin/providers/{api}/{provider_id}/test: - post: - responses: - '200': - description: >- - TestProviderConnectionResponse with health status. - content: - application/json: - schema: - $ref: '#/components/schemas/TestProviderConnectionResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Test a provider connection. - description: >- - Test a provider connection. - - Execute a health check on a provider to verify it is reachable and functioning. - parameters: - - name: api - in: path - description: API namespace the provider implements. - required: true - schema: - type: string - - name: provider_id - in: path - description: ID of the provider to test. - required: true - schema: - type: string - deprecated: false /v1/chat/completions: get: responses: @@ -934,35 +762,6 @@ paths: schema: type: string deprecated: false - /v1/health: - get: - responses: - '200': - description: >- - Health information indicating if the service is operational. - content: - application/json: - schema: - $ref: '#/components/schemas/HealthInfo' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Inspect - summary: Get health status. - description: >- - Get health status. - - Get the current health status of the service. - parameters: [] - deprecated: false /v1/inspect/routes: get: responses: @@ -3213,273 +3012,6 @@ components: title: Error description: >- Error response from the API. Roughly follows RFC 7807. - RegisterProviderRequest: - type: object - properties: - provider_id: - type: string - description: >- - Unique identifier for this provider instance. - provider_type: - type: string - description: Provider type (e.g., 'remote::openai'). - config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Provider configuration (API keys, endpoints, etc.). - attributes: - type: object - additionalProperties: - type: array - items: - type: string - description: >- - Optional attributes for ABAC access control. - additionalProperties: false - required: - - provider_id - - provider_type - - config - title: RegisterProviderRequest - ProviderConnectionInfo: - type: object - properties: - provider_id: - type: string - description: >- - Unique identifier for this provider instance - api: - type: string - description: >- - API namespace (e.g., "inference", "vector_io", "safety") - provider_type: - type: string - description: >- - Provider type identifier (e.g., "remote::openai", "inline::faiss") - config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Provider-specific configuration (API keys, endpoints, etc.) - status: - $ref: '#/components/schemas/ProviderConnectionStatus' - description: Current connection status - health: - $ref: '#/components/schemas/ProviderHealth' - description: Most recent health check result - created_at: - type: string - format: date-time - description: Timestamp when provider was registered - updated_at: - type: string - format: date-time - description: Timestamp of last update - last_health_check: - type: string - format: date-time - description: Timestamp of last health check - error_message: - type: string - description: Error message if status is failed - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - User-defined metadata (deprecated, use attributes) - owner: - type: object - properties: - principal: - type: string - attributes: - type: object - additionalProperties: - type: array - items: - type: string - additionalProperties: false - required: - - principal - description: >- - User who created this provider connection - attributes: - type: object - additionalProperties: - type: array - items: - type: string - description: >- - Key-value attributes for ABAC access control - additionalProperties: false - required: - - provider_id - - api - - provider_type - - config - - status - - created_at - - updated_at - - metadata - title: ProviderConnectionInfo - description: >- - Information about a dynamically managed provider connection. - - This model represents a provider that has been registered at runtime - - via the /providers API, as opposed to static providers configured in run.yaml. - - - Dynamic providers support full lifecycle management including registration, - - configuration updates, health monitoring, and removal. - ProviderConnectionStatus: - type: string - enum: - - pending - - initializing - - connected - - failed - - disconnected - - testing - title: ProviderConnectionStatus - description: Status of a dynamic provider connection. - ProviderHealth: - type: object - properties: - status: - type: string - enum: - - OK - - Error - - Not Implemented - description: >- - Health status (OK, ERROR, NOT_IMPLEMENTED) - message: - type: string - description: Optional error or status message - metrics: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Provider-specific health metrics - last_checked: - type: string - format: date-time - description: Timestamp of last health check - additionalProperties: false - required: - - status - - metrics - - last_checked - title: ProviderHealth - description: >- - Structured wrapper around provider health status. - - This wraps the existing dict-based HealthResponse for API responses - - while maintaining backward compatibility with existing provider implementations. - RegisterProviderResponse: - type: object - properties: - provider: - $ref: '#/components/schemas/ProviderConnectionInfo' - description: >- - Information about the registered provider - additionalProperties: false - required: - - provider - title: RegisterProviderResponse - description: Response after registering a provider. - UpdateProviderRequest: - type: object - properties: - config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - New configuration parameters (merged with existing) - attributes: - type: object - additionalProperties: - type: array - items: - type: string - description: New attributes for access control - additionalProperties: false - title: UpdateProviderRequest - UpdateProviderResponse: - type: object - properties: - provider: - $ref: '#/components/schemas/ProviderConnectionInfo' - description: Updated provider information - additionalProperties: false - required: - - provider - title: UpdateProviderResponse - description: Response after updating a provider. - TestProviderConnectionResponse: - type: object - properties: - success: - type: boolean - description: Whether the connection test succeeded - health: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Health status from the provider - error_message: - type: string - description: Error message if test failed - additionalProperties: false - required: - - success - title: TestProviderConnectionResponse - description: >- - Response from testing a provider connection. Order: type: string enum: @@ -5533,22 +5065,6 @@ components: Response: type: object title: Response - HealthInfo: - type: object - properties: - status: - type: string - enum: - - OK - - Error - - Not Implemented - description: Current health status of the service - additionalProperties: false - required: - - status - title: HealthInfo - description: >- - Health status information for the service. RouteInfo: type: object properties: diff --git a/docs/static/stainless-llama-stack-spec.html b/docs/static/stainless-llama-stack-spec.html index ea66ecad7..650ebb39d 100644 --- a/docs/static/stainless-llama-stack-spec.html +++ b/docs/static/stainless-llama-stack-spec.html @@ -40,224 +40,6 @@ } ], "paths": { - "/v1/admin/providers/{api}": { - "post": { - "responses": { - "200": { - "description": "RegisterProviderResponse with the registered provider info.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RegisterProviderResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Providers" - ], - "summary": "Register a new dynamic provider.", - "description": "Register a new dynamic provider.\nRegister a new provider instance at runtime. The provider will be validated,\ninstantiated, and persisted to the kvstore. Requires appropriate ABAC permissions.", - "parameters": [ - { - "name": "api", - "in": "path", - "description": "API namespace this provider implements (e.g., 'inference', 'vector_io').", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RegisterProviderRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1/admin/providers/{api}/{provider_id}": { - "post": { - "responses": { - "200": { - "description": "UpdateProviderResponse with updated provider info", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateProviderResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Providers" - ], - "summary": "Update an existing provider's configuration.", - "description": "Update an existing provider's configuration.\nUpdate the configuration and/or attributes of a dynamic provider. The provider\nwill be re-instantiated with the new configuration (hot-reload).", - "parameters": [ - { - "name": "api", - "in": "path", - "description": "API namespace the provider implements", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "provider_id", - "in": "path", - "description": "ID of the provider to update", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateProviderRequest" - } - } - }, - "required": true - }, - "deprecated": false - }, - "delete": { - "responses": { - "200": { - "description": "OK" - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Providers" - ], - "summary": "Unregister a dynamic provider.", - "description": "Unregister a dynamic provider.\nRemove a dynamic provider, shutting down its instance and removing it from\nthe kvstore.", - "parameters": [ - { - "name": "api", - "in": "path", - "description": "API namespace the provider implements", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "provider_id", - "in": "path", - "description": "ID of the provider to unregister.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "deprecated": false - } - }, - "/v1/admin/providers/{api}/{provider_id}/test": { - "post": { - "responses": { - "200": { - "description": "TestProviderConnectionResponse with health status.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestProviderConnectionResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Providers" - ], - "summary": "Test a provider connection.", - "description": "Test a provider connection.\nExecute a health check on a provider to verify it is reachable and functioning.", - "parameters": [ - { - "name": "api", - "in": "path", - "description": "API namespace the provider implements.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "provider_id", - "in": "path", - "description": "ID of the provider to test.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "deprecated": false - } - }, "/v1/chat/completions": { "get": { "responses": { @@ -1223,41 +1005,6 @@ "deprecated": false } }, - "/v1/health": { - "get": { - "responses": { - "200": { - "description": "Health information indicating if the service is operational.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HealthInfo" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Inspect" - ], - "summary": "Get health status.", - "description": "Get health status.\nGet the current health status of the service.", - "parameters": [], - "deprecated": false - } - }, "/v1/inspect/routes": { "get": { "responses": { @@ -4514,6 +4261,224 @@ "deprecated": false } }, + "/v1alpha/admin/providers/{api}": { + "post": { + "responses": { + "200": { + "description": "RegisterProviderResponse with the registered provider info.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterProviderResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Providers" + ], + "summary": "Register a new dynamic provider.", + "description": "Register a new dynamic provider.\nRegister a new provider instance at runtime. The provider will be validated,\ninstantiated, and persisted to the kvstore. Requires appropriate ABAC permissions.", + "parameters": [ + { + "name": "api", + "in": "path", + "description": "API namespace this provider implements (e.g., 'inference', 'vector_io').", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterProviderRequest" + } + } + }, + "required": true + }, + "deprecated": false + } + }, + "/v1alpha/admin/providers/{api}/{provider_id}": { + "post": { + "responses": { + "200": { + "description": "UpdateProviderResponse with updated provider info", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateProviderResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Providers" + ], + "summary": "Update an existing provider's configuration.", + "description": "Update an existing provider's configuration.\nUpdate the configuration and/or attributes of a dynamic provider. The provider\nwill be re-instantiated with the new configuration (hot-reload).", + "parameters": [ + { + "name": "api", + "in": "path", + "description": "API namespace the provider implements", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "provider_id", + "in": "path", + "description": "ID of the provider to update", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateProviderRequest" + } + } + }, + "required": true + }, + "deprecated": false + }, + "delete": { + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Providers" + ], + "summary": "Unregister a dynamic provider.", + "description": "Unregister a dynamic provider.\nRemove a dynamic provider, shutting down its instance and removing it from\nthe kvstore.", + "parameters": [ + { + "name": "api", + "in": "path", + "description": "API namespace the provider implements", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "provider_id", + "in": "path", + "description": "ID of the provider to unregister.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "deprecated": false + } + }, + "/v1alpha/admin/providers/{api}/{provider_id}/health": { + "get": { + "responses": { + "200": { + "description": "TestProviderConnectionResponse with health status.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestProviderConnectionResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Inspect" + ], + "summary": "Check provider health.", + "description": "Check provider health.\nExecute a health check on a provider to verify it is reachable and functioning.", + "parameters": [ + { + "name": "api", + "in": "path", + "description": "API namespace the provider implements.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "provider_id", + "in": "path", + "description": "ID of the provider to check.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "deprecated": false + } + }, "/v1alpha/agents": { "get": { "responses": { @@ -5949,391 +5914,6 @@ "title": "Error", "description": "Error response from the API. Roughly follows RFC 7807." }, - "RegisterProviderRequest": { - "type": "object", - "properties": { - "provider_id": { - "type": "string", - "description": "Unique identifier for this provider instance." - }, - "provider_type": { - "type": "string", - "description": "Provider type (e.g., 'remote::openai')." - }, - "config": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "Provider configuration (API keys, endpoints, etc.)." - }, - "attributes": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "Optional attributes for ABAC access control." - } - }, - "additionalProperties": false, - "required": [ - "provider_id", - "provider_type", - "config" - ], - "title": "RegisterProviderRequest" - }, - "ProviderConnectionInfo": { - "type": "object", - "properties": { - "provider_id": { - "type": "string", - "description": "Unique identifier for this provider instance" - }, - "api": { - "type": "string", - "description": "API namespace (e.g., \"inference\", \"vector_io\", \"safety\")" - }, - "provider_type": { - "type": "string", - "description": "Provider type identifier (e.g., \"remote::openai\", \"inline::faiss\")" - }, - "config": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "Provider-specific configuration (API keys, endpoints, etc.)" - }, - "status": { - "$ref": "#/components/schemas/ProviderConnectionStatus", - "description": "Current connection status" - }, - "health": { - "$ref": "#/components/schemas/ProviderHealth", - "description": "Most recent health check result" - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp when provider was registered" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp of last update" - }, - "last_health_check": { - "type": "string", - "format": "date-time", - "description": "Timestamp of last health check" - }, - "error_message": { - "type": "string", - "description": "Error message if status is failed" - }, - "metadata": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "User-defined metadata (deprecated, use attributes)" - }, - "owner": { - "type": "object", - "properties": { - "principal": { - "type": "string" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "additionalProperties": false, - "required": [ - "principal" - ], - "description": "User who created this provider connection" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "Key-value attributes for ABAC access control" - } - }, - "additionalProperties": false, - "required": [ - "provider_id", - "api", - "provider_type", - "config", - "status", - "created_at", - "updated_at", - "metadata" - ], - "title": "ProviderConnectionInfo", - "description": "Information about a dynamically managed provider connection.\nThis model represents a provider that has been registered at runtime\nvia the /providers API, as opposed to static providers configured in run.yaml.\n\nDynamic providers support full lifecycle management including registration,\nconfiguration updates, health monitoring, and removal." - }, - "ProviderConnectionStatus": { - "type": "string", - "enum": [ - "pending", - "initializing", - "connected", - "failed", - "disconnected", - "testing" - ], - "title": "ProviderConnectionStatus", - "description": "Status of a dynamic provider connection." - }, - "ProviderHealth": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "OK", - "Error", - "Not Implemented" - ], - "description": "Health status (OK, ERROR, NOT_IMPLEMENTED)" - }, - "message": { - "type": "string", - "description": "Optional error or status message" - }, - "metrics": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "Provider-specific health metrics" - }, - "last_checked": { - "type": "string", - "format": "date-time", - "description": "Timestamp of last health check" - } - }, - "additionalProperties": false, - "required": [ - "status", - "metrics", - "last_checked" - ], - "title": "ProviderHealth", - "description": "Structured wrapper around provider health status.\nThis wraps the existing dict-based HealthResponse for API responses\nwhile maintaining backward compatibility with existing provider implementations." - }, - "RegisterProviderResponse": { - "type": "object", - "properties": { - "provider": { - "$ref": "#/components/schemas/ProviderConnectionInfo", - "description": "Information about the registered provider" - } - }, - "additionalProperties": false, - "required": [ - "provider" - ], - "title": "RegisterProviderResponse", - "description": "Response after registering a provider." - }, - "UpdateProviderRequest": { - "type": "object", - "properties": { - "config": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "New configuration parameters (merged with existing)" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "New attributes for access control" - } - }, - "additionalProperties": false, - "title": "UpdateProviderRequest" - }, - "UpdateProviderResponse": { - "type": "object", - "properties": { - "provider": { - "$ref": "#/components/schemas/ProviderConnectionInfo", - "description": "Updated provider information" - } - }, - "additionalProperties": false, - "required": [ - "provider" - ], - "title": "UpdateProviderResponse", - "description": "Response after updating a provider." - }, - "TestProviderConnectionResponse": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Whether the connection test succeeded" - }, - "health": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "Health status from the provider" - }, - "error_message": { - "type": "string", - "description": "Error message if test failed" - } - }, - "additionalProperties": false, - "required": [ - "success" - ], - "title": "TestProviderConnectionResponse", - "description": "Response from testing a provider connection." - }, "Order": { "type": "string", "enum": [ @@ -9010,26 +8590,6 @@ "type": "object", "title": "Response" }, - "HealthInfo": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "OK", - "Error", - "Not Implemented" - ], - "description": "Current health status of the service" - } - }, - "additionalProperties": false, - "required": [ - "status" - ], - "title": "HealthInfo", - "description": "Health status information for the service." - }, "RouteInfo": { "type": "object", "properties": { @@ -15802,6 +15362,391 @@ ], "title": "RegisterDatasetRequest" }, + "RegisterProviderRequest": { + "type": "object", + "properties": { + "provider_id": { + "type": "string", + "description": "Unique identifier for this provider instance." + }, + "provider_type": { + "type": "string", + "description": "Provider type (e.g., 'remote::openai')." + }, + "config": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "Provider configuration (API keys, endpoints, etc.)." + }, + "attributes": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Optional attributes for ABAC access control." + } + }, + "additionalProperties": false, + "required": [ + "provider_id", + "provider_type", + "config" + ], + "title": "RegisterProviderRequest" + }, + "ProviderConnectionInfo": { + "type": "object", + "properties": { + "provider_id": { + "type": "string", + "description": "Unique identifier for this provider instance" + }, + "api": { + "type": "string", + "description": "API namespace (e.g., \"inference\", \"vector_io\", \"safety\")" + }, + "provider_type": { + "type": "string", + "description": "Provider type identifier (e.g., \"remote::openai\", \"inline::faiss\")" + }, + "config": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "Provider-specific configuration (API keys, endpoints, etc.)" + }, + "status": { + "$ref": "#/components/schemas/ProviderConnectionStatus", + "description": "Current connection status" + }, + "health": { + "$ref": "#/components/schemas/ProviderHealth", + "description": "Most recent health check result" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when provider was registered" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp of last update" + }, + "last_health_check": { + "type": "string", + "format": "date-time", + "description": "Timestamp of last health check" + }, + "error_message": { + "type": "string", + "description": "Error message if status is failed" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "User-defined metadata (deprecated, use attributes)" + }, + "owner": { + "type": "object", + "properties": { + "principal": { + "type": "string" + }, + "attributes": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "principal" + ], + "description": "User who created this provider connection" + }, + "attributes": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Key-value attributes for ABAC access control" + } + }, + "additionalProperties": false, + "required": [ + "provider_id", + "api", + "provider_type", + "config", + "status", + "created_at", + "updated_at", + "metadata" + ], + "title": "ProviderConnectionInfo", + "description": "Information about a dynamically managed provider connection.\nThis model represents a provider that has been registered at runtime\nvia the /providers API, as opposed to static providers configured in run.yaml.\n\nDynamic providers support full lifecycle management including registration,\nconfiguration updates, health monitoring, and removal." + }, + "ProviderConnectionStatus": { + "type": "string", + "enum": [ + "pending", + "initializing", + "connected", + "failed", + "disconnected", + "testing" + ], + "title": "ProviderConnectionStatus", + "description": "Status of a dynamic provider connection." + }, + "ProviderHealth": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "OK", + "Error", + "Not Implemented" + ], + "description": "Health status (OK, ERROR, NOT_IMPLEMENTED)" + }, + "message": { + "type": "string", + "description": "Optional error or status message" + }, + "metrics": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "Provider-specific health metrics" + }, + "last_checked": { + "type": "string", + "format": "date-time", + "description": "Timestamp of last health check" + } + }, + "additionalProperties": false, + "required": [ + "status", + "metrics", + "last_checked" + ], + "title": "ProviderHealth", + "description": "Structured wrapper around provider health status.\nThis wraps the existing dict-based HealthResponse for API responses\nwhile maintaining backward compatibility with existing provider implementations." + }, + "RegisterProviderResponse": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/components/schemas/ProviderConnectionInfo", + "description": "Information about the registered provider" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ], + "title": "RegisterProviderResponse", + "description": "Response after registering a provider." + }, + "UpdateProviderRequest": { + "type": "object", + "properties": { + "config": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "New configuration parameters (merged with existing)" + }, + "attributes": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "New attributes for access control" + } + }, + "additionalProperties": false, + "title": "UpdateProviderRequest" + }, + "UpdateProviderResponse": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/components/schemas/ProviderConnectionInfo", + "description": "Updated provider information" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ], + "title": "UpdateProviderResponse", + "description": "Response after updating a provider." + }, + "TestProviderConnectionResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the connection test succeeded" + }, + "health": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "Health status from the provider" + }, + "error_message": { + "type": "string", + "description": "Error message if test failed" + } + }, + "additionalProperties": false, + "required": [ + "success" + ], + "title": "TestProviderConnectionResponse", + "description": "Response from testing a provider connection." + }, "AgentConfig": { "type": "object", "properties": { diff --git a/docs/static/stainless-llama-stack-spec.yaml b/docs/static/stainless-llama-stack-spec.yaml index e05d6eba1..0e27c4bad 100644 --- a/docs/static/stainless-llama-stack-spec.yaml +++ b/docs/static/stainless-llama-stack-spec.yaml @@ -15,178 +15,6 @@ info: servers: - url: http://any-hosted-llama-stack.com paths: - /v1/admin/providers/{api}: - post: - responses: - '200': - description: >- - RegisterProviderResponse with the registered provider info. - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterProviderResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Register a new dynamic provider. - description: >- - Register a new dynamic provider. - - Register a new provider instance at runtime. The provider will be validated, - - instantiated, and persisted to the kvstore. Requires appropriate ABAC permissions. - parameters: - - name: api - in: path - description: >- - API namespace this provider implements (e.g., 'inference', 'vector_io'). - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterProviderRequest' - required: true - deprecated: false - /v1/admin/providers/{api}/{provider_id}: - post: - responses: - '200': - description: >- - UpdateProviderResponse with updated provider info - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProviderResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: >- - Update an existing provider's configuration. - description: >- - Update an existing provider's configuration. - - Update the configuration and/or attributes of a dynamic provider. The provider - - will be re-instantiated with the new configuration (hot-reload). - parameters: - - name: api - in: path - description: API namespace the provider implements - required: true - schema: - type: string - - name: provider_id - in: path - description: ID of the provider to update - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProviderRequest' - required: true - deprecated: false - delete: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Unregister a dynamic provider. - description: >- - Unregister a dynamic provider. - - Remove a dynamic provider, shutting down its instance and removing it from - - the kvstore. - parameters: - - name: api - in: path - description: API namespace the provider implements - required: true - schema: - type: string - - name: provider_id - in: path - description: ID of the provider to unregister. - required: true - schema: - type: string - deprecated: false - /v1/admin/providers/{api}/{provider_id}/test: - post: - responses: - '200': - description: >- - TestProviderConnectionResponse with health status. - content: - application/json: - schema: - $ref: '#/components/schemas/TestProviderConnectionResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Test a provider connection. - description: >- - Test a provider connection. - - Execute a health check on a provider to verify it is reachable and functioning. - parameters: - - name: api - in: path - description: API namespace the provider implements. - required: true - schema: - type: string - - name: provider_id - in: path - description: ID of the provider to test. - required: true - schema: - type: string - deprecated: false /v1/chat/completions: get: responses: @@ -937,35 +765,6 @@ paths: schema: type: string deprecated: false - /v1/health: - get: - responses: - '200': - description: >- - Health information indicating if the service is operational. - content: - application/json: - schema: - $ref: '#/components/schemas/HealthInfo' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Inspect - summary: Get health status. - description: >- - Get health status. - - Get the current health status of the service. - parameters: [] - deprecated: false /v1/inspect/routes: get: responses: @@ -3390,6 +3189,178 @@ paths: schema: type: string deprecated: false + /v1alpha/admin/providers/{api}: + post: + responses: + '200': + description: >- + RegisterProviderResponse with the registered provider info. + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterProviderResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Providers + summary: Register a new dynamic provider. + description: >- + Register a new dynamic provider. + + Register a new provider instance at runtime. The provider will be validated, + + instantiated, and persisted to the kvstore. Requires appropriate ABAC permissions. + parameters: + - name: api + in: path + description: >- + API namespace this provider implements (e.g., 'inference', 'vector_io'). + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterProviderRequest' + required: true + deprecated: false + /v1alpha/admin/providers/{api}/{provider_id}: + post: + responses: + '200': + description: >- + UpdateProviderResponse with updated provider info + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProviderResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Providers + summary: >- + Update an existing provider's configuration. + description: >- + Update an existing provider's configuration. + + Update the configuration and/or attributes of a dynamic provider. The provider + + will be re-instantiated with the new configuration (hot-reload). + parameters: + - name: api + in: path + description: API namespace the provider implements + required: true + schema: + type: string + - name: provider_id + in: path + description: ID of the provider to update + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProviderRequest' + required: true + deprecated: false + delete: + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Providers + summary: Unregister a dynamic provider. + description: >- + Unregister a dynamic provider. + + Remove a dynamic provider, shutting down its instance and removing it from + + the kvstore. + parameters: + - name: api + in: path + description: API namespace the provider implements + required: true + schema: + type: string + - name: provider_id + in: path + description: ID of the provider to unregister. + required: true + schema: + type: string + deprecated: false + /v1alpha/admin/providers/{api}/{provider_id}/health: + get: + responses: + '200': + description: >- + TestProviderConnectionResponse with health status. + content: + application/json: + schema: + $ref: '#/components/schemas/TestProviderConnectionResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Inspect + summary: Check provider health. + description: >- + Check provider health. + + Execute a health check on a provider to verify it is reachable and functioning. + parameters: + - name: api + in: path + description: API namespace the provider implements. + required: true + schema: + type: string + - name: provider_id + in: path + description: ID of the provider to check. + required: true + schema: + type: string + deprecated: false /v1alpha/agents: get: responses: @@ -4426,273 +4397,6 @@ components: title: Error description: >- Error response from the API. Roughly follows RFC 7807. - RegisterProviderRequest: - type: object - properties: - provider_id: - type: string - description: >- - Unique identifier for this provider instance. - provider_type: - type: string - description: Provider type (e.g., 'remote::openai'). - config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Provider configuration (API keys, endpoints, etc.). - attributes: - type: object - additionalProperties: - type: array - items: - type: string - description: >- - Optional attributes for ABAC access control. - additionalProperties: false - required: - - provider_id - - provider_type - - config - title: RegisterProviderRequest - ProviderConnectionInfo: - type: object - properties: - provider_id: - type: string - description: >- - Unique identifier for this provider instance - api: - type: string - description: >- - API namespace (e.g., "inference", "vector_io", "safety") - provider_type: - type: string - description: >- - Provider type identifier (e.g., "remote::openai", "inline::faiss") - config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Provider-specific configuration (API keys, endpoints, etc.) - status: - $ref: '#/components/schemas/ProviderConnectionStatus' - description: Current connection status - health: - $ref: '#/components/schemas/ProviderHealth' - description: Most recent health check result - created_at: - type: string - format: date-time - description: Timestamp when provider was registered - updated_at: - type: string - format: date-time - description: Timestamp of last update - last_health_check: - type: string - format: date-time - description: Timestamp of last health check - error_message: - type: string - description: Error message if status is failed - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - User-defined metadata (deprecated, use attributes) - owner: - type: object - properties: - principal: - type: string - attributes: - type: object - additionalProperties: - type: array - items: - type: string - additionalProperties: false - required: - - principal - description: >- - User who created this provider connection - attributes: - type: object - additionalProperties: - type: array - items: - type: string - description: >- - Key-value attributes for ABAC access control - additionalProperties: false - required: - - provider_id - - api - - provider_type - - config - - status - - created_at - - updated_at - - metadata - title: ProviderConnectionInfo - description: >- - Information about a dynamically managed provider connection. - - This model represents a provider that has been registered at runtime - - via the /providers API, as opposed to static providers configured in run.yaml. - - - Dynamic providers support full lifecycle management including registration, - - configuration updates, health monitoring, and removal. - ProviderConnectionStatus: - type: string - enum: - - pending - - initializing - - connected - - failed - - disconnected - - testing - title: ProviderConnectionStatus - description: Status of a dynamic provider connection. - ProviderHealth: - type: object - properties: - status: - type: string - enum: - - OK - - Error - - Not Implemented - description: >- - Health status (OK, ERROR, NOT_IMPLEMENTED) - message: - type: string - description: Optional error or status message - metrics: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Provider-specific health metrics - last_checked: - type: string - format: date-time - description: Timestamp of last health check - additionalProperties: false - required: - - status - - metrics - - last_checked - title: ProviderHealth - description: >- - Structured wrapper around provider health status. - - This wraps the existing dict-based HealthResponse for API responses - - while maintaining backward compatibility with existing provider implementations. - RegisterProviderResponse: - type: object - properties: - provider: - $ref: '#/components/schemas/ProviderConnectionInfo' - description: >- - Information about the registered provider - additionalProperties: false - required: - - provider - title: RegisterProviderResponse - description: Response after registering a provider. - UpdateProviderRequest: - type: object - properties: - config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - New configuration parameters (merged with existing) - attributes: - type: object - additionalProperties: - type: array - items: - type: string - description: New attributes for access control - additionalProperties: false - title: UpdateProviderRequest - UpdateProviderResponse: - type: object - properties: - provider: - $ref: '#/components/schemas/ProviderConnectionInfo' - description: Updated provider information - additionalProperties: false - required: - - provider - title: UpdateProviderResponse - description: Response after updating a provider. - TestProviderConnectionResponse: - type: object - properties: - success: - type: boolean - description: Whether the connection test succeeded - health: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Health status from the provider - error_message: - type: string - description: Error message if test failed - additionalProperties: false - required: - - success - title: TestProviderConnectionResponse - description: >- - Response from testing a provider connection. Order: type: string enum: @@ -6746,22 +6450,6 @@ components: Response: type: object title: Response - HealthInfo: - type: object - properties: - status: - type: string - enum: - - OK - - Error - - Not Implemented - description: Current health status of the service - additionalProperties: false - required: - - status - title: HealthInfo - description: >- - Health status information for the service. RouteInfo: type: object properties: @@ -11876,6 +11564,273 @@ components: - purpose - source title: RegisterDatasetRequest + RegisterProviderRequest: + type: object + properties: + provider_id: + type: string + description: >- + Unique identifier for this provider instance. + provider_type: + type: string + description: Provider type (e.g., 'remote::openai'). + config: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + Provider configuration (API keys, endpoints, etc.). + attributes: + type: object + additionalProperties: + type: array + items: + type: string + description: >- + Optional attributes for ABAC access control. + additionalProperties: false + required: + - provider_id + - provider_type + - config + title: RegisterProviderRequest + ProviderConnectionInfo: + type: object + properties: + provider_id: + type: string + description: >- + Unique identifier for this provider instance + api: + type: string + description: >- + API namespace (e.g., "inference", "vector_io", "safety") + provider_type: + type: string + description: >- + Provider type identifier (e.g., "remote::openai", "inline::faiss") + config: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + Provider-specific configuration (API keys, endpoints, etc.) + status: + $ref: '#/components/schemas/ProviderConnectionStatus' + description: Current connection status + health: + $ref: '#/components/schemas/ProviderHealth' + description: Most recent health check result + created_at: + type: string + format: date-time + description: Timestamp when provider was registered + updated_at: + type: string + format: date-time + description: Timestamp of last update + last_health_check: + type: string + format: date-time + description: Timestamp of last health check + error_message: + type: string + description: Error message if status is failed + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + User-defined metadata (deprecated, use attributes) + owner: + type: object + properties: + principal: + type: string + attributes: + type: object + additionalProperties: + type: array + items: + type: string + additionalProperties: false + required: + - principal + description: >- + User who created this provider connection + attributes: + type: object + additionalProperties: + type: array + items: + type: string + description: >- + Key-value attributes for ABAC access control + additionalProperties: false + required: + - provider_id + - api + - provider_type + - config + - status + - created_at + - updated_at + - metadata + title: ProviderConnectionInfo + description: >- + Information about a dynamically managed provider connection. + + This model represents a provider that has been registered at runtime + + via the /providers API, as opposed to static providers configured in run.yaml. + + + Dynamic providers support full lifecycle management including registration, + + configuration updates, health monitoring, and removal. + ProviderConnectionStatus: + type: string + enum: + - pending + - initializing + - connected + - failed + - disconnected + - testing + title: ProviderConnectionStatus + description: Status of a dynamic provider connection. + ProviderHealth: + type: object + properties: + status: + type: string + enum: + - OK + - Error + - Not Implemented + description: >- + Health status (OK, ERROR, NOT_IMPLEMENTED) + message: + type: string + description: Optional error or status message + metrics: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Provider-specific health metrics + last_checked: + type: string + format: date-time + description: Timestamp of last health check + additionalProperties: false + required: + - status + - metrics + - last_checked + title: ProviderHealth + description: >- + Structured wrapper around provider health status. + + This wraps the existing dict-based HealthResponse for API responses + + while maintaining backward compatibility with existing provider implementations. + RegisterProviderResponse: + type: object + properties: + provider: + $ref: '#/components/schemas/ProviderConnectionInfo' + description: >- + Information about the registered provider + additionalProperties: false + required: + - provider + title: RegisterProviderResponse + description: Response after registering a provider. + UpdateProviderRequest: + type: object + properties: + config: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + New configuration parameters (merged with existing) + attributes: + type: object + additionalProperties: + type: array + items: + type: string + description: New attributes for access control + additionalProperties: false + title: UpdateProviderRequest + UpdateProviderResponse: + type: object + properties: + provider: + $ref: '#/components/schemas/ProviderConnectionInfo' + description: Updated provider information + additionalProperties: false + required: + - provider + title: UpdateProviderResponse + description: Response after updating a provider. + TestProviderConnectionResponse: + type: object + properties: + success: + type: boolean + description: Whether the connection test succeeded + health: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Health status from the provider + error_message: + type: string + description: Error message if test failed + additionalProperties: false + required: + - success + title: TestProviderConnectionResponse + description: >- + Response from testing a provider connection. AgentConfig: type: object properties: diff --git a/tests/unit/core/test_dynamic_providers.py b/tests/unit/core/test_dynamic_providers.py index f66b7c2f9..e4d72923c 100644 --- a/tests/unit/core/test_dynamic_providers.py +++ b/tests/unit/core/test_dynamic_providers.py @@ -282,9 +282,7 @@ class TestDynamicProviderManagement: ) # Test connection - response = await provider_impl.health( - api=Api.inference.value, provider_id="test-unhealthy" - ) + response = await provider_impl.health(api=Api.inference.value, provider_id="test-unhealthy") # Verify response shows unhealthy status assert response.success is False