Skip to content

Commit 9c50c4c

Browse files
author
Matias Schimuneck
committed
feat: Add OpenAPI documentation for Llama Stack Modular UI BFF
- Add comprehensive OpenAPI 3.0 specification for BFF endpoints - Include /api/v1/query endpoint for RAG and chat completion - Add vector database management endpoints - Include model management endpoints - Fix CORS configuration for healthcheck endpoint to enable Swagger UI - Document only public-facing models and remove authentication requirements - Add common schemas and responses in separate lib/common.yaml file The OpenAPI documentation can be visualized using Swagger UI or any OpenAPI viewer. Run the BFF with: make run STATIC_ASSETS_DIR=../frontend/dist MOCK_LS_CLIENT=true ALLOWED_ORIGINS="*"
1 parent 0e7bbb4 commit 9c50c4c

File tree

3 files changed

+821
-1
lines changed

3 files changed

+821
-1
lines changed

frontend/packages/llama-stack-modular-ui/bff/internal/api/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (app *App) Routes() http.Handler {
154154
healthcheckMux := http.NewServeMux()
155155
healthcheckRouter := httprouter.New()
156156
healthcheckRouter.GET(HealthCheckPath, app.HealthcheckHandler)
157-
healthcheckMux.Handle(HealthCheckPath, app.RecoverPanic(app.EnableTelemetry(healthcheckRouter)))
157+
healthcheckMux.Handle(HealthCheckPath, app.RecoverPanic(app.EnableTelemetry(app.EnableCORS(healthcheckRouter))))
158158

159159
// Combines the healthcheck endpoint with the rest of the routes
160160
combinedMux := http.NewServeMux()
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
components:
2+
schemas:
3+
Error:
4+
type: object
5+
required:
6+
- code
7+
- message
8+
properties:
9+
code:
10+
type: string
11+
example: "400"
12+
message:
13+
type: string
14+
example: "Bad request"
15+
16+
ErrorEnvelope:
17+
type: object
18+
required:
19+
- error
20+
properties:
21+
error:
22+
$ref: "#/components/schemas/Error"
23+
24+
Envelope:
25+
type: object
26+
required:
27+
- data
28+
properties:
29+
data:
30+
type: object
31+
description: The main response data
32+
metadata:
33+
type: object
34+
description: Optional metadata about the response
35+
36+
responses:
37+
BadRequest:
38+
description: Bad Request
39+
content:
40+
application/json:
41+
schema:
42+
$ref: "#/components/schemas/ErrorEnvelope"
43+
44+
Unauthorized:
45+
description: Unauthorized
46+
content:
47+
application/json:
48+
schema:
49+
$ref: "#/components/schemas/ErrorEnvelope"
50+
51+
NotFound:
52+
description: Not Found
53+
content:
54+
application/json:
55+
schema:
56+
$ref: "#/components/schemas/ErrorEnvelope"
57+
58+
InternalServerError:
59+
description: Internal Server Error
60+
content:
61+
application/json:
62+
schema:
63+
$ref: "#/components/schemas/ErrorEnvelope"
64+
65+
securitySchemes:
66+
Bearer:
67+
type: http
68+
scheme: bearer
69+
bearerFormat: JWT
70+
description: Bearer token authentication using OAuth2 JWT tokens
71+
72+
security:
73+
- Bearer: []

0 commit comments

Comments
 (0)