Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
252 changes: 249 additions & 3 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@
}
},
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
"response": "LLM answer"
"response": "LLM answer",
"referenced_documents": [
{
"doc_url": "https://docs.openshift.com/container-platform/4.15/operators/olm/index.html",
"doc_title": "Operator Lifecycle Manager (OLM)"
}
]
},
Comment on lines 154 to 162
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Invalid placement of example fields in response

The example fields are placed directly under 200, not under content.application/json.example. Move them to “example” within the media type.

                     "200": {
                         "description": "Successful Response",
                         "content": {
                             "application/json": {
-                                "schema": {
-                                    "$ref": "#/components/schemas/QueryResponse"
-                                }
+                                "schema": {
+                                    "$ref": "#/components/schemas/QueryResponse"
+                                },
+                                "example": {
+                                    "conversation_id": "123e4567-e89b-12d3-a456-426614174000",
+                                    "response": "LLM answer",
+                                    "referenced_documents": [
+                                        {
+                                            "doc_url": "https://docs.openshift.com/container-platform/4.15/operators/olm/index.html",
+                                            "doc_title": "Operator Lifecycle Manager (OLM)"
+                                        }
+                                    ]
+                                }
                             }
                         },
-                        "conversation_id": "123e4567-e89b-12d3-a456-426614174000",
-                        "response": "LLM answer",
-                        "referenced_documents": [
-                            {
-                                "doc_url": "https://docs.openshift.com/container-platform/4.15/operators/olm/index.html",
-                                "doc_title": "Operator Lifecycle Manager (OLM)"
-                            }
-                        ]
                     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
"response": "LLM answer"
"response": "LLM answer",
"referenced_documents": [
{
"doc_url": "https://docs.openshift.com/container-platform/4.15/operators/olm/index.html",
"doc_title": "Operator Lifecycle Manager (OLM)"
}
]
},
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QueryResponse"
},
"example": {
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
"response": "LLM answer",
"referenced_documents": [
{
"doc_url": "https://docs.openshift.com/container-platform/4.15/operators/olm/index.html",
"doc_title": "Operator Lifecycle Manager (OLM)"
}
]
}
}
}
}
🤖 Prompt for AI Agents
In docs/openapi.json around lines 154 to 162, the response example JSON is
incorrectly placed directly under the HTTP 200 response object; move that
example into the media type path: add a content -> "application/json" -> example
(or examples) property and place the existing example object there, removing it
from the top-level 200 object so the OpenAPI response follows the structure: 200
-> description -> content -> "application/json" -> example.

"400": {
"description": "Missing or invalid credentials provided by client",
Expand Down Expand Up @@ -1155,6 +1161,9 @@
},
"inference": {
"$ref": "#/components/schemas/InferenceConfiguration"
},
"conversation_cache": {
"$ref": "#/components/schemas/ConversationCacheConfiguration"
}
},
"additionalProperties": false,
Expand All @@ -1168,6 +1177,61 @@
"title": "Configuration",
"description": "Global service configuration."
},
"ConversationCacheConfiguration": {
"properties": {
"type": {
"anyOf": [
{
"type": "string",
"enum": [
"noop",
"memory",
"sqlite",
"postgres"
]
},
{
"type": "null"
}
],
"title": "Type"
},
"memory": {
"anyOf": [
{
"$ref": "#/components/schemas/InMemoryCacheConfig"
},
{
"type": "null"
}
]
},
"sqlite": {
"anyOf": [
{
"$ref": "#/components/schemas/SQLiteDatabaseConfiguration"
},
{
"type": "null"
}
]
},
"postgres": {
"anyOf": [
{
"$ref": "#/components/schemas/PostgreSQLDatabaseConfiguration"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"type": "object",
"title": "ConversationCacheConfiguration",
"description": "Conversation cache configuration."
},
"ConversationDeleteResponse": {
"properties": {
"conversation_id": {
Expand Down Expand Up @@ -1751,6 +1815,22 @@
"type": "object",
"title": "HTTPValidationError"
},
"InMemoryCacheConfig": {
"properties": {
"max_entries": {
"type": "integer",
"exclusiveMinimum": 0.0,
"title": "Max Entries"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"max_entries"
],
"title": "InMemoryCacheConfig",
"description": "In-memory cache configuration."
},
"InferenceConfiguration": {
"properties": {
"default_model": {
Expand Down Expand Up @@ -2372,21 +2452,123 @@
"examples": [
"Kubernetes is an open-source container orchestration system for automating ..."
]
},
"rag_chunks": {
"items": {
"$ref": "#/components/schemas/RAGChunk"
},
"type": "array",
"title": "Rag Chunks",
"default": []
},
"tool_calls": {
"anyOf": [
{
"items": {
"$ref": "#/components/schemas/ToolCall"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Tool Calls",
"description": "List of tool calls made during response generation"
},
"referenced_documents": {
"items": {
"$ref": "#/components/schemas/ReferencedDocument"
},
"type": "array",
"title": "Referenced Documents",
"description": "List of documents referenced in generating the response",
"examples": [
[
{
"doc_title": "Operator Lifecycle Manager (OLM)",
"doc_url": "https://docs.openshift.com/container-platform/4.15/operators/olm/index.html"
}
]
]
}
},
"type": "object",
"required": [
"response"
],
"title": "QueryResponse",
"description": "Model representing LLM response to a query.\n\nAttributes:\n conversation_id: The optional conversation ID (UUID).\n response: The response.",
"description": "Model representing LLM response to a query.\n\nAttributes:\n conversation_id: The optional conversation ID (UUID).\n response: The response.\n rag_chunks: List of RAG chunks used to generate the response.\n referenced_documents: The URLs and titles for the documents used to generate the response.\n tool_calls: List of tool calls made during response generation.\n TODO: truncated: Whether conversation history was truncated.\n TODO: input_tokens: Number of tokens sent to LLM.\n TODO: output_tokens: Number of tokens received from LLM.\n TODO: available_quotas: Quota available as measured by all configured quota limiters\n TODO: tool_results: List of tool results.",
"examples": [
{
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
"response": "Operator Lifecycle Manager (OLM) helps users install..."
"rag_chunks": [
{
"content": "OLM is a component of the Operator Framework toolkit...",
"score": 0.95,
"source": "kubernetes-docs/operators.md"
}
],
"referenced_documents": [
{
"doc_title": "Operator Lifecycle Manager (OLM)",
"doc_url": "https://docs.openshift.com/container-platform/4.15/operators/olm/index.html"
}
],
"response": "Operator Lifecycle Manager (OLM) helps users install...",
"tool_calls": [
{
"arguments": {
"query": "operator lifecycle manager"
},
"result": {
"chunks_found": 5
},
"tool_name": "knowledge_search"
}
]
}
]
},
"RAGChunk": {
"properties": {
"content": {
"type": "string",
"title": "Content",
"description": "The content of the chunk"
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source",
"description": "Source document or URL"
},
"score": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Score",
"description": "Relevance score"
}
},
"type": "object",
"required": [
"content"
],
"title": "RAGChunk",
"description": "Model representing a RAG chunk used in the response."
},
"ReadinessResponse": {
"properties": {
"ready": {
Expand Down Expand Up @@ -2432,6 +2614,35 @@
}
]
},
"ReferencedDocument": {
"properties": {
"doc_url": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"format": "uri"
},
{
"type": "null"
}
],
"title": "Doc Url",
"description": "URL of the referenced document"
},
"doc_title": {
"type": "string",
"title": "Doc Title",
"description": "Title of the referenced document"
}
},
"type": "object",
"required": [
"doc_title"
],
"title": "ReferencedDocument",
"description": "Model representing a document referenced in generating a response.\n\nAttributes:\n doc_url: Url to the referenced doc.\n doc_title: Title of the referenced doc."
},
"SQLiteDatabaseConfiguration": {
"properties": {
"db_path": {
Expand Down Expand Up @@ -2565,6 +2776,41 @@
"title": "TLSConfiguration",
"description": "TLS configuration."
},
"ToolCall": {
"properties": {
"tool_name": {
"type": "string",
"title": "Tool Name",
"description": "Name of the tool called"
},
"arguments": {
"additionalProperties": true,
"type": "object",
"title": "Arguments",
"description": "Arguments passed to the tool"
},
"result": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Result",
"description": "Result from the tool"
}
},
"type": "object",
"required": [
"tool_name",
"arguments"
],
"title": "ToolCall",
"description": "Model representing a tool call made during response generation."
},
"UnauthorizedResponse": {
"properties": {
"detail": {
Expand Down
Loading
Loading