|
38 | 38 | "info" |
39 | 39 | ], |
40 | 40 | "summary": "Info Endpoint Handler", |
41 | | - "description": "Handle request to the /info endpoint.", |
| 41 | + "description": "Handle request to the /info endpoint.\n\nProcess GET requests to the /info endpoint, returning the\nservice name and version.\n\nReturns:\n InfoResponse: An object containing the service's name and version.", |
42 | 42 | "operationId": "info_endpoint_handler_v1_info_get", |
43 | 43 | "responses": { |
44 | 44 | "200": { |
|
220 | 220 | "config" |
221 | 221 | ], |
222 | 222 | "summary": "Config Endpoint Handler", |
223 | | - "description": "Handle requests to the /config endpoint.", |
| 223 | + "description": "Handle requests to the /config endpoint.\n\nProcess GET requests to the /config endpoint and returns the\ncurrent service configuration.\n\nReturns:\n Configuration: The loaded service configuration object.", |
224 | 224 | "operationId": "config_endpoint_handler_v1_config_get", |
225 | 225 | "responses": { |
226 | 226 | "200": { |
|
367 | 367 | } |
368 | 368 | } |
369 | 369 | }, |
| 370 | + "/v1/conversations": { |
| 371 | + "get": { |
| 372 | + "tags": [ |
| 373 | + "conversations" |
| 374 | + ], |
| 375 | + "summary": "Get Conversations List Endpoint Handler", |
| 376 | + "description": "Handle request to retrieve all conversations for the authenticated user.", |
| 377 | + "operationId": "get_conversations_list_endpoint_handler_v1_conversations_get", |
| 378 | + "responses": { |
| 379 | + "200": { |
| 380 | + "description": "Successful Response", |
| 381 | + "content": { |
| 382 | + "application/json": { |
| 383 | + "schema": { |
| 384 | + "$ref": "#/components/schemas/ConversationsListResponse" |
| 385 | + } |
| 386 | + } |
| 387 | + }, |
| 388 | + "conversations": [ |
| 389 | + { |
| 390 | + "conversation_id": "123e4567-e89b-12d3-a456-426614174000", |
| 391 | + "created_at": "2024-01-01T00:00:00Z", |
| 392 | + "last_message_at": "2024-01-01T00:05:00Z", |
| 393 | + "last_used_model": "gemini/gemini-1.5-flash", |
| 394 | + "last_used_provider": "gemini", |
| 395 | + "message_count": 5 |
| 396 | + }, |
| 397 | + { |
| 398 | + "conversation_id": "456e7890-e12b-34d5-a678-901234567890", |
| 399 | + "created_at": "2024-01-01T01:00:00Z", |
| 400 | + "last_message_at": "2024-01-01T01:02:00Z", |
| 401 | + "last_used_model": "gemini/gemini-2.0-flash", |
| 402 | + "last_used_provider": "gemini", |
| 403 | + "message_count": 2 |
| 404 | + } |
| 405 | + ] |
| 406 | + }, |
| 407 | + "503": { |
| 408 | + "description": "Service Unavailable", |
| 409 | + "detail": { |
| 410 | + "response": "Unable to connect to Llama Stack", |
| 411 | + "cause": "Connection error." |
| 412 | + } |
| 413 | + } |
| 414 | + } |
| 415 | + } |
| 416 | + }, |
370 | 417 | "/v1/conversations/{conversation_id}": { |
371 | 418 | "get": { |
372 | 419 | "tags": [ |
|
505 | 552 | "health" |
506 | 553 | ], |
507 | 554 | "summary": "Readiness Probe Get Method", |
508 | | - "description": "Ready status of service with provider health details.", |
| 555 | + "description": "Handle the readiness probe endpoint, returning service readiness.\n\nIf any provider reports an error status, responds with HTTP 503\nand details of unhealthy providers; otherwise, indicates the\nservice is ready.", |
509 | 556 | "operationId": "readiness_probe_get_method_readiness_get", |
510 | 557 | "responses": { |
511 | 558 | "200": { |
|
537 | 584 | "health" |
538 | 585 | ], |
539 | 586 | "summary": "Liveness Probe Get Method", |
540 | | - "description": "Live status of service.", |
| 587 | + "description": "Return the liveness status of the service.\n\nReturns:\n LivenessResponse: Indicates that the service is alive.", |
541 | 588 | "operationId": "liveness_probe_get_method_liveness_get", |
542 | 589 | "responses": { |
543 | 590 | "200": { |
|
569 | 616 | "authorized" |
570 | 617 | ], |
571 | 618 | "summary": "Authorized Endpoint Handler", |
572 | | - "description": "Handle request to the /authorized endpoint.", |
| 619 | + "description": "Handle request to the /authorized endpoint.\n\nProcess POST requests to the /authorized endpoint, returning\nthe authenticated user's ID and username.\n\nReturns:\n AuthorizedResponse: Contains the user ID and username of the authenticated user.", |
573 | 620 | "operationId": "authorized_endpoint_handler_authorized_post", |
574 | 621 | "responses": { |
575 | 622 | "200": { |
|
611 | 658 | "metrics" |
612 | 659 | ], |
613 | 660 | "summary": "Metrics Endpoint Handler", |
614 | | - "description": "Handle request to the /metrics endpoint.", |
| 661 | + "description": "Handle request to the /metrics endpoint.\n\nProcess GET requests to the /metrics endpoint, returning the\nlatest Prometheus metrics in form of a plain text.\n\nInitializes model metrics on the first request if not already\nset up, then responds with the current metrics snapshot in\nPrometheus format.", |
615 | 662 | "operationId": "metrics_endpoint_handler_metrics_get", |
616 | 663 | "responses": { |
617 | 664 | "200": { |
|
775 | 822 | "user_data_collection": { |
776 | 823 | "$ref": "#/components/schemas/UserDataCollection" |
777 | 824 | }, |
| 825 | + "database": { |
| 826 | + "$ref": "#/components/schemas/DatabaseConfiguration", |
| 827 | + "default": { |
| 828 | + "sqlite": { |
| 829 | + "db_path": "/tmp/lightspeed-stack.db" |
| 830 | + } |
| 831 | + } |
| 832 | + }, |
778 | 833 | "mcp_servers": { |
779 | 834 | "items": { |
780 | 835 | "$ref": "#/components/schemas/ModelContextProtocolServer" |
|
853 | 908 | } |
854 | 909 | ] |
855 | 910 | }, |
| 911 | + "ConversationDetails": { |
| 912 | + "properties": { |
| 913 | + "conversation_id": { |
| 914 | + "type": "string", |
| 915 | + "title": "Conversation Id" |
| 916 | + }, |
| 917 | + "created_at": { |
| 918 | + "anyOf": [ |
| 919 | + { |
| 920 | + "type": "string" |
| 921 | + }, |
| 922 | + { |
| 923 | + "type": "null" |
| 924 | + } |
| 925 | + ], |
| 926 | + "title": "Created At" |
| 927 | + }, |
| 928 | + "last_message_at": { |
| 929 | + "anyOf": [ |
| 930 | + { |
| 931 | + "type": "string" |
| 932 | + }, |
| 933 | + { |
| 934 | + "type": "null" |
| 935 | + } |
| 936 | + ], |
| 937 | + "title": "Last Message At" |
| 938 | + }, |
| 939 | + "message_count": { |
| 940 | + "anyOf": [ |
| 941 | + { |
| 942 | + "type": "integer" |
| 943 | + }, |
| 944 | + { |
| 945 | + "type": "null" |
| 946 | + } |
| 947 | + ], |
| 948 | + "title": "Message Count" |
| 949 | + }, |
| 950 | + "last_used_model": { |
| 951 | + "anyOf": [ |
| 952 | + { |
| 953 | + "type": "string" |
| 954 | + }, |
| 955 | + { |
| 956 | + "type": "null" |
| 957 | + } |
| 958 | + ], |
| 959 | + "title": "Last Used Model" |
| 960 | + }, |
| 961 | + "last_used_provider": { |
| 962 | + "anyOf": [ |
| 963 | + { |
| 964 | + "type": "string" |
| 965 | + }, |
| 966 | + { |
| 967 | + "type": "null" |
| 968 | + } |
| 969 | + ], |
| 970 | + "title": "Last Used Provider" |
| 971 | + } |
| 972 | + }, |
| 973 | + "type": "object", |
| 974 | + "required": [ |
| 975 | + "conversation_id" |
| 976 | + ], |
| 977 | + "title": "ConversationDetails", |
| 978 | + "description": "Model representing the details of a user conversation.\n\nAttributes:\n conversation_id: The conversation ID (UUID).\n created_at: When the conversation was created.\n last_message_at: When the last message was sent.\n message_count: Number of user messages in the conversation.\n model: The model used for the conversation.\n\nExample:\n ```python\n conversation = ConversationSummary(\n conversation_id=\"123e4567-e89b-12d3-a456-426614174000\"\n created_at=\"2024-01-01T00:00:00Z\",\n last_message_at=\"2024-01-01T00:05:00Z\",\n message_count=5,\n model=\"gemini/gemini-2.0-flash\"\n )\n ```" |
| 979 | + }, |
856 | 980 | "ConversationResponse": { |
857 | 981 | "properties": { |
858 | 982 | "conversation_id": { |
|
897 | 1021 | } |
898 | 1022 | ] |
899 | 1023 | }, |
| 1024 | + "ConversationsListResponse": { |
| 1025 | + "properties": { |
| 1026 | + "conversations": { |
| 1027 | + "items": { |
| 1028 | + "$ref": "#/components/schemas/ConversationDetails" |
| 1029 | + }, |
| 1030 | + "type": "array", |
| 1031 | + "title": "Conversations" |
| 1032 | + } |
| 1033 | + }, |
| 1034 | + "type": "object", |
| 1035 | + "required": [ |
| 1036 | + "conversations" |
| 1037 | + ], |
| 1038 | + "title": "ConversationsListResponse", |
| 1039 | + "description": "Model representing a response for listing conversations of a user.\n\nAttributes:\n conversations: List of conversation details associated with the user.\n\nExample:\n ```python\n conversations_list = ConversationsListResponse(\n conversations=[\n ConversationDetails(\n conversation_id=\"123e4567-e89b-12d3-a456-426614174000\",\n created_at=\"2024-01-01T00:00:00Z\",\n last_message_at=\"2024-01-01T00:05:00Z\",\n message_count=5,\n model=\"gemini/gemini-2.0-flash\"\n ),\n ConversationDetails(\n conversation_id=\"456e7890-e12b-34d5-a678-901234567890\"\n created_at=\"2024-01-01T01:00:00Z\",\n message_count=2,\n model=\"gemini/gemini-2.5-flash\"\n )\n ]\n )\n ```", |
| 1040 | + "examples": [ |
| 1041 | + { |
| 1042 | + "conversations": [ |
| 1043 | + { |
| 1044 | + "conversation_id": "123e4567-e89b-12d3-a456-426614174000", |
| 1045 | + "created_at": "2024-01-01T00:00:00Z", |
| 1046 | + "last_message_at": "2024-01-01T00:05:00Z", |
| 1047 | + "message_count": 5, |
| 1048 | + "model": "gemini/gemini-2.0-flash" |
| 1049 | + }, |
| 1050 | + { |
| 1051 | + "conversation_id": "456e7890-e12b-34d5-a678-901234567890", |
| 1052 | + "created_at": "2024-01-01T01:00:00Z", |
| 1053 | + "message_count": 2, |
| 1054 | + "model": "gemini/gemini-2.5-flash" |
| 1055 | + } |
| 1056 | + ] |
| 1057 | + } |
| 1058 | + ] |
| 1059 | + }, |
900 | 1060 | "Customization": { |
901 | 1061 | "properties": { |
902 | 1062 | "disable_query_system_prompt": { |
|
994 | 1154 | "title": "DataCollectorConfiguration", |
995 | 1155 | "description": "Data collector configuration for sending data to ingress server." |
996 | 1156 | }, |
| 1157 | + "DatabaseConfiguration": { |
| 1158 | + "properties": { |
| 1159 | + "sqlite": { |
| 1160 | + "anyOf": [ |
| 1161 | + { |
| 1162 | + "$ref": "#/components/schemas/SQLiteDatabaseConfiguration" |
| 1163 | + }, |
| 1164 | + { |
| 1165 | + "type": "null" |
| 1166 | + } |
| 1167 | + ] |
| 1168 | + }, |
| 1169 | + "postgres": { |
| 1170 | + "anyOf": [ |
| 1171 | + { |
| 1172 | + "$ref": "#/components/schemas/PostgreSQLDatabaseConfiguration" |
| 1173 | + }, |
| 1174 | + { |
| 1175 | + "type": "null" |
| 1176 | + } |
| 1177 | + ] |
| 1178 | + } |
| 1179 | + }, |
| 1180 | + "type": "object", |
| 1181 | + "title": "DatabaseConfiguration", |
| 1182 | + "description": "Database configuration." |
| 1183 | + }, |
997 | 1184 | "FeedbackCategory": { |
998 | 1185 | "type": "string", |
999 | 1186 | "enum": [ |
|
1382 | 1569 | "title": "ModelsResponse", |
1383 | 1570 | "description": "Model representing a response to models request." |
1384 | 1571 | }, |
| 1572 | + "PostgreSQLDatabaseConfiguration": { |
| 1573 | + "properties": { |
| 1574 | + "host": { |
| 1575 | + "type": "string", |
| 1576 | + "title": "Host", |
| 1577 | + "default": "localhost" |
| 1578 | + }, |
| 1579 | + "port": { |
| 1580 | + "type": "integer", |
| 1581 | + "title": "Port", |
| 1582 | + "default": 5432 |
| 1583 | + }, |
| 1584 | + "db": { |
| 1585 | + "type": "string", |
| 1586 | + "title": "Db" |
| 1587 | + }, |
| 1588 | + "user": { |
| 1589 | + "type": "string", |
| 1590 | + "title": "User" |
| 1591 | + }, |
| 1592 | + "password": { |
| 1593 | + "type": "string", |
| 1594 | + "title": "Password" |
| 1595 | + }, |
| 1596 | + "namespace": { |
| 1597 | + "anyOf": [ |
| 1598 | + { |
| 1599 | + "type": "string" |
| 1600 | + }, |
| 1601 | + { |
| 1602 | + "type": "null" |
| 1603 | + } |
| 1604 | + ], |
| 1605 | + "title": "Namespace", |
| 1606 | + "default": "lightspeed-stack" |
| 1607 | + }, |
| 1608 | + "ssl_mode": { |
| 1609 | + "type": "string", |
| 1610 | + "title": "Ssl Mode", |
| 1611 | + "default": "prefer" |
| 1612 | + }, |
| 1613 | + "gss_encmode": { |
| 1614 | + "type": "string", |
| 1615 | + "title": "Gss Encmode", |
| 1616 | + "default": "prefer" |
| 1617 | + }, |
| 1618 | + "ca_cert_path": { |
| 1619 | + "anyOf": [ |
| 1620 | + { |
| 1621 | + "type": "string", |
| 1622 | + "format": "file-path" |
| 1623 | + }, |
| 1624 | + { |
| 1625 | + "type": "null" |
| 1626 | + } |
| 1627 | + ], |
| 1628 | + "title": "Ca Cert Path" |
| 1629 | + } |
| 1630 | + }, |
| 1631 | + "type": "object", |
| 1632 | + "required": [ |
| 1633 | + "db", |
| 1634 | + "user", |
| 1635 | + "password" |
| 1636 | + ], |
| 1637 | + "title": "PostgreSQLDatabaseConfiguration", |
| 1638 | + "description": "PostgreSQL database configuration." |
| 1639 | + }, |
1385 | 1640 | "ProviderHealthStatus": { |
1386 | 1641 | "properties": { |
1387 | 1642 | "provider_id": { |
|
1649 | 1904 | } |
1650 | 1905 | ] |
1651 | 1906 | }, |
| 1907 | + "SQLiteDatabaseConfiguration": { |
| 1908 | + "properties": { |
| 1909 | + "db_path": { |
| 1910 | + "type": "string", |
| 1911 | + "title": "Db Path" |
| 1912 | + } |
| 1913 | + }, |
| 1914 | + "type": "object", |
| 1915 | + "required": [ |
| 1916 | + "db_path" |
| 1917 | + ], |
| 1918 | + "title": "SQLiteDatabaseConfiguration", |
| 1919 | + "description": "SQLite database configuration." |
| 1920 | + }, |
1652 | 1921 | "ServiceConfiguration": { |
1653 | 1922 | "properties": { |
1654 | 1923 | "host": { |
|
0 commit comments