steamship.data.plugin package#
Submodules#
steamship.data.plugin.hosting module#
- class steamship.data.plugin.hosting.HostingCpu(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The amount of CPU required for deployment.
This is mapped to a value dependent on the HostingType it is combined with.
- LG = 'lg'#
- MAX = 'max'#
- MD = 'md'#
- MIN = 'min'#
- SM = 'sm'#
- XL = 'xl'#
- XS = 'xs'#
- XXL = 'xxl'#
- XXS = 'xxs'#
- class steamship.data.plugin.hosting.HostingEnvironment(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The software environment required for deployment.
- PYTHON38 = 'python38'#
- STEAMSHIP_PYTORCH_CPU = 'inferenceCpu'#
- class steamship.data.plugin.hosting.HostingMemory(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The amount of memory required for deployment.
This is mapped to a value dependent on the HostingType it is combined with.
- LG = 'lg'#
- MAX = 'max'#
- MD = 'md'#
- MIN = 'min'#
- SM = 'sm'#
- XL = 'xl'#
- XS = 'xs'#
- XXL = 'xxl'#
- XXS = 'xxs'#
- class steamship.data.plugin.hosting.HostingTimeout(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The request timeout required for deployment.
This is mapped to a value dependent on the HostingType it is combined with.
- LG = 'lg'#
- MAX = 'max'#
- MD = 'md'#
- MIN = 'min'#
- SM = 'sm'#
- XL = 'xl'#
- XS = 'xs'#
- XXL = 'xxl'#
- XXS = 'xxs'#
steamship.data.plugin.index_plugin_instance module#
- class steamship.data.plugin.index_plugin_instance.EmbedderInvocation(*, pluginHandle: str, instanceHandle: str | None = None, config: Dict[str, Any] | None = None, version: str | None = None, fetchIfExists: bool = True)[source]#
Bases:
CamelModel
The parameters capable of creating/fetching an Embedder (Tagger) Plugin Instance.
- class steamship.data.plugin.index_plugin_instance.EmbeddingIndexPluginInstance(*, client: Client = None, id: str = None, handle: str = None, pluginId: str = None, pluginVersionId: str = None, pluginHandle: str | None = None, pluginVersionHandle: str | None = None, workspaceId: str | None = None, userId: str = None, config: Dict[str, Any] = None, hostingType: HostingType | None = None, hostingCpu: HostingCpu | None = None, hostingMemory: HostingMemory | None = None, hostingTimeout: HostingTimeout | None = None, hostingEnvironment: HostingEnvironment | None = None, initStatus: InvocableInitStatus | None = None, embedder: PluginInstance = None, index: EmbeddingIndex = None)[source]#
Bases:
PluginInstance
A persistent, read-optimized index over embeddings.
This is currently implemented as an object which behaves like a PluginInstance even though it isn’t from an implementation perspective on the back-end.
- static create(client: Any, plugin_id: str = None, plugin_handle: str = None, plugin_version_id: str = None, plugin_version_handle: str = None, handle: str = None, fetch_if_exists: bool = True, config: Dict[str, Any] = None) EmbeddingIndexPluginInstance [source]#
Create a class that simulates an embedding index re-implemented as a PluginInstance.
- delete()[source]#
Delete the EmbeddingIndexPluginInstnace.
For now, we will have this correspond to deleting the index but not the embedder. This is likely a temporary design.
- embedder: PluginInstance#
- index: EmbeddingIndex#
- class steamship.data.plugin.index_plugin_instance.SearchResult(*, tag: Tag | None = None, score: float | None = None)[source]#
Bases:
CamelModel
A single scored search result – which is always a tag.
This class is intended to eventually replace the QueryResult object currently used with the Embedding layer.
- static from_query_result(query_result: QueryResult, client: Client) SearchResult [source]#
- class steamship.data.plugin.index_plugin_instance.SearchResults(*, items: List[SearchResult] = None)[source]#
Bases:
CamelModel
Results of a search operation – which is always a list of ranked tag.
This class is intended to eventually replace the QueryResults object currently used with the Embedding layer. TODO: add in paging support.
- static from_query_results(query_results: QueryResults, client: Client) SearchResults [source]#
- items: List[SearchResult]#
steamship.data.plugin.plugin module#
- class steamship.data.plugin.plugin.CreatePluginRequest(*, trainingPlatform: HostingType | None = None, id: str = None, type: str = None, transport: str = None, isPublic: bool = None, handle: str = None, description: str = None, metadata: str = None, fetchIfExists: bool = False)[source]#
Bases:
Request
- training_platform: HostingType | None#
- class steamship.data.plugin.plugin.ListPluginsRequest(*, pageSize: int | None = None, pageToken: str | None = None, sortOrder: SortOrder | None = SortOrder.DESC, type: str | None = None)[source]#
Bases:
ListRequest
- class steamship.data.plugin.plugin.ListPluginsResponse(*, nextPageToken: str | None = None, plugins: List[Plugin])[source]#
Bases:
ListResponse
- class steamship.data.plugin.plugin.Plugin(*, client: Client = None, id: str = None, type: str = None, transport: str = None, isPublic: bool = None, trainingPlatform: HostingType | None = None, handle: str = None, description: str = None, metadata: str = None, profile: Manifest | None = None, readme: str | None = None, userId: str | None = None)[source]#
Bases:
CamelModel
- static create(client: Client, description: str, type_: str, transport: str, is_public: bool, handle: str = None, training_platform: HostingType | None = None, metadata: str | Dict | List = None, fetch_if_exists: bool = False) Plugin [source]#
- delete() Plugin [source]#
Delete this plugin. If this plugin is public and another user has created an instance of it, this method will throw an error and the plugin will not be deleted. Deleting the plugin will delete any versions and instances of it that you have created.
- static list(client: Client, t: str = None, page_size: int | None = None, page_token: str | None = None, sort_order: SortOrder | None = SortOrder.DESC) ListPluginsResponse [source]#
- training_platform: HostingType | None#
- class steamship.data.plugin.plugin.PluginAdapterType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- huggingface = 'huggingface'#
- openai = 'openai'#
- steamship_docker = 'steamshipDocker'#
- steamship_sagemaker = 'steamshipSagemaker'#
- class steamship.data.plugin.plugin.PluginTargetType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- FILE = 'file'#
- WORKSPACE = 'workspace'#
- class steamship.data.plugin.plugin.PluginType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- classifier = 'classifier'#
- embedder = 'embedder'#
- generator = 'generator'#
- parser = 'parser'#
- tagger = 'tagger'#
steamship.data.plugin.plugin_instance module#
- class steamship.data.plugin.plugin_instance.CreatePluginInstanceRequest(*, id: str = None, pluginId: str = None, pluginHandle: str = None, pluginVersionId: str = None, pluginVersionHandle: str = None, handle: str = None, fetchIfExists: bool = None, config: Dict[str, Any] = None)[source]#
Bases:
Request
- class steamship.data.plugin.plugin_instance.PluginInstance(*, client: Client = None, id: str = None, handle: str = None, pluginId: str = None, pluginVersionId: str = None, pluginHandle: str | None = None, pluginVersionHandle: str | None = None, workspaceId: str | None = None, userId: str = None, config: Dict[str, Any] = None, hostingType: HostingType | None = None, hostingCpu: HostingCpu | None = None, hostingMemory: HostingMemory | None = None, hostingTimeout: HostingTimeout | None = None, hostingEnvironment: HostingEnvironment | None = None, initStatus: InvocableInitStatus | None = None)[source]#
Bases:
CamelModel
- static create(client: Client, plugin_id: str = None, plugin_handle: str = None, plugin_version_id: str = None, plugin_version_handle: str = None, handle: str = None, fetch_if_exists: bool = True, config: Dict[str, Any] = None) PluginInstance [source]#
Create a plugin instance
When handle is empty the engine will automatically assign one fetch_if_exists controls whether we want to re-use an existing plugin instance or not.
- delete() PluginInstance [source]#
- generate(input_file_id: str = None, input_file_start_block_index: int = None, input_file_end_block_index: int | None = None, input_file_block_index_list: List[int] | None = None, text: str | None = None, block_query: str | None = None, append_output_to_file: bool = False, output_file_id: str | None = None, make_output_public: bool | None = None, options: dict | None = None, streaming: bool | None = None, tags: List[Tag] | None = None) Task[GenerateResponse] [source]#
See GenerateRequest for description of parameter options
- static get(client: Client, handle: str) PluginInstance [source]#
- get_training_parameters(training_request: TrainingParameterPluginInput) TrainingParameterPluginOutput [source]#
- hosting_cpu: HostingCpu | None#
- hosting_environment: HostingEnvironment | None#
- hosting_memory: HostingMemory | None#
- hosting_timeout: HostingTimeout | None#
- hosting_type: HostingType | None#
- init_status: InvocableInitStatus | None#
- train(training_request: TrainingParameterPluginInput = None, training_epochs: int | None = None, export_query: str | None = None, testing_holdout_percent: float | None = None, test_split_seed: int | None = None, training_params: Dict | None = None, inference_params: Dict | None = None) Task[TrainPluginOutput] [source]#
Train a plugin instance. Please provide either training_request OR the other parameters; passing training_request ignores all other parameters, but is kept for backwards compatibility.
steamship.data.plugin.plugin_version module#
- class steamship.data.plugin.plugin_version.CreatePluginVersionRequest(*, pluginId: str = None, handle: str = None, hostingMemory: HostingMemory | None = None, hostingTimeout: HostingTimeout | None = None, hostingHandler: str = None, isPublic: bool = None, isDefault: bool = None, type: str = 'file', configTemplate: str = None, streaming: bool | None = None)[source]#
Bases:
Request
- hosting_memory: HostingMemory | None#
- hosting_timeout: HostingTimeout | None#
- class steamship.data.plugin.plugin_version.ListPluginVersionsRequest(*, handle: str, pluginId: str)[source]#
Bases:
Request
- class steamship.data.plugin.plugin_version.ListPluginVersionsResponse(*, plugins: List[PluginVersion])[source]#
Bases:
Response
- plugins: List[PluginVersion]#
- class steamship.data.plugin.plugin_version.PluginVersion(*, client: Client = None, id: str = None, pluginId: str = None, handle: str = None, hostingMemory: HostingMemory | None = None, hostingTimeout: HostingTimeout | None = None, hostingHandler: str = None, isPublic: bool = None, isDefault: bool = None, configTemplate: Dict[str, Any] = None)[source]#
Bases:
CamelModel
- static create(client: Client, handle: str, plugin_id: str | None = None, filename: str | None = None, filebytes: bytes | None = None, hosting_memory: HostingMemory | None = None, hosting_timeout: HostingTimeout | None = None, hosting_handler: str | None = None, is_public: bool | None = None, is_default: bool | None = None, config_template: Dict[str, Any] | None = None, streaming: bool | None = None) PluginVersion [source]#
- delete() PluginVersion [source]#
Delete this plugin version. If this plugin is public and another user has created an instance of this version, this method will throw an error and the PluginVersion will not be deleted. Deleting the PluginVersion will delete any instances of it that you have created.
- hosting_memory: HostingMemory | None#
- hosting_timeout: HostingTimeout | None#
steamship.data.plugin.prompt_generation_plugin_instance module#
- class steamship.data.plugin.prompt_generation_plugin_instance.PromptGenerationPluginInstance(*, client: Client = None, id: str = None, handle: str = None, pluginId: str = None, pluginVersionId: str = None, pluginHandle: str | None = None, pluginVersionHandle: str | None = None, workspaceId: str | None = None, userId: str = None, config: Dict[str, Any] = None, hostingType: HostingType | None = None, hostingCpu: HostingCpu | None = None, hostingMemory: HostingMemory | None = None, hostingTimeout: HostingTimeout | None = None, hostingEnvironment: HostingEnvironment | None = None, initStatus: InvocableInitStatus | None = None)[source]#
Bases:
PluginInstance
An instance of a configured prompt completion service such as GPT-3.
The generate method synchronously invokes the prompt against a set of variables that parameterize it. The return value is a single string.
- Example Usage:
llm = Steamship.use(‘prompt-generation-default’, config={ “temperature”: 0.9 }) PROMPT = “Greet {name} as if he were a {relation}.” greeting = llm.generate(PROMPT, {“name”: “Ted”, “relation”: “old friend”})
- static create(client: Client, plugin_id: str = None, plugin_handle: str = None, plugin_version_id: str = None, plugin_version_handle: str = None, handle: str = None, fetch_if_exists: bool = True, config: Dict[str, Any] = None) PromptGenerationPluginInstance [source]#
Create a plugin instance
When handle is empty the engine will automatically assign one fetch_if_exists controls whether we want to re-use an existing plugin instance or not.
Module contents#
- class steamship.data.plugin.HostingCpu(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The amount of CPU required for deployment.
This is mapped to a value dependent on the HostingType it is combined with.
- LG = 'lg'#
- MAX = 'max'#
- MD = 'md'#
- MIN = 'min'#
- SM = 'sm'#
- XL = 'xl'#
- XS = 'xs'#
- XXL = 'xxl'#
- XXS = 'xxs'#
- class steamship.data.plugin.HostingEnvironment(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The software environment required for deployment.
- PYTHON38 = 'python38'#
- STEAMSHIP_PYTORCH_CPU = 'inferenceCpu'#
- class steamship.data.plugin.HostingMemory(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The amount of memory required for deployment.
This is mapped to a value dependent on the HostingType it is combined with.
- LG = 'lg'#
- MAX = 'max'#
- MD = 'md'#
- MIN = 'min'#
- SM = 'sm'#
- XL = 'xl'#
- XS = 'xs'#
- XXL = 'xxl'#
- XXS = 'xxs'#
- class steamship.data.plugin.HostingTimeout(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The request timeout required for deployment.
This is mapped to a value dependent on the HostingType it is combined with.
- LG = 'lg'#
- MAX = 'max'#
- MD = 'md'#
- MIN = 'min'#
- SM = 'sm'#
- XL = 'xl'#
- XS = 'xs'#
- XXL = 'xxl'#
- XXS = 'xxs'#
- class steamship.data.plugin.HostingType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The type of hosting provider to deploy to.
- ECS = 'ecs'#
- LAMBDA = 'lambda'#
- class steamship.data.plugin.Plugin(*, client: Client = None, id: str = None, type: str = None, transport: str = None, isPublic: bool = None, trainingPlatform: HostingType | None = None, handle: str = None, description: str = None, metadata: str = None, profile: Manifest | None = None, readme: str | None = None, userId: str | None = None)[source]#
Bases:
CamelModel
- static create(client: Client, description: str, type_: str, transport: str, is_public: bool, handle: str = None, training_platform: HostingType | None = None, metadata: str | Dict | List = None, fetch_if_exists: bool = False) Plugin [source]#
- delete() Plugin [source]#
Delete this plugin. If this plugin is public and another user has created an instance of it, this method will throw an error and the plugin will not be deleted. Deleting the plugin will delete any versions and instances of it that you have created.
- static list(client: Client, t: str = None, page_size: int | None = None, page_token: str | None = None, sort_order: SortOrder | None = SortOrder.DESC) ListPluginsResponse [source]#
- training_platform: HostingType | None#
- class steamship.data.plugin.PluginAdapterType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- huggingface = 'huggingface'#
- openai = 'openai'#
- steamship_docker = 'steamshipDocker'#
- steamship_sagemaker = 'steamshipSagemaker'#
- class steamship.data.plugin.PluginInstance(*, client: Client = None, id: str = None, handle: str = None, pluginId: str = None, pluginVersionId: str = None, pluginHandle: str | None = None, pluginVersionHandle: str | None = None, workspaceId: str | None = None, userId: str = None, config: Dict[str, Any] = None, hostingType: HostingType | None = None, hostingCpu: HostingCpu | None = None, hostingMemory: HostingMemory | None = None, hostingTimeout: HostingTimeout | None = None, hostingEnvironment: HostingEnvironment | None = None, initStatus: InvocableInitStatus | None = None)[source]#
Bases:
CamelModel
- static create(client: Client, plugin_id: str = None, plugin_handle: str = None, plugin_version_id: str = None, plugin_version_handle: str = None, handle: str = None, fetch_if_exists: bool = True, config: Dict[str, Any] = None) PluginInstance [source]#
Create a plugin instance
When handle is empty the engine will automatically assign one fetch_if_exists controls whether we want to re-use an existing plugin instance or not.
- delete() PluginInstance [source]#
- generate(input_file_id: str = None, input_file_start_block_index: int = None, input_file_end_block_index: int | None = None, input_file_block_index_list: List[int] | None = None, text: str | None = None, block_query: str | None = None, append_output_to_file: bool = False, output_file_id: str | None = None, make_output_public: bool | None = None, options: dict | None = None, streaming: bool | None = None, tags: List[Tag] | None = None) Task[GenerateResponse] [source]#
See GenerateRequest for description of parameter options
- static get(client: Client, handle: str) PluginInstance [source]#
- get_training_parameters(training_request: TrainingParameterPluginInput) TrainingParameterPluginOutput [source]#
- hosting_cpu: HostingCpu | None#
- hosting_environment: HostingEnvironment | None#
- hosting_memory: HostingMemory | None#
- hosting_timeout: HostingTimeout | None#
- hosting_type: HostingType | None#
- init_status: InvocableInitStatus | None#
- train(training_request: TrainingParameterPluginInput = None, training_epochs: int | None = None, export_query: str | None = None, testing_holdout_percent: float | None = None, test_split_seed: int | None = None, training_params: Dict | None = None, inference_params: Dict | None = None) Task[TrainPluginOutput] [source]#
Train a plugin instance. Please provide either training_request OR the other parameters; passing training_request ignores all other parameters, but is kept for backwards compatibility.
- class steamship.data.plugin.PluginTargetType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- FILE = 'file'#
- WORKSPACE = 'workspace'#
- class steamship.data.plugin.PluginType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- classifier = 'classifier'#
- embedder = 'embedder'#
- generator = 'generator'#
- parser = 'parser'#
- tagger = 'tagger'#
- class steamship.data.plugin.PluginVersion(*, client: Client = None, id: str = None, pluginId: str = None, handle: str = None, hostingMemory: HostingMemory | None = None, hostingTimeout: HostingTimeout | None = None, hostingHandler: str = None, isPublic: bool = None, isDefault: bool = None, configTemplate: Dict[str, Any] = None)[source]#
Bases:
CamelModel
- static create(client: Client, handle: str, plugin_id: str | None = None, filename: str | None = None, filebytes: bytes | None = None, hosting_memory: HostingMemory | None = None, hosting_timeout: HostingTimeout | None = None, hosting_handler: str | None = None, is_public: bool | None = None, is_default: bool | None = None, config_template: Dict[str, Any] | None = None, streaming: bool | None = None) PluginVersion [source]#
- delete() PluginVersion [source]#
Delete this plugin version. If this plugin is public and another user has created an instance of this version, this method will throw an error and the PluginVersion will not be deleted. Deleting the PluginVersion will delete any instances of it that you have created.
- hosting_memory: HostingMemory | None#
- hosting_timeout: HostingTimeout | None#