fetch — that gathers the documents and returns them as files; the platform ingests them.
The class
SubclassBaseDataSource[Config] and implement fetch:
How fetch works
1
Gather the documents
Read whatever you need from the external service, using
self.config and the integration credentials.2
Upload each file's bytes
Persist content with
ctx.get_file_helper().upload_file(bytes, name=..., content_type=...). The upload goes over the host callback — the bytes are not returned inline — and you get back a File descriptor.3
Return the files
Return the
list[File]. The platform ingests them into the knowledge base.Ingestion is one-shot today:
fetch returns the current set of documents each time it runs. Incremental sync (only new/changed documents) is a later phase — supports_sync defaults to False.Reading credentials
List the integration types inintegrations and read them from the context:
File helpers.