|
203 | 203 | } |
204 | 204 | } |
205 | 205 | }, |
| 206 | + "/v1/providers": { |
| 207 | + "get": { |
| 208 | + "tags": [ |
| 209 | + "providers" |
| 210 | + ], |
| 211 | + "summary": "Providers Endpoint Handler", |
| 212 | + "description": "Handle requests to the /providers endpoint.\n\nProcess GET requests to the /providers endpoint, returning a list of available\nproviders from the Llama Stack service.\n\nRaises:\n HTTPException: If unable to connect to the Llama Stack server or if\n providers retrieval fails for any reason.\n\nReturns:\n ProvidersListResponse: An object containing the list of available providers.", |
| 213 | + "operationId": "providers_endpoint_handler_v1_providers_get", |
| 214 | + "responses": { |
| 215 | + "200": { |
| 216 | + "description": "Successful Response", |
| 217 | + "content": { |
| 218 | + "application/json": { |
| 219 | + "schema": { |
| 220 | + "$ref": "#/components/schemas/ProvidersListResponse" |
| 221 | + } |
| 222 | + } |
| 223 | + }, |
| 224 | + |
| 225 | + "providers": { |
| 226 | + "agents": [ |
| 227 | + { |
| 228 | + "provider_id": "meta-reference", |
| 229 | + "provider_type": "inline::meta-reference" |
| 230 | + } |
| 231 | + ], |
| 232 | + "datasetio": [ |
| 233 | + { |
| 234 | + "provider_id": "huggingface", |
| 235 | + "provider_type": "remote::huggingface" |
| 236 | + }, |
| 237 | + { |
| 238 | + "provider_id": "localfs", |
| 239 | + "provider_type": "inline::localfs" |
| 240 | + } |
| 241 | + ], |
| 242 | + "inference": [ |
| 243 | + { |
| 244 | + "provider_id": "sentence-transformers", |
| 245 | + "provider_type": "inline::sentence-transformers" |
| 246 | + }, |
| 247 | + { |
| 248 | + "provider_id": "openai", |
| 249 | + "provider_type": "remote::openai" |
| 250 | + } |
| 251 | + ] |
| 252 | + } |
| 253 | + }, |
| 254 | + "500": { |
| 255 | + "description": "Connection to Llama Stack is broken" |
| 256 | + } |
| 257 | + } |
| 258 | + } |
| 259 | + }, |
| 260 | + "/v1/providers/{provider_id}": { |
| 261 | + "get": { |
| 262 | + "summary": "Retrieve a single provider by ID", |
| 263 | + "description": "Fetches detailed information about a specific provider, including its API, configuration, health status, provider ID, and type. Returns a 404 error if the provider with the specified ID does not exist, or a 500 error if there is a problem connecting to the Llama Stack service.", |
| 264 | + "parameters": [ |
| 265 | + { |
| 266 | + "name": "provider_id", |
| 267 | + "in": "path", |
| 268 | + "required": true, |
| 269 | + "description": "Unique identifier of the provider to retrieve", |
| 270 | + "schema": { |
| 271 | + "type": "string" |
| 272 | + } |
| 273 | + } |
| 274 | + ], |
| 275 | + "responses": { |
| 276 | + "200": { |
| 277 | + "description": "Provider found successfully", |
| 278 | + "content": { |
| 279 | + "application/json": { |
| 280 | + "schema": { "$ref": "#/components/schemas/ProviderResponse" }, |
| 281 | + "example": { |
| 282 | + "api": "inference", |
| 283 | + "config": {"api_key": "********"}, |
| 284 | + "health": { |
| 285 | + "status": "Not Implemented", |
| 286 | + "message": "Provider does not implement health check" |
| 287 | + }, |
| 288 | + "provider_id": "openai", |
| 289 | + "provider_type": "remote::openai" |
| 290 | + } |
| 291 | + } |
| 292 | + } |
| 293 | + }, |
| 294 | + "404": { |
| 295 | + "description": "Provider with the specified ID was not found", |
| 296 | + "content": { |
| 297 | + "application/json": { |
| 298 | + "example": { |
| 299 | + "response": "Provider with given id not found" |
| 300 | + } |
| 301 | + } |
| 302 | + } |
| 303 | + }, |
| 304 | + "500": { |
| 305 | + "description": "Unable to retrieve provider due to server error or connection issues", |
| 306 | + "content": { |
| 307 | + "application/json": { |
| 308 | + "example": { |
| 309 | + "response": "Unable to retrieve list of providers", |
| 310 | + "cause": "Connection to Llama Stack is broken" |
| 311 | + } |
| 312 | + } |
| 313 | + } |
| 314 | + } |
| 315 | + }, |
| 316 | + "tags": ["providers"] |
| 317 | + } |
| 318 | + }, |
206 | 319 | "/v1/query": { |
207 | 320 | "post": { |
208 | 321 | "tags": [ |
|
1246 | 1359 | "get_models", |
1247 | 1360 | "get_tools", |
1248 | 1361 | "get_shields", |
| 1362 | + "list_providers", |
| 1363 | + "get_provider", |
1249 | 1364 | "get_metrics", |
1250 | 1365 | "get_config", |
1251 | 1366 | "info", |
|
2762 | 2877 | "title": "ProviderHealthStatus", |
2763 | 2878 | "description": "Model representing the health status of a provider.\n\nAttributes:\n provider_id: The ID of the provider.\n status: The health status ('ok', 'unhealthy', 'not_implemented').\n message: Optional message about the health status." |
2764 | 2879 | }, |
| 2880 | + "ProviderResponse": { |
| 2881 | + "type": "object", |
| 2882 | + "title": "ProviderInfo", |
| 2883 | + "description": "Model representing a provider and its configuration, health, and identification details.", |
| 2884 | + "properties": { |
| 2885 | + "api": { |
| 2886 | + "type": "string", |
| 2887 | + "description": "The API name this provider implements" |
| 2888 | + }, |
| 2889 | + "config": { |
| 2890 | + "type": "object", |
| 2891 | + "description": "Configuration parameters for the provider", |
| 2892 | + "additionalProperties": true |
| 2893 | + }, |
| 2894 | + "health": { |
| 2895 | + "type": "object", |
| 2896 | + "description": "Current health status of the provider", |
| 2897 | + "additionalProperties": true |
| 2898 | + }, |
| 2899 | + "provider_id": { |
| 2900 | + "type": "string", |
| 2901 | + "description": "Unique identifier for the provider" |
| 2902 | + }, |
| 2903 | + "provider_type": { |
| 2904 | + "type": "string", |
| 2905 | + "description": "The type of provider implementation" |
| 2906 | + } |
| 2907 | + }, |
| 2908 | + "required": [ |
| 2909 | + "api", |
| 2910 | + "config", |
| 2911 | + "health", |
| 2912 | + "provider_id", |
| 2913 | + "provider_type" |
| 2914 | + ], |
| 2915 | + "example": { |
| 2916 | + "api": "inference", |
| 2917 | + "config": {"api_key": "********"}, |
| 2918 | + "health": { |
| 2919 | + "status": "Not Implemented", |
| 2920 | + "message": "Provider does not implement health check" |
| 2921 | + }, |
| 2922 | + "provider_id": "openai", |
| 2923 | + "provider_type": "remote::openai" |
| 2924 | + } |
| 2925 | + }, |
| 2926 | + "ProvidersListResponse": { |
| 2927 | + "type": "object", |
| 2928 | + "properties": { |
| 2929 | + "providers": { |
| 2930 | + "type": "object", |
| 2931 | + "description": "Mapping of API type to list of its available providers", |
| 2932 | + "additionalProperties": { |
| 2933 | + "type": "array", |
| 2934 | + "items": { |
| 2935 | + "type": "object", |
| 2936 | + "properties": { |
| 2937 | + "provider_id": { |
| 2938 | + "type": "string", |
| 2939 | + "description": "Unique local identifier of provider" |
| 2940 | + }, |
| 2941 | + "provider_type": { |
| 2942 | + "type": "string", |
| 2943 | + "description": "Llama stack identifier of provider (following schema <type>::<name>)" |
| 2944 | + } |
| 2945 | + }, |
| 2946 | + "required": ["provider_id", "provider_type"] |
| 2947 | + } |
| 2948 | + }, |
| 2949 | + "examples": [ |
| 2950 | + { |
| 2951 | + "inference": [ |
| 2952 | + { |
| 2953 | + "provider_id": "sentence-transformers", |
| 2954 | + "provider_type": "inline::sentence-transformers" |
| 2955 | + }, |
| 2956 | + { |
| 2957 | + "provider_id": "openai", |
| 2958 | + "provider_type": "remote::openai" |
| 2959 | + } |
| 2960 | + ], |
| 2961 | + "datasetio": [ |
| 2962 | + { |
| 2963 | + "provider_id": "huggingface", |
| 2964 | + "provider_type": "remote::huggingface" |
| 2965 | + }, |
| 2966 | + { |
| 2967 | + "provider_id": "localfs", |
| 2968 | + "provider_type": "inline::localfs" |
| 2969 | + } |
| 2970 | + ] |
| 2971 | + } |
| 2972 | + ] |
| 2973 | + } |
| 2974 | + }, |
| 2975 | + "required": ["providers"], |
| 2976 | + "title": "ProvidersListResponse", |
| 2977 | + "description": "Model representing a response to providers request." |
| 2978 | + }, |
2765 | 2979 | "QueryRequest": { |
2766 | 2980 | "properties": { |
2767 | 2981 | "query": { |
|
0 commit comments