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 auth: Authentication context
Returns: CompletionResponse: Generated text completion or structured output
Headers
Body
Request model for completion generation
1
x > 0
Name of the graph to use for knowledge graph-enhanced retrieval
Number of relationship hops to traverse in the graph
1 <= x <= 3
Whether to include relationship paths in the response
Optional folder scope for the operation
Optional end-user scope for the operation
Optional customizations for entity extraction, resolution, and query prompts
Schema for structured output, can be a Pydantic model or JSON schema dict
Was this page helpful?