mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-20 06:28:43 +00:00
feat: migrate Providers API to FastAPI router pattern (#4405)
# What does this PR do? Convert Providers API from @webmethod decorators to FastAPI router pattern. Fixes: https://github.com/llamastack/llama-stack/issues/4350 <!-- Provide a short summary of what this PR does and why. Link to relevant issues if applicable. --> <!-- If resolving an issue, uncomment and update the line below --> <!-- Closes #[issue-number] --> ## Test Plan CI Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
parent
722d9c53e7
commit
cd5095a247
13 changed files with 287 additions and 121 deletions
17
docs/static/deprecated-llama-stack-spec.yaml
vendored
17
docs/static/deprecated-llama-stack-spec.yaml
vendored
|
|
@ -3494,20 +3494,25 @@ components:
|
|||
api:
|
||||
type: string
|
||||
title: Api
|
||||
description: The API name this provider implements
|
||||
provider_id:
|
||||
type: string
|
||||
title: Provider Id
|
||||
description: Unique identifier for the provider
|
||||
provider_type:
|
||||
type: string
|
||||
title: Provider Type
|
||||
description: The type of provider implementation
|
||||
config:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
title: Config
|
||||
description: Configuration parameters for the provider
|
||||
health:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
title: Health
|
||||
description: Current health status of the provider
|
||||
type: object
|
||||
required:
|
||||
- api
|
||||
|
|
@ -3524,6 +3529,7 @@ components:
|
|||
$ref: '#/components/schemas/ProviderInfo'
|
||||
type: array
|
||||
title: Data
|
||||
description: List of provider information objects
|
||||
type: object
|
||||
required:
|
||||
- data
|
||||
|
|
@ -10703,6 +10709,17 @@ components:
|
|||
- logger_config
|
||||
title: PostTrainingRLHFRequest
|
||||
type: object
|
||||
InspectProviderRequest:
|
||||
description: Request model for inspecting a provider by ID.
|
||||
properties:
|
||||
provider_id:
|
||||
description: The ID of the provider to inspect.
|
||||
title: Provider Id
|
||||
type: string
|
||||
required:
|
||||
- provider_id
|
||||
title: InspectProviderRequest
|
||||
type: object
|
||||
responses:
|
||||
BadRequest400:
|
||||
description: The request was invalid or malformed
|
||||
|
|
|
|||
17
docs/static/experimental-llama-stack-spec.yaml
vendored
17
docs/static/experimental-llama-stack-spec.yaml
vendored
|
|
@ -3213,20 +3213,25 @@ components:
|
|||
api:
|
||||
type: string
|
||||
title: Api
|
||||
description: The API name this provider implements
|
||||
provider_id:
|
||||
type: string
|
||||
title: Provider Id
|
||||
description: Unique identifier for the provider
|
||||
provider_type:
|
||||
type: string
|
||||
title: Provider Type
|
||||
description: The type of provider implementation
|
||||
config:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
title: Config
|
||||
description: Configuration parameters for the provider
|
||||
health:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
title: Health
|
||||
description: Current health status of the provider
|
||||
type: object
|
||||
required:
|
||||
- api
|
||||
|
|
@ -3243,6 +3248,7 @@ components:
|
|||
$ref: '#/components/schemas/ProviderInfo'
|
||||
type: array
|
||||
title: Data
|
||||
description: List of provider information objects
|
||||
type: object
|
||||
required:
|
||||
- data
|
||||
|
|
@ -9620,6 +9626,17 @@ components:
|
|||
- logger_config
|
||||
title: PostTrainingRLHFRequest
|
||||
type: object
|
||||
InspectProviderRequest:
|
||||
description: Request model for inspecting a provider by ID.
|
||||
properties:
|
||||
provider_id:
|
||||
description: The ID of the provider to inspect.
|
||||
title: Provider Id
|
||||
type: string
|
||||
required:
|
||||
- provider_id
|
||||
title: InspectProviderRequest
|
||||
type: object
|
||||
responses:
|
||||
BadRequest400:
|
||||
description: The request was invalid or malformed
|
||||
|
|
|
|||
43
docs/static/llama-stack-spec.yaml
vendored
43
docs/static/llama-stack-spec.yaml
vendored
|
|
@ -1365,11 +1365,8 @@ paths:
|
|||
$ref: '#/components/responses/DefaultError'
|
||||
tags:
|
||||
- Providers
|
||||
summary: List Providers
|
||||
description: |-
|
||||
List providers.
|
||||
|
||||
List all available providers.
|
||||
summary: List providers.
|
||||
description: List all available providers.
|
||||
operationId: list_providers_v1_providers_get
|
||||
/v1/providers/{provider_id}:
|
||||
get:
|
||||
|
|
@ -1381,24 +1378,21 @@ paths:
|
|||
schema:
|
||||
$ref: '#/components/schemas/ProviderInfo'
|
||||
'400':
|
||||
description: Bad Request
|
||||
$ref: '#/components/responses/BadRequest400'
|
||||
description: Bad Request
|
||||
'429':
|
||||
description: Too Many Requests
|
||||
$ref: '#/components/responses/TooManyRequests429'
|
||||
description: Too Many Requests
|
||||
'500':
|
||||
description: Internal Server Error
|
||||
$ref: '#/components/responses/InternalServerError500'
|
||||
description: Internal Server Error
|
||||
default:
|
||||
description: Default Response
|
||||
$ref: '#/components/responses/DefaultError'
|
||||
description: Default Response
|
||||
tags:
|
||||
- Providers
|
||||
summary: Inspect Provider
|
||||
description: |-
|
||||
Get provider.
|
||||
|
||||
Get detailed information about a specific provider.
|
||||
summary: Get provider.
|
||||
description: Get detailed information about a specific provider.
|
||||
operationId: inspect_provider_v1_providers__provider_id__get
|
||||
parameters:
|
||||
- name: provider_id
|
||||
|
|
@ -1406,7 +1400,9 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: 'Path parameter: provider_id'
|
||||
description: The ID of the provider to inspect.
|
||||
title: Provider Id
|
||||
description: The ID of the provider to inspect.
|
||||
/v1/responses:
|
||||
get:
|
||||
responses:
|
||||
|
|
@ -5310,20 +5306,25 @@ components:
|
|||
api:
|
||||
type: string
|
||||
title: Api
|
||||
description: The API name this provider implements
|
||||
provider_id:
|
||||
type: string
|
||||
title: Provider Id
|
||||
description: Unique identifier for the provider
|
||||
provider_type:
|
||||
type: string
|
||||
title: Provider Type
|
||||
description: The type of provider implementation
|
||||
config:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
title: Config
|
||||
description: Configuration parameters for the provider
|
||||
health:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
title: Health
|
||||
description: Current health status of the provider
|
||||
type: object
|
||||
required:
|
||||
- api
|
||||
|
|
@ -5340,6 +5341,7 @@ components:
|
|||
$ref: '#/components/schemas/ProviderInfo'
|
||||
type: array
|
||||
title: Data
|
||||
description: List of provider information objects
|
||||
type: object
|
||||
required:
|
||||
- data
|
||||
|
|
@ -12204,6 +12206,17 @@ components:
|
|||
- logger_config
|
||||
title: PostTrainingRLHFRequest
|
||||
type: object
|
||||
InspectProviderRequest:
|
||||
description: Request model for inspecting a provider by ID.
|
||||
properties:
|
||||
provider_id:
|
||||
description: The ID of the provider to inspect.
|
||||
title: Provider Id
|
||||
type: string
|
||||
required:
|
||||
- provider_id
|
||||
title: InspectProviderRequest
|
||||
type: object
|
||||
responses:
|
||||
BadRequest400:
|
||||
description: The request was invalid or malformed
|
||||
|
|
|
|||
43
docs/static/stainless-llama-stack-spec.yaml
vendored
43
docs/static/stainless-llama-stack-spec.yaml
vendored
|
|
@ -1434,11 +1434,8 @@ paths:
|
|||
$ref: '#/components/responses/DefaultError'
|
||||
tags:
|
||||
- Providers
|
||||
summary: List Providers
|
||||
description: |-
|
||||
List providers.
|
||||
|
||||
List all available providers.
|
||||
summary: List providers.
|
||||
description: List all available providers.
|
||||
operationId: list_providers_v1_providers_get
|
||||
/v1/providers/{provider_id}:
|
||||
get:
|
||||
|
|
@ -1450,24 +1447,21 @@ paths:
|
|||
schema:
|
||||
$ref: '#/components/schemas/ProviderInfo'
|
||||
'400':
|
||||
description: Bad Request
|
||||
$ref: '#/components/responses/BadRequest400'
|
||||
description: Bad Request
|
||||
'429':
|
||||
description: Too Many Requests
|
||||
$ref: '#/components/responses/TooManyRequests429'
|
||||
description: Too Many Requests
|
||||
'500':
|
||||
description: Internal Server Error
|
||||
$ref: '#/components/responses/InternalServerError500'
|
||||
description: Internal Server Error
|
||||
default:
|
||||
description: Default Response
|
||||
$ref: '#/components/responses/DefaultError'
|
||||
description: Default Response
|
||||
tags:
|
||||
- Providers
|
||||
summary: Inspect Provider
|
||||
description: |-
|
||||
Get provider.
|
||||
|
||||
Get detailed information about a specific provider.
|
||||
summary: Get provider.
|
||||
description: Get detailed information about a specific provider.
|
||||
operationId: inspect_provider_v1_providers__provider_id__get
|
||||
parameters:
|
||||
- name: provider_id
|
||||
|
|
@ -1475,7 +1469,9 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: 'Path parameter: provider_id'
|
||||
description: The ID of the provider to inspect.
|
||||
title: Provider Id
|
||||
description: The ID of the provider to inspect.
|
||||
/v1/responses:
|
||||
get:
|
||||
responses:
|
||||
|
|
@ -6668,20 +6664,25 @@ components:
|
|||
api:
|
||||
type: string
|
||||
title: Api
|
||||
description: The API name this provider implements
|
||||
provider_id:
|
||||
type: string
|
||||
title: Provider Id
|
||||
description: Unique identifier for the provider
|
||||
provider_type:
|
||||
type: string
|
||||
title: Provider Type
|
||||
description: The type of provider implementation
|
||||
config:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
title: Config
|
||||
description: Configuration parameters for the provider
|
||||
health:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
title: Health
|
||||
description: Current health status of the provider
|
||||
type: object
|
||||
required:
|
||||
- api
|
||||
|
|
@ -6698,6 +6699,7 @@ components:
|
|||
$ref: '#/components/schemas/ProviderInfo'
|
||||
type: array
|
||||
title: Data
|
||||
description: List of provider information objects
|
||||
type: object
|
||||
required:
|
||||
- data
|
||||
|
|
@ -13877,6 +13879,17 @@ components:
|
|||
- logger_config
|
||||
title: PostTrainingRLHFRequest
|
||||
type: object
|
||||
InspectProviderRequest:
|
||||
description: Request model for inspecting a provider by ID.
|
||||
properties:
|
||||
provider_id:
|
||||
description: The ID of the provider to inspect.
|
||||
title: Provider Id
|
||||
type: string
|
||||
required:
|
||||
- provider_id
|
||||
title: InspectProviderRequest
|
||||
type: object
|
||||
responses:
|
||||
BadRequest400:
|
||||
description: The request was invalid or malformed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue