steamship.plugin.outputs package#
Submodules#
steamship.plugin.outputs.block_and_tag_plugin_output module#
- class steamship.plugin.outputs.block_and_tag_plugin_output.BlockAndTagPluginOutput(*, usage: List[UsageReport] | None = None, file: File = None)[source]#
Bases:
PluginOutput
steamship.plugin.outputs.block_type_plugin_output module#
- class steamship.plugin.outputs.block_type_plugin_output.BlockTypePluginOutput(*, usage: List[UsageReport] | None = None, blockTypesToCreate: List[str])[source]#
Bases:
PluginOutput
steamship.plugin.outputs.embedded_items_plugin_output module#
steamship.plugin.outputs.model_checkpoint module#
- class steamship.plugin.outputs.model_checkpoint.ModelCheckpoint(client: Steamship, parent_directory: Path | None = None, handle: str = 'default', plugin_instance_id: str = None)[source]#
Bases:
CamelModel
- archive_path_in_steamship(as_handle: str = None) str [source]#
Returns the path to the checkpoint archive on Steamship.
On steamship, the checkpoint is archived in the Workspace’s PluginInstance bucket as: {plugin_instance_bucket}/{plugin_instance_id}/{checkpoint_handle}.zip
Here we only return the following path since the bucket is specified separately in the required Steamship API calls: {plugin_instance_id}/{checkpoint_handle}.zip
- archive_path_on_disk() Path [source]#
Returns the path to the checkpoint archive on disk.
- On disk, the model checkpoint is the folder:
{parent_directory}/{checkpoint_handle}.zip
- download_model_bundle() Path [source]#
Download’s the model from Steamship and unzips to parent_directory
steamship.plugin.outputs.plugin_output module#
- class steamship.plugin.outputs.plugin_output.OperationType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- CREATE = 'create'#
- DELETE = 'delete'#
- EXISTS = 'exists'#
- EXISTS_TRAINED = 'existsTrained'#
- RUN = 'run'#
- TRAIN = 'train'#
- class steamship.plugin.outputs.plugin_output.OperationUnit(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- BYTES = 'bytes'#
- CHARACTERS = 'characters'#
- MS = 'ms'#
- PROMPT_TOKENS = 'promptTokens'#
- SAMPLED_TOKENS = 'sampledTokens'#
- TOKENS = 'tokens'#
- UNITS = 'units'#
- class steamship.plugin.outputs.plugin_output.PluginOutput(*, usage: List[UsageReport] | None = None)[source]#
Bases:
CamelModel
Base class for all types of plugin output, allowing usage reporting
- usage: List[UsageReport] | None#
- class steamship.plugin.outputs.plugin_output.UsageReport(*, operationType: OperationType, operationUnit: OperationUnit, operationAmount: int, auditURL: str | None = None, auditId: str | None = None)[source]#
Bases:
CamelModel
This is the report object that a plugin or package can send back to notify the engine how much of something was consumed
- operation_type: OperationType#
- operation_unit: OperationUnit#
steamship.plugin.outputs.raw_block_and_tag_plugin_output module#
- class steamship.plugin.outputs.raw_block_and_tag_plugin_output.RawBlockAndTagPluginOutput(*, usage: List[UsageReport] | None = None, blocks: List[Block])[source]#
Bases:
PluginOutput
steamship.plugin.outputs.raw_data_plugin_output module#
- class steamship.plugin.outputs.raw_data_plugin_output.RawDataPluginOutput(base64string: str = None, string: str = None, _bytes: bytes | io.BytesIO = None, json: Any = None, mime_type: str = None, tags: List[Tag] | None = None, *, usage: List[UsageReport] | None = None, data: str | None = None)[source]#
Bases:
PluginOutput
Represents mime-typed raw data (or a URL pointing to raw data) that can be returned to the engine.
As a few examples, you can return: - Raw text: RawDataPluginOutput(string=raw_text, MimeTypes.TXT) - Markdown text: RawDataPluginOutput(string=markdown_text, MimeTypes.MKD) - A PNG image: RawDataPluginOutput(bytes=png_bytes, MimeTypes.PNG) - A JSON-serializable Dataclass: RawDataPluginOutput(json=dataclass, MimeTypes.JSON) - Steamship Blocks: RawDataPluginOutput(json=file, MimeTypes.STEAMSHIP_BLOCK_JSON) - Data uploaded to a pre-signed URL: RawDataPluginOutput(url=presigned_url, MimeTypes.TXT)
The data field of this object will ALWAYS be Base64 encoded by the constructor. This ensures that the object is always trivially JSON-serializable over the wire, no matter what it contains.
The mimeType field of this object should always be filled in if known. The Steamship Engine makes use of it to proactively select defaults for handling the data returned.
steamship.plugin.outputs.stream_complete_plugin_output module#
- class steamship.plugin.outputs.stream_complete_plugin_output.StreamCompletePluginOutput(*, usage: List[UsageReport] | None = None)[source]#
Bases:
PluginOutput
steamship.plugin.outputs.train_plugin_output module#
- class steamship.plugin.outputs.train_plugin_output.TrainPluginOutput(*, usage: List[UsageReport] | None = None, pluginInstanceId: str = None, archivePath: str = None, inferenceParams: dict = None, trainingProgress: dict = None, trainingResults: dict = None)[source]#
Bases:
PluginOutput
This is the object produced by a completed trainable operation, stored as the output field of a train task.
steamship.plugin.outputs.training_parameter_plugin_output module#
- class steamship.plugin.outputs.training_parameter_plugin_output.TrainingParameterPluginOutput(*, usage: List[UsageReport] | None = None, machineType: str | None = None, trainingEpochs: int = None, testingHoldoutPercent: float = None, testSplitSeed: int = None, trainingParams: Dict[str, Any] = None, inferenceParams: Dict[str, Any] = None, exportRequest: ExportPluginInput = None)[source]#
Bases:
PluginOutput
- export_request: ExportPluginInput#
- static from_input(input: TrainingParameterPluginInput) TrainingParameterPluginOutput [source]#