Retrieves context snippets from an assistant's documents without generating a chat response. Useful for RAG pipelines or agentic flows where you want to handle the context yourself.
Value
List with http response, content (context snippets), and status_code. Content includes a "snippets" list where each snippet has: - type: Snippet type (e.g., "text") - content: The text content of the snippet - score: Relevance score - reference: Reference information including: - type: Document type (e.g., "pdf") - file: File information - pages: Page numbers referenced
Examples
if (FALSE) { # \dontrun{
# Get context for a query
assistant_context(
assistant_name = "my-assistant",
query = "Who is the CFO?"
)
# Get context with filter
assistant_context(
assistant_name = "my-assistant",
query = "What are the revenue figures?",
filter = list(document_type = "financial"),
top_k = 10
)
} # }