Endpoints
ask() when you want a generated answer grounded in indexed video context.
Request body
ask() does not accept index selectors such as index_name, index_names, index_id, or index_ids.
Example
Response
Returns anAskResponse.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Ask questions over indexed video or collection context.
POST /video/{video_id}/ask
POST /collection/{collection_id}/ask
ask() when you want a generated answer grounded in indexed video context.
| Field | Type | Required | Description |
|---|---|---|---|
question | string | yes | Question to answer from indexed video context. |
top_k | integer | no | Number of retrieved candidate moments. Defaults to 15. |
mode | string | no | Search mode used for source retrieval. Defaults to "default". |
include_sources | boolean | no | Include supporting source shots in the response. Defaults to false. |
ask() does not accept index selectors such as index_name, index_names, index_id, or index_ids.
answer = collection.ask(
question="Which brands are mentioned and what is said about them?",
top_k=15,
mode="default",
include_sources=True,
)
print(answer.answer)
for source in answer.sources:
print(source.video_id, source.start, source.end)
AskResponse.
| Attribute | Description |
|---|---|
answer | Generated answer text. |
sources | Supporting Shot objects when include_sources=True. |