Skip to content

Commit 69c53b9

Browse files
committed
Updated examples and openapi schema
1 parent 5e39461 commit 69c53b9

2 files changed

Lines changed: 74 additions & 67 deletions

File tree

docs/openapi.json

Lines changed: 52 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,35 +1211,34 @@
12111211
},
12121212
"example": {
12131213
"available_quotas": {
1214-
"daily": 1000,
1215-
"monthly": 50000
1214+
"ClusterQuotaLimiter": 998911,
1215+
"UserQuotaLimiter": 998911
12161216
},
12171217
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
1218-
"input_tokens": 150,
1219-
"output_tokens": 75,
1220-
"rag_chunks": [
1221-
{
1222-
"content": "OLM is a component of the Operator Framework toolkit...",
1223-
"score": 0.95,
1224-
"source": "kubernetes-docs/operators.md"
1225-
}
1226-
],
1218+
"input_tokens": 123,
1219+
"output_tokens": 456,
12271220
"referenced_documents": [
12281221
{
1229-
"doc_title": "Operator Lifecycle Manager (OLM)",
1230-
"doc_url": "https://docs.openshift.com/container-platform/4.15/operators/olm/index.html"
1222+
"doc_title": "Operator Lifecycle Manager concepts and resources",
1223+
"doc_url": "https://docs.openshift.com/container-platform/4.15/operators/understanding/olm/olm-understanding-olm.html"
12311224
}
12321225
],
12331226
"response": "Operator Lifecycle Manager (OLM) helps users install...",
12341227
"tool_calls": [
12351228
{
1236-
"arguments": {
1237-
"query": "operator lifecycle manager"
1238-
},
1239-
"result": {
1240-
"chunks_found": 5
1241-
},
1242-
"tool_name": "knowledge_search"
1229+
"args": {},
1230+
"id": "1",
1231+
"name": "tool1",
1232+
"type": "tool_call"
1233+
}
1234+
],
1235+
"tool_results": [
1236+
{
1237+
"content": "bla",
1238+
"id": "1",
1239+
"round": 1,
1240+
"status": "success",
1241+
"type": "tool_result"
12431242
}
12441243
],
12451244
"truncated": false
@@ -1521,7 +1520,7 @@
15211520
"type": "string",
15221521
"format": "text/event-stream"
15231522
},
1524-
"example": "data: {\"event\": \"start\", \"data\": {\"conversation_id\": \"123e4567-e89b-12d3-a456-426614174000\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 0, \"token\": \"No Violation\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 1, \"token\": \"\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 2, \"token\": \"Hello\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 3, \"token\": \"!\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 4, \"token\": \" How\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 5, \"token\": \" can\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 6, \"token\": \" I\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 7, \"token\": \" assist\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 8, \"token\": \" you\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 9, \"token\": \" today\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 10, \"token\": \"?\"}}\n\ndata: {\"event\": \"turn_complete\", \"data\": {\"token\": \"Hello! How can I assist you today?\"}}\n\ndata: {\"event\": \"end\", \"data\": {\"rag_chunks\": [], \"referenced_documents\": [], \"truncated\": null, \"input_tokens\": 11, \"output_tokens\": 19, \"available_quotas\": {}}}\n\n"
1523+
"example": "data: {\"event\": \"start\", \"data\": {\"conversation_id\": \"123e4567-e89b-12d3-a456-426614174000\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 0, \"token\": \"No Violation\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 1, \"token\": \"\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 2, \"token\": \"Hello\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 3, \"token\": \"!\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 4, \"token\": \" How\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 5, \"token\": \" can\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 6, \"token\": \" I\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 7, \"token\": \" assist\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 8, \"token\": \" you\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 9, \"token\": \" today\"}}\n\ndata: {\"event\": \"token\", \"data\": {\"id\": 10, \"token\": \"?\"}}\n\ndata: {\"event\": \"turn_complete\", \"data\": {\"token\": \"Hello! How can I assist you today?\"}}\n\ndata: {\"event\": \"end\", \"data\": {\"referenced_documents\": [], \"truncated\": null, \"input_tokens\": 11, \"output_tokens\": 19}, \"available_quotas\": {}}\n\n"
15251524
}
15261525
}
15271526
},
@@ -3920,12 +3919,20 @@
39203919
"properties": {
39213920
"api_key": {
39223921
"type": "string",
3923-
"title": "Api Key",
3924-
"default": "some-api-key"
3922+
"minLength": 1,
3923+
"format": "password",
3924+
"title": "API key",
3925+
"writeOnly": true,
3926+
"examples": [
3927+
"some-api-key"
3928+
]
39253929
}
39263930
},
39273931
"additionalProperties": false,
39283932
"type": "object",
3933+
"required": [
3934+
"api_key"
3935+
],
39293936
"title": "APIKeyTokenConfiguration",
39303937
"description": "API Key Token configuration."
39313938
},
@@ -5699,7 +5706,7 @@
56995706
"url"
57005707
],
57015708
"title": "ModelContextProtocolServer",
5702-
"description": "Model context protocol server configuration.\n\nMCP (Model Context Protocol) servers provide tools and\ncapabilities to the AI agents. These are configured by this structure.\nOnly MCP servers defined in the lightspeed-stack.yaml configuration are\navailable to the agents. Tools configured in the llama-stack run.yaml\nare not accessible to lightspeed-core agents.\n\nUseful resources:\n\n- [Model Context Protocol](https://modelcontextprotocol.io/docs/getting-started/intro)\n- [MCP FAQs](https://modelcontextprotocol.io/faqs)\n- [Wikipedia article](https://en.wikipedia.org/wiki/Model_Context_Protocol)"
5709+
"description": "Model context protocol server configuration.\n\nMCP (Model Context Protocol) servers provide tools and capabilities to the\nAI agents. These are configured by this structure. Only MCP servers\ndefined in the lightspeed-stack.yaml configuration are available to the\nagents. Tools configured in the llama-stack run.yaml are not accessible to\nlightspeed-core agents.\n\nUseful resources:\n\n- [Model Context Protocol](https://modelcontextprotocol.io/docs/getting-started/intro)\n- [MCP FAQs](https://modelcontextprotocol.io/faqs)\n- [Wikipedia article](https://en.wikipedia.org/wiki/Model_Context_Protocol)"
57035710
},
57045711
"ModelsResponse": {
57055712
"properties": {
@@ -5862,7 +5869,7 @@
58625869
"password"
58635870
],
58645871
"title": "PostgreSQLDatabaseConfiguration",
5865-
"description": "PostgreSQL database configuration.\n\nPostgreSQL database is used by Lightspeed Core Stack service for storing information about\nconversation IDs. It can also be leveraged to store conversation history and information\nabout quota usage.\n\nUseful resources:\n\n- [Psycopg: connection classes](https://www.psycopg.org/psycopg3/docs/api/connections.html)\n- [PostgreSQL connection strings](https://www.connectionstrings.com/postgresql/)\n- [How to Use PostgreSQL in Python](https://www.freecodecamp.org/news/postgresql-in-python/)"
5872+
"description": "PostgreSQL database configuration.\n\nPostgreSQL database is used by Lightspeed Core Stack service for storing\ninformation about conversation IDs. It can also be leveraged to store\nconversation history and information about quota usage.\n\nUseful resources:\n\n- [Psycopg: connection classes](https://www.psycopg.org/psycopg3/docs/api/connections.html)\n- [PostgreSQL connection strings](https://www.connectionstrings.com/postgresql/)\n- [How to Use PostgreSQL in Python](https://www.freecodecamp.org/news/postgresql-in-python/)"
58665873
},
58675874
"ProviderHealthStatus": {
58685875
"properties": {
@@ -6363,35 +6370,34 @@
63636370
"examples": [
63646371
{
63656372
"available_quotas": {
6366-
"daily": 1000,
6367-
"monthly": 50000
6373+
"ClusterQuotaLimiter": 998911,
6374+
"UserQuotaLimiter": 998911
63686375
},
63696376
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
6370-
"input_tokens": 150,
6371-
"output_tokens": 75,
6372-
"rag_chunks": [
6373-
{
6374-
"content": "OLM is a component of the Operator Framework toolkit...",
6375-
"score": 0.95,
6376-
"source": "kubernetes-docs/operators.md"
6377-
}
6378-
],
6377+
"input_tokens": 123,
6378+
"output_tokens": 456,
63796379
"referenced_documents": [
63806380
{
6381-
"doc_title": "Operator Lifecycle Manager (OLM)",
6382-
"doc_url": "https://docs.openshift.com/container-platform/4.15/operators/olm/index.html"
6381+
"doc_title": "Operator Lifecycle Manager concepts and resources",
6382+
"doc_url": "https://docs.openshift.com/container-platform/4.15/operators/understanding/olm/olm-understanding-olm.html"
63836383
}
63846384
],
63856385
"response": "Operator Lifecycle Manager (OLM) helps users install...",
63866386
"tool_calls": [
63876387
{
6388-
"arguments": {
6389-
"query": "operator lifecycle manager"
6390-
},
6391-
"result": {
6392-
"chunks_found": 5
6393-
},
6394-
"tool_name": "knowledge_search"
6388+
"args": {},
6389+
"id": "1",
6390+
"name": "tool1",
6391+
"type": "tool_call"
6392+
}
6393+
],
6394+
"tool_results": [
6395+
{
6396+
"content": "bla",
6397+
"id": "1",
6398+
"round": 1,
6399+
"status": "success",
6400+
"type": "tool_result"
63956401
}
63966402
],
63976403
"truncated": false
@@ -6891,7 +6897,7 @@
68916897
"additionalProperties": false,
68926898
"type": "object",
68936899
"title": "ServiceConfiguration",
6894-
"description": "Service configuration.\n\nLightspeed Core Stack is a REST API service that accepts requests\non a specified hostname and port. It is also possible to enable\nauthentication and specify the number of Uvicorn workers. When more\nworkers are specified, the service can handle requests concurrently."
6900+
"description": "Service configuration.\n\nLightspeed Core Stack is a REST API service that accepts requests on a\nspecified hostname and port. It is also possible to enable authentication\nand specify the number of Uvicorn workers. When more workers are specified,\nthe service can handle requests concurrently."
68956901
},
68966902
"ServiceUnavailableResponse": {
68976903
"properties": {

src/models/responses.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -420,31 +420,32 @@ class QueryResponse(AbstractSuccessfulResponse):
420420
{
421421
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
422422
"response": "Operator Lifecycle Manager (OLM) helps users install...",
423-
"rag_chunks": [
423+
"referenced_documents": [
424424
{
425-
"content": "OLM is a component of the Operator Framework toolkit...",
426-
"source": "kubernetes-docs/operators.md",
427-
"score": 0.95,
428-
}
425+
"doc_url": "https://docs.openshift.com/container-platform/4.15/operators/"
426+
"understanding/olm/olm-understanding-olm.html",
427+
"doc_title": "Operator Lifecycle Manager concepts and resources",
428+
},
429429
],
430+
"truncated": False,
431+
"input_tokens": 123,
432+
"output_tokens": 456,
433+
"available_quotas": {
434+
"UserQuotaLimiter": 998911,
435+
"ClusterQuotaLimiter": 998911,
436+
},
430437
"tool_calls": [
431-
{
432-
"tool_name": "knowledge_search",
433-
"arguments": {"query": "operator lifecycle manager"},
434-
"result": {"chunks_found": 5},
435-
}
438+
{"name": "tool1", "args": {}, "id": "1", "type": "tool_call"}
436439
],
437-
"referenced_documents": [
440+
"tool_results": [
438441
{
439-
"doc_url": "https://docs.openshift.com/"
440-
"container-platform/4.15/operators/olm/index.html",
441-
"doc_title": "Operator Lifecycle Manager (OLM)",
442+
"id": "1",
443+
"status": "success",
444+
"content": "bla",
445+
"type": "tool_result",
446+
"round": 1,
442447
}
443448
],
444-
"truncated": False,
445-
"input_tokens": 150,
446-
"output_tokens": 75,
447-
"available_quotas": {"daily": 1000, "monthly": 50000},
448449
}
449450
]
450451
}
@@ -510,9 +511,9 @@ def openapi_response(cls) -> dict[str, Any]:
510511
'data: {"event": "turn_complete", "data": {'
511512
'"token": "Hello! How can I assist you today?"}}\n\n'
512513
'data: {"event": "end", "data": {'
513-
'"rag_chunks": [], "referenced_documents": [], '
514-
'"truncated": null, "input_tokens": 11, "output_tokens": 19, '
515-
'"available_quotas": {}}}\n\n'
514+
'"referenced_documents": [], '
515+
'"truncated": null, "input_tokens": 11, "output_tokens": 19}, '
516+
'"available_quotas": {}}\n\n'
516517
),
517518
]
518519
}

0 commit comments

Comments
 (0)