steamship.invocable.mixins package#
Submodules#
steamship.invocable.mixins.blockifier_mixin module#
- class steamship.invocable.mixins.blockifier_mixin.BlockifierMixin(client: Steamship)[source]#
Bases:
PackageMixin
Provides endpoints for easy Blockification of files.
- blockify(file_id: str, mime_type: MimeTypes | None = None, blockifier_handle: str | None = None, after_task_id: str | None = None) Task [source]#
Blockify the file file_id using a curated set of defaults for the provided mime_type.
If no MIME Type is provided, the file’s recorded MIME Type will be used. If still no MIME Type is available, an error will be thrown.
Supported MIME Types:
PDF
Audio (MP3, MP4, WEBM)
steamship.invocable.mixins.file_importer_mixin module#
steamship.invocable.mixins.indexer_mixin module#
- class steamship.invocable.mixins.indexer_mixin.IndexerMixin(client: Steamship, embedder_config: dict = None, context_window_size: int = 200, context_window_overlap: int = 50)[source]#
Bases:
PackageMixin
Provides endpoints for easy Indexing of blockified files.
- index_block(block_id: str, metadata: dict | None = None, index_handle: str | None = None)[source]#
Load a Steamship Block into an embedding index.
Optional arguments: - index_handle (uses your default index if blank) - metadata (returned on embedding results for source attribution)
- index_file(file_id: str, metadata: dict | None = None, index_handle: str | None = None) bool [source]#
Load a Steamship File into an embedding index.
Optional arguments: - index_handle (uses your default index if blank) - metadata (returned on embedding results for source attribution)
steamship.invocable.mixins.indexer_pipeline_mixin module#
- class steamship.invocable.mixins.indexer_pipeline_mixin.IndexerPipelineMixin(client: Steamship, invocable: PackageService)[source]#
Bases:
PackageMixin
Provides a complete set of endpoints & async workflow for Document Question Answering.
This Mixin is an async orchestrator of other mixins: - Importer Mixin: to import files, e.g. YouTube videos, PDF urls - Blockifier Mixin: to convert files to Blocks – whether that’s s2t or PDF parsing, etc. - Indexer Mixin: to convert Steamship Files to embedded sharts
- blockifier_mixin: BlockifierMixin#
- importer_mixin: FileImporterMixin#
- index_url(url: str, metadata: dict | None = None, index_handle: str | None = None, mime_type: str | None = None) Task [source]#
Load a URL into an embedding index.
URL Types supported: - PDF (Text) - TXT and Markdown - YouTube (Though failure rate is high)
Optional arguments: - mime_type (if it can be guessed by the Content-Type header or the URL schema) - index_handle (uses your default index if blank) - metadata (returned on embedding results for source attribution)
- indexer_mixin: IndexerMixin#
- invocable: PackageService#