Query
Level-0 query entry points for GLLM RAG.
query(question, datastore, lm_invoker, top_k=5)
async
Run a minimal RAG query asynchronously.
Examples:
result = await query(
question="What is RAG?",
datastore=my_datastore.with_vector(em_invoker=my_em_invoker),
lm_invoker=my_lm_invoker,
top_k=5,
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
question
|
str
|
User question. |
required |
datastore
|
BaseDataStore
|
Datastore instance from |
required |
lm_invoker
|
BaseLMInvoker
|
LM invoker from |
required |
top_k
|
int
|
Number of chunks to retrieve. Defaults to 5. |
5
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: Result payload containing at least |
Raises:
| Type | Description |
|---|---|
TypeError
|
If datastore is not |
ValueError
|
If question/top_k are invalid, or datastore has no vector capability. |