Skip to content

Commit 7199a1e

Browse files
author
Andrej Simurka
committed
Added e2e tests for feedback endpoint
1 parent 44435d2 commit 7199a1e

File tree

8 files changed

+678
-1
lines changed

8 files changed

+678
-1
lines changed

docs/auth.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ authorization:
249249
- `info` - Access the `/` endpoint, `/info` endpoint, `/readiness` endpoint, and `/liveness` endpoint
250250
- `get_config` - Access the `/config` endpoint
251251
- `get_models` - Access the `/models` endpoint
252+
- `list_providers` - Access the `/providers` endpoint
253+
- `get_provider` - Access the `/providers/{provider_id}` endpoint
252254
- `get_metrics` - Access the `/metrics` endpoint
253255
- `list_conversations` - Access the `/conversations` endpoint
254256
- `list_other_conversations` - Access conversations not owned by the user

docs/openapi.json

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,119 @@
157157
}
158158
}
159159
},
160+
"/v1/providers": {
161+
"get": {
162+
"tags": [
163+
"providers"
164+
],
165+
"summary": "Providers Endpoint Handler",
166+
"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.",
167+
"operationId": "providers_endpoint_handler_v1_providers_get",
168+
"responses": {
169+
"200": {
170+
"description": "Successful Response",
171+
"content": {
172+
"application/json": {
173+
"schema": {
174+
"$ref": "#/components/schemas/ShieldsResponse"
175+
}
176+
}
177+
},
178+
179+
"providers": {
180+
"agents": [
181+
{
182+
"provider_id": "meta-reference",
183+
"provider_type": "inline::meta-reference"
184+
}
185+
],
186+
"datasetio": [
187+
{
188+
"provider_id": "huggingface",
189+
"provider_type": "remote::huggingface"
190+
},
191+
{
192+
"provider_id": "localfs",
193+
"provider_type": "inline::localfs"
194+
}
195+
],
196+
"inference": [
197+
{
198+
"provider_id": "sentence-transformers",
199+
"provider_type": "inline::sentence-transformers"
200+
},
201+
{
202+
"provider_id": "openai",
203+
"provider_type": "remote::openai"
204+
}
205+
]
206+
}
207+
},
208+
"500": {
209+
"description": "Connection to Llama Stack is broken"
210+
}
211+
}
212+
}
213+
},
214+
"/v1/providers/{provider_id}": {
215+
"get": {
216+
"summary": "Retrieve a single provider by ID",
217+
"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.",
218+
"parameters": [
219+
{
220+
"name": "provider_id",
221+
"in": "path",
222+
"required": true,
223+
"description": "Unique identifier of the provider to retrieve",
224+
"schema": {
225+
"type": "string"
226+
}
227+
}
228+
],
229+
"responses": {
230+
"200": {
231+
"description": "Provider found successfully",
232+
"content": {
233+
"application/json": {
234+
"schema": { "$ref": "#/components/schemas/ProviderResponse" },
235+
"example": {
236+
"api": "inference",
237+
"config": {"api_key": "********"},
238+
"health": {
239+
"status": "Not Implemented",
240+
"message": "Provider does not implement health check"
241+
},
242+
"provider_id": "openai",
243+
"provider_type": "remote::openai"
244+
}
245+
}
246+
}
247+
},
248+
"404": {
249+
"description": "Provider with the specified ID was not found",
250+
"content": {
251+
"application/json": {
252+
"example": {
253+
"response": "Provider with given id not found"
254+
}
255+
}
256+
}
257+
},
258+
"500": {
259+
"description": "Unable to retrieve provider due to server error or connection issues",
260+
"content": {
261+
"application/json": {
262+
"example": {
263+
"response": "Unable to retrieve list of providers",
264+
"cause": "Connection to Llama Stack is broken"
265+
}
266+
}
267+
}
268+
}
269+
},
270+
"tags": ["providers"]
271+
}
272+
},
160273
"/v1/query": {
161274
"post": {
162275
"tags": [
@@ -1117,6 +1230,8 @@
11171230
"feedback",
11181231
"get_models",
11191232
"get_shields",
1233+
"list_providers",
1234+
"get_provider",
11201235
"get_metrics",
11211236
"get_config",
11221237
"info",
@@ -2576,6 +2691,105 @@
25762691
"title": "ProviderHealthStatus",
25772692
"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."
25782693
},
2694+
"ProviderResponse": {
2695+
"type": "object",
2696+
"title": "ProviderInfo",
2697+
"description": "Model representing a provider and its configuration, health, and identification details.",
2698+
"properties": {
2699+
"api": {
2700+
"type": "string",
2701+
"description": "The API name this provider implements"
2702+
},
2703+
"config": {
2704+
"type": "object",
2705+
"description": "Configuration parameters for the provider",
2706+
"additionalProperties": true
2707+
},
2708+
"health": {
2709+
"type": "object",
2710+
"description": "Current health status of the provider",
2711+
"additionalProperties": true
2712+
},
2713+
"provider_id": {
2714+
"type": "string",
2715+
"description": "Unique identifier for the provider"
2716+
},
2717+
"provider_type": {
2718+
"type": "string",
2719+
"description": "The type of provider implementation"
2720+
}
2721+
},
2722+
"required": [
2723+
"api",
2724+
"config",
2725+
"health",
2726+
"provider_id",
2727+
"provider_type"
2728+
],
2729+
"example": {
2730+
"api": "inference",
2731+
"config": {"api_key": "********"},
2732+
"health": {
2733+
"status": "Not Implemented",
2734+
"message": "Provider does not implement health check"
2735+
},
2736+
"provider_id": "openai",
2737+
"provider_type": "remote::openai"
2738+
}
2739+
},
2740+
"ProvidersListResponse": {
2741+
"type": "object",
2742+
"properties": {
2743+
"providers": {
2744+
"type": "object",
2745+
"description": "Mapping of API type to list of its available providers",
2746+
"additionalProperties": {
2747+
"type": "array",
2748+
"items": {
2749+
"type": "object",
2750+
"properties": {
2751+
"provider_id": {
2752+
"type": "string",
2753+
"description": "Unique local identifier of provider"
2754+
},
2755+
"provider_type": {
2756+
"type": "string",
2757+
"description": "Llama stack identifier of provider (following schema <type>::<name>)"
2758+
}
2759+
},
2760+
"required": ["provider_id", "provider_type"]
2761+
}
2762+
},
2763+
"examples": [
2764+
{
2765+
"inference": [
2766+
{
2767+
"provider_id": "sentence-transformers",
2768+
"provider_type": "inline::sentence-transformers"
2769+
},
2770+
{
2771+
"provider_id": "openai",
2772+
"provider_type": "remote::openai"
2773+
}
2774+
],
2775+
"datasetio": [
2776+
{
2777+
"provider_id": "huggingface",
2778+
"provider_type": "remote::huggingface"
2779+
},
2780+
{
2781+
"provider_id": "localfs",
2782+
"provider_type": "inline::localfs"
2783+
}
2784+
]
2785+
}
2786+
]
2787+
}
2788+
},
2789+
"required": ["providers"],
2790+
"title": "ProvidersListResponse",
2791+
"description": "Model representing a response to providers request."
2792+
},
25792793
"QueryRequest": {
25802794
"properties": {
25812795
"query": {

0 commit comments

Comments
 (0)