diff --git a/docs/openapi.json b/docs/openapi.json index fa969fb98..3b5f280a9 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -2728,7 +2728,7 @@ "prompts" ], "summary": "Update Prompt Handler", - "description": "Handle requests to the PUT /prompts/{prompt_id} endpoint.\n\nProcess requests to update a stored prompt; Llama Stack increments the\nversion. The body includes the new text, the current version being\nreplaced, and optional fields such as ``set_as_default`` and ``variables``.\nFor example:\n\n curl -X PUT http://localhost:8080/v1/prompts/pmpt_abc123 \\\\\n -H 'Content-Type: application/json' \\\\\n -d '{\"prompt\": \"Hi\", \"version\": 1, \"set_as_default\": true}'\n\n### Parameters:\n- request: The incoming HTTP request (used by middleware).\n- prompt_id: The Llama Stack prompt identifier.\n- auth: Authentication tuple from the auth dependency (used by middleware).\n- body: Prompt update parameters.\n\n### Raises:\n- HTTPException: If configuration is not loaded, if the prompt is not\n found, if unable to connect to Llama Stack, or if the prompts API returns\n an error response.\n\n### Returns:\n- PromptResourceResponse: The updated prompt object returned by Llama Stack.", + "description": "Handle requests to the PUT /prompts/{prompt_id} endpoint.\n\nProcess requests to update a stored prompt; Llama Stack increments the\nversion. The body includes the new text, the current version being\nreplaced, and optional fields such as ``set_as_default`` and ``variables``.\nFor example:\n\n curl -X PUT http://localhost:8080/v1/prompts/pmpt_abc123 \\\\\n -H 'Content-Type: application/json' \\\\\n -d '{\"prompt\": \"Hi\", \"version\": 1, \"set_as_default\": true}'\n\n### Parameters:\n- request: The incoming HTTP request (used by middleware).\n- prompt_id: The Llama Stack prompt identifier.\n- auth: Authentication tuple from the auth dependency (used by middleware).\n- body: Prompt update parameters.\n\n### Raises:\n- HTTPException: with status 400 when request format is not valid.\n- HTTPException: with status 401 for unauthorized access.\n- HTTPException: with status 403 if permission is denied.\n- HTTPException: with status 404 if prompt is not found.\n- HTTPException: with status 422 if request payload is corrupted.\n- HTTPException: with status 500 and a detail object containing `response`\n and `cause` when service configuration is wrong or incomplete.\n- HTTPException: with status 503 and a detail object containing `response`\n and `cause` when unable to connect to Llama Stack.\n\n### Returns:\n- PromptResourceResponse: The updated prompt object returned by Llama Stack.", "operationId": "update_prompt_handler_v1_prompts__prompt_id__put", "parameters": [ { @@ -2980,7 +2980,7 @@ "prompts" ], "summary": "Delete Prompt Handler", - "description": "Handle requests to the DELETE /prompts/{prompt_id} endpoint.\n\nProcess requests to delete a stored prompt in Llama Stack. The response\nalways uses HTTP 200 with a JSON body indicating whether the deletion\nsucceeded (same pattern as deleting a conversation in ``/v2``). For example:\n\n curl -X DELETE http://localhost:8080/v1/prompts/pmpt_abc123\n\nWhen the prompt does not exist, the response still returns 200 with\n``deleted`` set to false in the body.\n\n### Parameters:\n- request: The incoming HTTP request (used by middleware).\n- prompt_id: The Llama Stack prompt identifier.\n- auth: Authentication tuple from the auth dependency (used by middleware).\n\n### Raises:\n- HTTPException: If configuration is not loaded, if unable to connect to\n Llama Stack, or if the prompts API returns an error response.\n\n### Returns:\n- PromptDeleteResponse: An object describing whether the prompt was\n deleted and a human-readable message.", + "description": "Handle requests to the DELETE /prompts/{prompt_id} endpoint.\n\nProcess requests to delete a stored prompt in Llama Stack. The response\nalways uses HTTP 200 with a JSON body indicating whether the deletion\nsucceeded (same pattern as deleting a conversation in ``/v2``). For example:\n\n curl -X DELETE http://localhost:8080/v1/prompts/pmpt_abc123\n\nWhen the prompt does not exist, the response still returns 200 with\n``deleted`` set to false in the body.\n\n### Parameters:\n- request: The incoming HTTP request (used by middleware).\n- prompt_id: The Llama Stack prompt identifier.\n- auth: Authentication tuple from the auth dependency (used by middleware).\n\n### Raises:\n- HTTPException: with status 401 for unauthorized access.\n- HTTPException: with status 403 if permission is denied.\n- HTTPException: with status 422 if request payload is corrupted.\n- HTTPException: with status 500 and a detail object containing `response`\n and `cause` when service configuration is wrong or incomplete.\n- HTTPException: with status 503 and a detail object containing `response`\n and `cause` when unable to connect to Llama Stack.\n\n### Returns:\n- PromptDeleteResponse: An object describing whether the prompt was\n deleted and a human-readable message.", "operationId": "delete_prompt_handler_v1_prompts__prompt_id__delete", "parameters": [ { @@ -3211,7 +3211,7 @@ "rags" ], "summary": "Rags Endpoint Handler", - "description": "List all available RAGs.\n\n### Parameters:\n- request: The incoming HTTP request (used by middleware).\n- auth: Authentication tuple from the auth dependency (used by middleware).\n\n### Raises:\n- HTTPException: with status 401 for unauthorized access.\n- HTTPException: with status 403 if permission is denied.\n- HTTPException: with status 500 and a detail object containing `response`\n and `cause` when service configuration is wrong or incomplete.\n- HTTPException: with status 503 and a detail object containing `response`\n and `cause` when unable to connect to Llama Stack.\n\n### Returns:\n - RAGListResponse: List of RAG identifiers.", + "description": "List all available RAGs.\n\n### Parameters:\n- request: The incoming HTTP request (used by middleware).\n- auth: Authentication tuple from the auth dependency (used by middleware).\n\n### Raises:\n- HTTPException: with status 401 for unauthorized access.\n- HTTPException: with status 403 if permission is denied.\n- HTTPException: with status 500 and a detail object containing `response`\n and `cause` when service configuration is wrong or incomplete.\n- HTTPException: with status 503 and a detail object containing `response`\n and `cause` when unable to connect to Llama Stack.\n\n### Returns:\n- RAGListResponse: List of RAG identifiers.", "operationId": "rags_endpoint_handler_v1_rags_get", "responses": { "200": { @@ -3384,7 +3384,7 @@ "rags" ], "summary": "Get Rag Endpoint Handler", - "description": "Retrieve a single RAG identified by its unique ID.\n\nAccepts both user-facing rag_id (from LCORE config) and llama-stack\nvector_store_id. If a rag_id from config is provided, it is resolved\nto the underlying vector_store_id for the llama-stack lookup.\n\nReturns:\n RAGInfoResponse: A single RAG's details.\n\nRaises:\n HTTPException:\n - 401: Authentication failed\n - 403: Authorization failed\n - 404: RAG with the given ID not found\n - 500: Lightspeed Stack configuration not loaded\n - 503: Unable to connect to Llama Stack", + "description": "Retrieve a single RAG identified by its unique ID.\n\nAccepts both user-facing rag_id (from LCORE config) and llama-stack\nvector_store_id. If a rag_id from config is provided, it is resolved\nto the underlying vector_store_id for the llama-stack lookup.\n\n### Parameters:\n- request: The incoming HTTP request (used by middleware).\n- rag_id: rag_id or llama-stack vector_store_id\n- auth: Authentication tuple from the auth dependency (used by middleware).\n\n### Raises:\n- HTTPException: with status 401 for unauthorized access.\n- HTTPException: with status 403 if permission is denied.\n- HTTPException: with status 404 if rag_id is not found.\n- HTTPException: with status 422 for incorrect request payload.\n- HTTPException: with status 500 and a detail object containing `response`\n and `cause` when service configuration is wrong or incomplete.\n- HTTPException: with status 503 and a detail object containing `response`\n and `cause` when unable to connect to Llama Stack.\n\n### Returns:\n- RAGInfoResponse: A single RAG's details.", "operationId": "get_rag_endpoint_handler_v1_rags__rag_id__get", "parameters": [ { diff --git a/docs/openapi.md b/docs/openapi.md index 124c5d782..aee97bdd8 100644 --- a/docs/openapi.md +++ b/docs/openapi.md @@ -2616,16 +2616,23 @@ Accepts both user-facing rag_id (from LCORE config) and llama-stack vector_store_id. If a rag_id from config is provided, it is resolved to the underlying vector_store_id for the llama-stack lookup. -Returns: - RAGInfoResponse: A single RAG's details. +### Parameters: +- request: The incoming HTTP request (used by middleware). +- rag_id: rag_id or llama-stack vector_store_id +- auth: Authentication tuple from the auth dependency (used by middleware). -Raises: - HTTPException: - - 401: Authentication failed - - 403: Authorization failed - - 404: RAG with the given ID not found - - 500: Lightspeed Stack configuration not loaded - - 503: Unable to connect to Llama Stack +### Raises: +- HTTPException: with status 401 for unauthorized access. +- HTTPException: with status 403 if permission is denied. +- HTTPException: with status 404 if rag_id is not found. +- HTTPException: with status 422 for incorrect request payload. +- HTTPException: with status 500 and a detail object containing `response` + and `cause` when service configuration is wrong or incomplete. +- HTTPException: with status 503 and a detail object containing `response` + and `cause` when unable to connect to Llama Stack. + +### Returns: +- RAGInfoResponse: A single RAG's details. @@ -5461,8 +5468,17 @@ Serve the A2A Agent Card at the well-known location. This endpoint provides the agent card that describes Lightspeed's capabilities according to the A2A protocol specification. -Returns: - AgentCard: The agent card describing this agent's capabilities. +### Parameters: +- auth: Authentication tuple from the auth dependency (used by middleware). + +### Raises: +- HTTPException: with status 500 and a detail object containing `response` + and `cause` when service configuration is wrong or incomplete. +- HTTPException: with status 503 and a detail object containing `response` + and `cause` when unable to connect to Llama Stack. + +### Returns: +- AgentCard: The agent card describing this agent's capabilities. @@ -5483,8 +5499,17 @@ Serve the A2A Agent Card at the well-known location. This endpoint provides the agent card that describes Lightspeed's capabilities according to the A2A protocol specification. -Returns: - AgentCard: The agent card describing this agent's capabilities. +### Parameters: +- auth: Authentication tuple from the auth dependency (used by middleware). + +### Raises: +- HTTPException: with status 500 and a detail object containing `response` + and `cause` when service configuration is wrong or incomplete. +- HTTPException: with status 503 and a detail object containing `response` + and `cause` when unable to connect to Llama Stack. + +### Returns: +- AgentCard: The agent card describing this agent's capabilities. @@ -5568,8 +5593,14 @@ Returns: Health check endpoint for A2A service. -Returns: - Dict with health status information. +### Parameters: +- None + +### Raises: +- None + +### Returns: +- Dict with health status information. @@ -5879,6 +5910,7 @@ Authentication configuration. | jwk_config | | | | api_key_config | | | | rh_identity_config | | | +| trusted_proxy_config | | | ## AuthorizationCodeOAuthFlow @@ -5974,6 +6006,11 @@ BYOK (Bring Your Own Knowledge) RAG configuration. | vector_db_id | string | Vector database identification. | | db_path | string | Path to RAG database. | | score_multiplier | number | Multiplier applied to relevance scores from this vector store. Used to weight results when querying multiple knowledge sources. Values > 1 boost this store's results; values < 1 reduce them. | +| host | | PostgreSQL host for remote::pgvector. Defaults to ${env.POSTGRES_HOST} when rag_type is remote::pgvector. | +| port | | PostgreSQL port for remote::pgvector. Defaults to ${env.POSTGRES_PORT} when rag_type is remote::pgvector. | +| db | | PostgreSQL database name for remote::pgvector. Defaults to ${env.POSTGRES_DATABASE} when rag_type is remote::pgvector. | +| user | | PostgreSQL user for remote::pgvector. Defaults to ${env.POSTGRES_USER} when rag_type is remote::pgvector. | +| password | | PostgreSQL password for remote::pgvector. Defaults to ${env.POSTGRES_PASSWORD} when rag_type is remote::pgvector. | ## CORSConfiguration @@ -6142,6 +6179,7 @@ Attributes: | Field | Type | Description | |-------|------|-------------| +| deleted | boolean | Whether the deletion was successful. | | conversation_id | string | The conversation ID (UUID) that was deleted. | | success | boolean | Whether the deletion was successful. | | response | string | A message about the deletion result. | @@ -6250,13 +6288,6 @@ Model representing a request to update a conversation topic summary. Attributes: topic_summary: The new topic summary for the conversation. -Example: - ```python - update_request = ConversationUpdateRequest( - topic_summary="Discussion about machine learning algorithms" - ) - ``` - | Field | Type | Description | |-------|------|-------------| @@ -6273,15 +6304,6 @@ Attributes: success: Whether the update was successful. message: A message about the update result. -Example: - ```python - update_response = ConversationUpdateResponse( - conversation_id="123e4567-e89b-12d3-a456-426614174000", - success=True, - message="Topic summary updated successfully", - ) - ``` - | Field | Type | Description | |-------|------|-------------| @@ -6397,18 +6419,6 @@ Attributes: user_feedback: The optional user feedback. categories: The optional list of feedback categories (multi-select for negative feedback). -Example: - ```python - feedback_request = FeedbackRequest( - conversation_id="12345678-abcd-0000-0123-456789abcdef", - user_question="what are you doing?", - user_feedback="This response is not helpful", - llm_response="I don't know", - sentiment=-1, - categories=[FeedbackCategory.INCORRECT, FeedbackCategory.INCOMPLETE] - ) - ``` - | Field | Type | Description | |-------|------|-------------| @@ -6428,11 +6438,6 @@ Model representing a response to a feedback request. Attributes: response: The response of the feedback request. -Example: - ```python - feedback_response = FeedbackResponse(response="feedback received") - ``` - | Field | Type | Description | |-------|------|-------------| @@ -6447,13 +6452,6 @@ Model representing a feedback status update request. Attributes: status: Value of the desired feedback enabled state. -Example: - ```python - feedback_request = FeedbackRequest( - status=false - ) - ``` - | Field | Type | Description | |-------|------|-------------| @@ -6468,18 +6466,6 @@ Model representing a response to a feedback status update request. Attributes: status: The previous and current status of the service and who updated it. -Example: - ```python - status_response = StatusResponse( - status={ - "previous_status": true, - "updated_status": false, - "updated_by": "user/test", - "timestamp": "2023-03-15 12:34:56" - }, - ) - ``` - | Field | Type | Description | |-------|------|-------------| @@ -6618,15 +6604,6 @@ Attributes: service_version: Service version. llama_stack_version: Llama Stack version. -Example: - ```python - info_response = InfoResponse( - name="Lightspeed Stack", - service_version="1.0.0", - llama_stack_version="0.2.22", - ) - ``` - | Field | Type | Description | |-------|------|-------------| @@ -6635,6 +6612,24 @@ Example: | llama_stack_version | string | Llama Stack version | +## InputToolMCP + + +MCP input tool with authorization included when serializing request bodies. + + +| Field | Type | Description | +|-------|------|-------------| +| type | string | | +| server_label | string | | +| connector_id | | | +| server_url | | | +| headers | | | +| authorization | | | +| require_approval | | | +| allowed_tools | | | + + ## InternalServerErrorResponse diff --git a/src/app/endpoints/prompts.py b/src/app/endpoints/prompts.py index 008a97d5d..6c85603c8 100644 --- a/src/app/endpoints/prompts.py +++ b/src/app/endpoints/prompts.py @@ -291,9 +291,15 @@ async def update_prompt_handler( - body: Prompt update parameters. ### Raises: - - HTTPException: If configuration is not loaded, if the prompt is not - found, if unable to connect to Llama Stack, or if the prompts API returns - an error response. + - HTTPException: with status 400 when request format is not valid. + - HTTPException: with status 401 for unauthorized access. + - HTTPException: with status 403 if permission is denied. + - HTTPException: with status 404 if prompt is not found. + - HTTPException: with status 422 if request payload is corrupted. + - HTTPException: with status 500 and a detail object containing `response` + and `cause` when service configuration is wrong or incomplete. + - HTTPException: with status 503 and a detail object containing `response` + and `cause` when unable to connect to Llama Stack. ### Returns: - PromptResourceResponse: The updated prompt object returned by Llama Stack. @@ -352,8 +358,13 @@ async def delete_prompt_handler( - auth: Authentication tuple from the auth dependency (used by middleware). ### Raises: - - HTTPException: If configuration is not loaded, if unable to connect to - Llama Stack, or if the prompts API returns an error response. + - HTTPException: with status 401 for unauthorized access. + - HTTPException: with status 403 if permission is denied. + - HTTPException: with status 422 if request payload is corrupted. + - HTTPException: with status 500 and a detail object containing `response` + and `cause` when service configuration is wrong or incomplete. + - HTTPException: with status 503 and a detail object containing `response` + and `cause` when unable to connect to Llama Stack. ### Returns: - PromptDeleteResponse: An object describing whether the prompt was diff --git a/src/app/endpoints/rags.py b/src/app/endpoints/rags.py index 911e135a4..8cf5c7679 100644 --- a/src/app/endpoints/rags.py +++ b/src/app/endpoints/rags.py @@ -75,7 +75,7 @@ async def rags_endpoint_handler( and `cause` when unable to connect to Llama Stack. ### Returns: - - RAGListResponse: List of RAG identifiers. + - RAGListResponse: List of RAG identifiers. """ # Used only by the middleware _ = auth @@ -147,16 +147,23 @@ async def get_rag_endpoint_handler( vector_store_id. If a rag_id from config is provided, it is resolved to the underlying vector_store_id for the llama-stack lookup. - Returns: - RAGInfoResponse: A single RAG's details. - - Raises: - HTTPException: - - 401: Authentication failed - - 403: Authorization failed - - 404: RAG with the given ID not found - - 500: Lightspeed Stack configuration not loaded - - 503: Unable to connect to Llama Stack + ### Parameters: + - request: The incoming HTTP request (used by middleware). + - rag_id: rag_id or llama-stack vector_store_id + - auth: Authentication tuple from the auth dependency (used by middleware). + + ### Raises: + - HTTPException: with status 401 for unauthorized access. + - HTTPException: with status 403 if permission is denied. + - HTTPException: with status 404 if rag_id is not found. + - HTTPException: with status 422 for incorrect request payload. + - HTTPException: with status 500 and a detail object containing `response` + and `cause` when service configuration is wrong or incomplete. + - HTTPException: with status 503 and a detail object containing `response` + and `cause` when unable to connect to Llama Stack. + + ### Returns: + - RAGInfoResponse: A single RAG's details. """ # Used only by the middleware _ = auth