Query Completion

Generate completion using relevant chunks as context.

When graph_name is provided, the query will leverage the knowledge graph to enhance retrieval by finding relevant entities and their connected documents.

Args: request: CompletionQueryRequest containing: - query: Query text - filters: Optional metadata filters - k: Number of chunks to use as context (default: 4) - min_score: Minimum similarity threshold (default: 0.0) - max_tokens: Maximum tokens in completion - temperature: Model temperature - use_reranking: Whether to use reranking - use_colpali: Whether to use ColPali-style embedding model - graph_name: Optional name of the graph to use for knowledge graph-enhanced retrieval - hop_depth: Number of relationship hops to traverse in the graph (1-3) - include_paths: Whether to include relationship paths in the response - prompt_overrides: Optional customizations for entity extraction, resolution, and query prompts - folder_name: Optional folder to scope the operation to - end_user_id: Optional end-user ID to scope the operation to - schema: Optional schema for structured output - chat_id: Optional chat conversation identifier for maintaining history auth: Authentication context

Returns: CompletionResponse: Generated text completion or structured output

post/query

Headers

authorizationstring

Request body

querystring required
filtersobject nullable
kinteger
min_scorenumber
use_rerankingboolean nullable
use_colpaliboolean nullable
paddinginteger

Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only)

graph_namestring nullable

Name of the graph to use for knowledge graph-enhanced retrieval

hop_depthinteger nullable

Number of relationship hops to traverse in the graph

include_pathsboolean nullable

Whether to include relationship paths in the response

end_user_idstring nullable

Optional end-user scope for the operation

max_tokensinteger nullable
temperaturenumber nullable
chat_idstring nullable

Optional chat session ID for persisting conversation history

stream_responseboolean nullable

Whether to stream the response back in chunks

llm_configobject nullable

LiteLLM-compatible model configuration (e.g., model name, API key, base URL)

inline_citationsboolean nullable

Whether to include inline citations with filename and page number in the response

Response

Successful Response

usageobject required
finish_reasonstring nullable
metadataobject nullable

Changes