One stable field supports text, documents, prior Vidbyte resources, and imported provider content
Use the context adapter to attach source material to any generation call
The `context` field is the universal input adapter in the Vidbyte API. Instead of forcing every route family to invent its own upload or resource-attachment format, Vidbyte accepts typed context objects that the middleware validates and resolves into text before orchestration begins.
Supported context types
9
Text, documents, PDFs, and several Vidbyte resource families are supported today.
Public contract shape
One field
Major create routes accept context through the same top-level request key.
Resolution model
Middleware-backed
Validation, ownership checks, and formatting happen before generation starts.
Why this pattern exists
The route should care about learning input, not about where that input came from
A route like roadmap creation should not need one path for inline text, another for PDFs, another for prior Vidbyte artifacts, and another for imported provider content. The context adapter gives the caller one stable contract while the middleware does the type-specific work behind the boundary.
That keeps route DTOs ergonomic and lets Vidbyte grow the kinds of source material it can accept without redesigning every endpoint family.
Supported now
These are the context shapes the backend middleware understands today
`text` for inline notes or learner profiles.
`doc` and `pdf` for document-backed content that is extracted or supplied in text form.
`quickhit`, `roadmap`, `quiz`, `exam`, `project`, and `vidbyte_project` for previously generated Vidbyte resources referenced by encrypted public id.
Shape
A context array is just a list of typed objects
JSON
Sample context payload
[
{ "type": "text", "label": "learner_profile", "text": "Intermediate backend engineer preparing for staff interviews" },
{ "type": "doc", "filename": "notes.md", "file": "<base64 payload>" },
{ "type": "roadmap", "id": "rdm_Qj3Y5N0k2b", "module_number": 2 }
]Connectors and context
Imported connector content still ends up here
Connector workflows do not replace the context adapter. They feed it. After a user connects Google Drive or Notion and selects the external material they want Vidbyte to use, the integrations layer normalizes that content and passes it into the same context contract the route middleware already knows how to resolve.