steamship.data package#
Subpackages#
- steamship.data.operations package
- Submodules
- steamship.data.operations.blockifier module
- steamship.data.operations.embedder module
- steamship.data.operations.generator module
GenerateRequest
GenerateRequest.append_output_to_file
GenerateRequest.block_query
GenerateRequest.input_file_block_index_list
GenerateRequest.input_file_end_block_index
GenerateRequest.input_file_id
GenerateRequest.input_file_start_block_index
GenerateRequest.make_output_public
GenerateRequest.options
GenerateRequest.output_file_id
GenerateRequest.plugin_instance
GenerateRequest.streaming
GenerateRequest.tags
GenerateRequest.text
GenerateResponse
- steamship.data.operations.tagger module
- Module contents
- steamship.data.package package
- Submodules
- steamship.data.package.package module
- steamship.data.package.package_instance module
CreatePackageInstanceRequest
CreatePackageInstanceRequest.config
CreatePackageInstanceRequest.fetch_if_exists
CreatePackageInstanceRequest.handle
CreatePackageInstanceRequest.id
CreatePackageInstanceRequest.local_development_url
CreatePackageInstanceRequest.package_handle
CreatePackageInstanceRequest.package_id
CreatePackageInstanceRequest.package_version_handle
CreatePackageInstanceRequest.package_version_id
CreatePackageInstanceRequest.workspace_id
ListPackageInstancesRequest
ListPackageInstancesResponse
PackageInstance
PackageInstance.blocks_from_invoke()
PackageInstance.client
PackageInstance.config
PackageInstance.create()
PackageInstance.create_local_development_instance()
PackageInstance.created_at
PackageInstance.delete()
PackageInstance.full_url_for()
PackageInstance.get()
PackageInstance.handle
PackageInstance.id
PackageInstance.init_status
PackageInstance.invocation_url
PackageInstance.invoke()
PackageInstance.list()
PackageInstance.load_missing_workspace_handle()
PackageInstance.package_handle
PackageInstance.package_id
PackageInstance.package_version_handle
PackageInstance.package_version_id
PackageInstance.parse_obj()
PackageInstance.refresh_init_status()
PackageInstance.task_from_invoke()
PackageInstance.user_handle
PackageInstance.user_id
PackageInstance.wait_for_init()
PackageInstance.workspace_handle
PackageInstance.workspace_id
- steamship.data.package.package_version module
- Module contents
Package
PackageInstance
PackageInstance.blocks_from_invoke()
PackageInstance.client
PackageInstance.config
PackageInstance.create()
PackageInstance.create_local_development_instance()
PackageInstance.created_at
PackageInstance.delete()
PackageInstance.full_url_for()
PackageInstance.get()
PackageInstance.handle
PackageInstance.id
PackageInstance.init_status
PackageInstance.invocation_url
PackageInstance.invoke()
PackageInstance.list()
PackageInstance.load_missing_workspace_handle()
PackageInstance.package_handle
PackageInstance.package_id
PackageInstance.package_version_handle
PackageInstance.package_version_id
PackageInstance.parse_obj()
PackageInstance.refresh_init_status()
PackageInstance.task_from_invoke()
PackageInstance.user_handle
PackageInstance.user_id
PackageInstance.wait_for_init()
PackageInstance.workspace_handle
PackageInstance.workspace_id
PackageVersion
- steamship.data.plugin package
- Submodules
- steamship.data.plugin.hosting module
- steamship.data.plugin.index_plugin_instance module
- steamship.data.plugin.plugin module
- steamship.data.plugin.plugin_instance module
CreatePluginInstanceRequest
CreatePluginInstanceRequest.config
CreatePluginInstanceRequest.fetch_if_exists
CreatePluginInstanceRequest.handle
CreatePluginInstanceRequest.id
CreatePluginInstanceRequest.plugin_handle
CreatePluginInstanceRequest.plugin_id
CreatePluginInstanceRequest.plugin_version_handle
CreatePluginInstanceRequest.plugin_version_id
PluginInstance
PluginInstance.client
PluginInstance.config
PluginInstance.create()
PluginInstance.delete()
PluginInstance.generate()
PluginInstance.get()
PluginInstance.get_training_parameters()
PluginInstance.handle
PluginInstance.hosting_cpu
PluginInstance.hosting_environment
PluginInstance.hosting_memory
PluginInstance.hosting_timeout
PluginInstance.hosting_type
PluginInstance.id
PluginInstance.init_status
PluginInstance.parse_obj()
PluginInstance.plugin_handle
PluginInstance.plugin_id
PluginInstance.plugin_version_handle
PluginInstance.plugin_version_id
PluginInstance.refresh_init_status()
PluginInstance.tag()
PluginInstance.train()
PluginInstance.user_id
PluginInstance.wait_for_init()
PluginInstance.workspace_id
- steamship.data.plugin.plugin_version module
CreatePluginVersionRequest
CreatePluginVersionRequest.config_template
CreatePluginVersionRequest.handle
CreatePluginVersionRequest.hosting_handler
CreatePluginVersionRequest.hosting_memory
CreatePluginVersionRequest.hosting_timeout
CreatePluginVersionRequest.is_default
CreatePluginVersionRequest.is_public
CreatePluginVersionRequest.plugin_id
CreatePluginVersionRequest.streaming
CreatePluginVersionRequest.type
ListPluginVersionsRequest
ListPluginVersionsResponse
PluginVersion
PluginVersion.client
PluginVersion.config_template
PluginVersion.create()
PluginVersion.delete()
PluginVersion.handle
PluginVersion.hosting_handler
PluginVersion.hosting_memory
PluginVersion.hosting_timeout
PluginVersion.id
PluginVersion.is_default
PluginVersion.is_public
PluginVersion.list()
PluginVersion.parse_obj()
PluginVersion.plugin_id
- steamship.data.plugin.prompt_generation_plugin_instance module
- Module contents
HostingCpu
HostingEnvironment
HostingMemory
HostingTimeout
HostingType
Plugin
PluginAdapterType
PluginInstance
PluginInstance.client
PluginInstance.config
PluginInstance.create()
PluginInstance.delete()
PluginInstance.generate()
PluginInstance.get()
PluginInstance.get_training_parameters()
PluginInstance.handle
PluginInstance.hosting_cpu
PluginInstance.hosting_environment
PluginInstance.hosting_memory
PluginInstance.hosting_timeout
PluginInstance.hosting_type
PluginInstance.id
PluginInstance.init_status
PluginInstance.parse_obj()
PluginInstance.plugin_handle
PluginInstance.plugin_id
PluginInstance.plugin_version_handle
PluginInstance.plugin_version_id
PluginInstance.refresh_init_status()
PluginInstance.tag()
PluginInstance.train()
PluginInstance.user_id
PluginInstance.wait_for_init()
PluginInstance.workspace_id
PluginTargetType
PluginType
PluginVersion
PluginVersion.client
PluginVersion.config_template
PluginVersion.create()
PluginVersion.delete()
PluginVersion.handle
PluginVersion.hosting_handler
PluginVersion.hosting_memory
PluginVersion.hosting_timeout
PluginVersion.id
PluginVersion.is_default
PluginVersion.is_public
PluginVersion.list()
PluginVersion.parse_obj()
PluginVersion.plugin_id
- steamship.data.tags package
- Submodules
- steamship.data.tags.tag module
- steamship.data.tags.tag_constants module
ChatTag
DocTag
DocTag.ARTICLE
DocTag.BLOCK_CODE
DocTag.BLOCK_QUOTE
DocTag.CAPTION
DocTag.CHAPTER
DocTag.CHAT
DocTag.DIV
DocTag.DOCUMENT
DocTag.EMPHASIZED
DocTag.FOOTER
DocTag.H1
DocTag.H2
DocTag.H3
DocTag.H4
DocTag.H5
DocTag.HEADER
DocTag.IMAGE
DocTag.LINE
DocTag.LINK
DocTag.LIST_ITEM
DocTag.MAIN
DocTag.METADATA
DocTag.ORDERED_LIST
DocTag.PAGE
DocTag.PARAGRAPH
DocTag.PRE
DocTag.REGION
DocTag.SENTENCE
DocTag.SOURCE
DocTag.SPAN
DocTag.STRONG
DocTag.SUBTITLE
DocTag.TELETYPE
DocTag.TEXT
DocTag.TITLE
DocTag.TOKEN
DocTag.UNDERLINED
DocTag.UNKNOWN
DocTag.UNORDERED_LIST
DocTag.from_html_tag()
GenerationTag
ProvenanceTag
RoleTag
TagKind
TagKind.AGENT_STATUS_MESSAGE
TagKind.CHAT
TagKind.CHAT_HISTORY_CONTEXT
TagKind.DEPENDENCY
TagKind.DOCUMENT
TagKind.EMBEDDING
TagKind.EMOTION
TagKind.ENTITY
TagKind.FUNCTION_ARG
TagKind.FUNCTION_SELECTION
TagKind.GENERATION
TagKind.INTENT
TagKind.KIND
TagKind.LLM_STATUS_MESSAGE
TagKind.MESSAGE_ID
TagKind.PART_OF_SPEECH
TagKind.PROVENANCE
TagKind.ROLE
TagKind.SEARCH_RESULT
TagKind.SENTIMENT
TagKind.STATUS_MESSAGE
TagKind.SUMMARY
TagKind.TIMESTAMP
TagKind.TOKEN
TagKind.TOKENIZATION
TagKind.TOOL_STATUS_MESSAGE
TagKind.TOPIC
TagValueKey
TokenTag
TokenTag.ENTITY_IOB
TokenTag.ENTITY_TYPE
TokenTag.HEAD
TokenTag.IS_ALPHA
TokenTag.IS_ASCII
TokenTag.IS_BRACKET
TokenTag.IS_CURRENCY
TokenTag.IS_DIGIT
TokenTag.IS_LEFT_PUNCT
TokenTag.IS_OUT_OF_VOCABULARY
TokenTag.IS_PUNCT
TokenTag.IS_QUOTE
TokenTag.IS_RIGHT_PUNCT
TokenTag.IS_SPACE
TokenTag.IS_STOPWORD
TokenTag.IS_TITLE
TokenTag.LANGUAGE
TokenTag.LEFT_EDGE
TokenTag.LEMMA
TokenTag.LIKE_EMAIL
TokenTag.LIKE_NUM
TokenTag.LIKE_URL
TokenTag.NORMALIZED
TokenTag.PREFIX
TokenTag.RIGHT_EDGE
TokenTag.SHAPE
TokenTag.SUFFIX
TokenTag.TEXT
TokenTag.TEXT_WITH_WHITESPACE
TokenTag.WHITESPACE
- steamship.data.tags.tag_utils module
- Module contents
DocTag
DocTag.ARTICLE
DocTag.BLOCK_CODE
DocTag.BLOCK_QUOTE
DocTag.CAPTION
DocTag.CHAPTER
DocTag.CHAT
DocTag.DIV
DocTag.DOCUMENT
DocTag.EMPHASIZED
DocTag.FOOTER
DocTag.H1
DocTag.H2
DocTag.H3
DocTag.H4
DocTag.H5
DocTag.HEADER
DocTag.IMAGE
DocTag.LINE
DocTag.LINK
DocTag.LIST_ITEM
DocTag.MAIN
DocTag.METADATA
DocTag.ORDERED_LIST
DocTag.PAGE
DocTag.PARAGRAPH
DocTag.PRE
DocTag.REGION
DocTag.SENTENCE
DocTag.SOURCE
DocTag.SPAN
DocTag.STRONG
DocTag.SUBTITLE
DocTag.TELETYPE
DocTag.TEXT
DocTag.TITLE
DocTag.TOKEN
DocTag.UNDERLINED
DocTag.UNKNOWN
DocTag.UNORDERED_LIST
DocTag.from_html_tag()
GenerationTag
Tag
TagKind
TagKind.AGENT_STATUS_MESSAGE
TagKind.CHAT
TagKind.CHAT_HISTORY_CONTEXT
TagKind.DEPENDENCY
TagKind.DOCUMENT
TagKind.EMBEDDING
TagKind.EMOTION
TagKind.ENTITY
TagKind.FUNCTION_ARG
TagKind.FUNCTION_SELECTION
TagKind.GENERATION
TagKind.INTENT
TagKind.KIND
TagKind.LLM_STATUS_MESSAGE
TagKind.MESSAGE_ID
TagKind.PART_OF_SPEECH
TagKind.PROVENANCE
TagKind.ROLE
TagKind.SEARCH_RESULT
TagKind.SENTIMENT
TagKind.STATUS_MESSAGE
TagKind.SUMMARY
TagKind.TIMESTAMP
TagKind.TOKEN
TagKind.TOKENIZATION
TagKind.TOOL_STATUS_MESSAGE
TagKind.TOPIC
TagValueKey
TokenTag
TokenTag.ENTITY_IOB
TokenTag.ENTITY_TYPE
TokenTag.HEAD
TokenTag.IS_ALPHA
TokenTag.IS_ASCII
TokenTag.IS_BRACKET
TokenTag.IS_CURRENCY
TokenTag.IS_DIGIT
TokenTag.IS_LEFT_PUNCT
TokenTag.IS_OUT_OF_VOCABULARY
TokenTag.IS_PUNCT
TokenTag.IS_QUOTE
TokenTag.IS_RIGHT_PUNCT
TokenTag.IS_SPACE
TokenTag.IS_STOPWORD
TokenTag.IS_TITLE
TokenTag.LANGUAGE
TokenTag.LEFT_EDGE
TokenTag.LEMMA
TokenTag.LIKE_EMAIL
TokenTag.LIKE_NUM
TokenTag.LIKE_URL
TokenTag.NORMALIZED
TokenTag.PREFIX
TokenTag.RIGHT_EDGE
TokenTag.SHAPE
TokenTag.SUFFIX
TokenTag.TEXT
TokenTag.TEXT_WITH_WHITESPACE
TokenTag.WHITESPACE
Submodules#
steamship.data.block module#
- class steamship.data.block.Block(*, client: Client = None, id: str = None, fileId: str = None, text: str = None, tags: List[Tag] | None = [], index: int | None = None, mimeType: MimeTypes | None = None, publicData: bool = False, streamState: StreamState | None = None, requestId: str | None = None, url: str | None = None, contentURL: str | None = None, uploadType: BlockUploadType | None = None, uploadBytes: bytes | None = None)[source]#
Bases:
CamelModel
A Block is a chunk of content within a File. It can be plain text content, image content, video content, etc. If the content is not text, the text value may be the empty string for backwards compatibility.
- static create(client: Client, file_id: str, text: str = None, tags: List[Tag] = None, content: str | bytes = None, url: str | None = None, mime_type: MimeTypes | None = None, public_data: bool = False, streaming: bool | None = None) Block [source]#
Create a new Block within a File specified by file_id.
You can create a Block in several ways: - Providing raw text as the text parameter; - Providing the content of the block as string or bytes; - Providing a publicly accessible URL where the content is stored.
- static query(client: Client, tag_filter_query: str) BlockQueryResponse [source]#
- property raw_data_url: str | None#
Return a URL at which the data content of this Block can be accessed. If public_data is True, this content can be accessed without an API key.
- set_public_data(public_data: bool)[source]#
Set the public_data flag on this Block. If this object already exists server-side, update the flag.
- stream_state: StreamState | None#
- upload_type: BlockUploadType | None#
- class steamship.data.block.BlockUploadType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- BLOCKS = 'blocks'#
- FILE = 'file'#
- NONE = 'none'#
- URL = 'url'#
steamship.data.embeddings module#
- class steamship.data.embeddings.EmbedAndSearchRequest(*, query: str, docs: List[str], pluginInstance: str, k: int = 1)[source]#
Bases:
Request
- class steamship.data.embeddings.EmbeddedItem(*, id: str = None, indexId: str = None, fileId: str = None, blockId: str = None, tagId: str = None, value: str = None, externalId: str = None, externalType: str = None, metadata: Any = None, embedding: List[float] = None)[source]#
Bases:
CamelModel
- clone_for_insert() EmbeddedItem [source]#
Produces a clone with a string representation of the metadata
- class steamship.data.embeddings.EmbeddingIndex(*, client: Client = None, id: str = None, handle: str = None, name: str = None, plugin: str = None, externalId: str = None, externalType: str = None, metadata: str = None)[source]#
Bases:
CamelModel
A persistent, read-optimized index over embeddings.
- static create(client: Client, handle: str = None, name: str = None, embedder_plugin_instance_handle: str = None, fetch_if_exists: bool = True, external_id: str = None, external_type: str = None, metadata: Any = None) EmbeddingIndex [source]#
- delete() EmbeddingIndex [source]#
- embed() Task[IndexEmbedResponse] [source]#
- insert(value: str, external_id: str = None, external_type: str = None, metadata: int | float | bool | str | List | Dict = None, reindex: bool = True, allow_long_records=False) IndexInsertResponse [source]#
- insert_file(file_id: str, block_type: str = None, external_id: str = None, external_type: str = None, metadata: int | float | bool | str | List | Dict = None, reindex: bool = True) IndexInsertResponse [source]#
- insert_many(items: List[EmbeddedItem | str], reindex: bool = True, allow_long_records=False) IndexInsertResponse [source]#
- class steamship.data.embeddings.IndexCreateRequest(*, handle: str = None, name: str = None, pluginInstance: str = None, fetchIfExists: bool = True, externalId: str = None, externalType: str = None, metadata: Any = None)[source]#
Bases:
Request
- class steamship.data.embeddings.IndexEmbedResponse(*, id: str | None = None)[source]#
Bases:
Response
- class steamship.data.embeddings.IndexInsertRequest(*, indexId: str, items: List[EmbeddedItem] = None, value: str = None, fileId: str = None, blockType: str = None, externalId: str = None, externalType: str = None, metadata: Any = None, reindex: bool = True)[source]#
Bases:
Request
- items: List[EmbeddedItem]#
- class steamship.data.embeddings.IndexInsertResponse(*, itemIds: List[IndexItemId] = None)[source]#
Bases:
Response
- item_ids: List[IndexItemId]#
- class steamship.data.embeddings.IndexItemId(*, indexId: str = None, id: str = None)[source]#
Bases:
CamelModel
- class steamship.data.embeddings.IndexSearchRequest(*, id: str, query: str = None, queries: List[str] = None, k: int = 1, includeMetadata: bool = False)[source]#
Bases:
Request
- class steamship.data.embeddings.ListItemsRequest(*, pageSize: int | None = None, pageToken: str | None = None, sortOrder: SortOrder | None = SortOrder.DESC, id: str = None, fileId: str = None, blockId: str = None, spanId: str = None)[source]#
Bases:
ListRequest
- class steamship.data.embeddings.ListItemsResponse(*, nextPageToken: str | None = None, items: List[EmbeddedItem])[source]#
Bases:
ListResponse
- items: List[EmbeddedItem]#
- class steamship.data.embeddings.QueryResult(*, value: Hit | None = None, score: float | None = None, index: int | None = None, id: str | None = None)[source]#
Bases:
CamelModel
- class steamship.data.embeddings.QueryResults(*, items: List[QueryResult] = None)[source]#
Bases:
Request
- items: List[QueryResult]#
steamship.data.file module#
- class steamship.data.file.File(*, client: Client = None, id: str = None, handle: str = None, mimeType: MimeTypes = None, workspaceId: str = None, blocks: List[Block] = [], tags: List[Tag] = [], filename: str = None, publicData: bool = False)[source]#
Bases:
CamelModel
A file.
- class CreateResponse(data: Any = None, string: str = None, _bytes: bytes | io.BytesIO = None, json: io.BytesIO = None, mime_type: str = None)[source]#
Bases:
Response
- append_block(text: str = None, tags: List[Tag] = None, content: str | bytes = None, url: str | None = None, mime_type: MimeTypes | None = None, public_data: bool = False) Block [source]#
Append a new block to this File. This is a convenience wrapper around Block.create(). You should provide only one of text, content, or url.
This is a server-side operation, saving the new Block to the file. The new block is appended to this client-side File as well for convenience.
- static create(client: Client, content: str | bytes = None, mime_type: MimeTypes = None, handle: str = None, blocks: List[Block] = None, tags: List[Tag] = None, public_data: bool = False) File [source]#
- static create_with_plugin(client: Client, plugin_instance: str, url: str = None, mime_type: str = None) Task[File] [source]#
- static from_local(client: Client, file_path: str, mime_type: MimeTypes = None, handle: str = None, tags: List[Tag] = None, public_data: bool = False) Any [source]#
Loads a local file into a Steamship File.
NOTE: the file_path should be relative to where the call to from_local is happening.
Loaded files will automatically be tagged with a provenance tag.
- Parameters:
client – Steamship client for the workspace
file_path – Location of the file to upload relative to the current directory of the client
mime_type – Optional specification of a particular mime type. If not provided, a guess will be made.
handle – Intended handle (for lookups, etc.) for Steamship File
tags – Metadata to add to the Steamship File
public_data – Whether to make the Steamship File publicly-accessible
- generate(plugin_instance_handle: str, start_block_index: int = None, end_block_index: int | None = None, block_index_list: List[int] | None = None, append_output_to_file: bool = True, options: dict | None = None, wait_on_tasks: List[Task] = None, make_output_public: bool = False, streaming: bool | None = False) Task[GenerateResponse] [source]#
Generate new content from this file. Assumes this file as context for input and output. May specify start and end blocks.
- import_with_plugin(plugin_instance: str, url: str = None, mime_type: str = None) Task[File] [source]#
Run an import operation on an (empty) file object that has already been created.
- index(plugin_instance: Any = None) EmbeddingIndex [source]#
Index every block in the file.
TODO(ted): Enable indexing the results of a tag query. TODO(ted): It’s hard to load the EmbeddingIndexPluginInstance with just a handle because of the chain of things that need to be created to it to function.
- static list(client: Client, page_size: int | None = None, page_token: str | None = None, sort_order: SortOrder | None = SortOrder.DESC) ListFileResponse [source]#
- static query(client: Client, tag_filter_query: str) FileQueryResponse [source]#
- property raw_data_url: str | None#
Return a URL at which the data content of this File can be accessed. If public_data is True, this content can be accessed without an API key.
- class steamship.data.file.FileUploadType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- BLOCKS = 'blocks'#
- FILE = 'file'#
- FILE_IMPORTER = 'fileImporter'#
- NONE = 'none'#
steamship.data.invocable_init_status module#
steamship.data.manifest module#
- class steamship.data.manifest.ConfigParameter(*, type: ConfigParameterType, description: str | None = None, default: StrictStr | StrictBool | StrictFloat | StrictInt | None = None)[source]#
Bases:
BaseModel
- type: ConfigParameterType#
- class steamship.data.manifest.ConfigParameterType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- BOOLEAN = 'boolean'#
- NUMBER = 'number'#
- STRING = 'string'#
- class steamship.data.manifest.DeployableType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- PACKAGE = 'package'#
- PLUGIN = 'plugin'#
- class steamship.data.manifest.Manifest(*, type: DeployableType, handle: str, version: str, description: str | None = None, author: str | None = None, entrypoint: str = 'Unused', public: bool, plugin: PluginConfig | None = None, build_config: Dict[str, List[str]] = {'ignore': []}, configTemplate: Dict[str, ConfigParameter] | None = None, steamshipRegistry: SteamshipRegistry)[source]#
Bases:
BaseModel
- configTemplate: Dict[str, ConfigParameter] | None#
- plugin: PluginConfig | None#
- steamshipRegistry: SteamshipRegistry#
- type: DeployableType#
- class steamship.data.manifest.PluginConfig(*, isTrainable: bool | None = False, transport: str = 'jsonOverHttp', type: str, streaming: bool = False)[source]#
Bases:
BaseModel
- class steamship.data.manifest.SteamshipRegistry(*, tagline: str | None = None, tagline2: str | None = None, usefulFor: str | None = None, videoUrl: str | None = None, githubUrl: str | None = None, demoUrl: str | None = None, blogUrl: str | None = None, jupyterUrl: str | None = None, authorGithub: str | None = None, authorName: str | None = None, authorEmail: str | None = None, authorTwitter: str | None = None, authorUrl: str | None = None, tags: List[str])[source]#
Bases:
BaseModel
steamship.data.search module#
steamship.data.user module#
steamship.data.workspace module#
- class steamship.data.workspace.ListWorkspacesRequest(*, pageSize: int | None = None, pageToken: str | None = None, sortOrder: SortOrder | None = SortOrder.DESC)[source]#
Bases:
ListRequest
- class steamship.data.workspace.ListWorkspacesResponse(*, nextPageToken: str | None = None, workspaces: List[Workspace])[source]#
Bases:
ListResponse
- class steamship.data.workspace.SignedUrl[source]#
Bases:
object
- class Bucket(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- APP_DATA = 'appData'#
- EXPORTS = 'exports'#
- IMPORTS = 'imports'#
- PLUGIN_DATA = 'pluginData'#
- USER_DATA = 'userData'#
- class Operation(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- READ = 'Read'#
- WRITE = 'Write'#
- class Request(*, bucket: SignedUrl.Bucket, filepath: str, operation: SignedUrl.Operation, expiresInMinutes: int = None)[source]#
Bases:
Request
- class steamship.data.workspace.Workspace(*, client: Client = None, id: str = None, handle: str = None)[source]#
Bases:
CamelModel
- class CreateRequest(*, id: str | None = None, handle: str | None = None, fetchIfExists: bool | None = None, externalId: str | None = None, externalType: str | None = None, metadata: str | None = None)[source]#
Bases:
Request
- static create(client: Client, handle: str | None = None, external_id: str | None = None, external_type: str | None = None, metadata: Any = None, fetch_if_exists: bool = True) Workspace [source]#
- static get(client: Client, id_: str = None, handle: str = None, fetch_if_exists: bool = None) Workspace [source]#
Module contents#
- class steamship.data.Block(*, client: Client = None, id: str = None, fileId: str = None, text: str = None, tags: List[Tag] | None = [], index: int | None = None, mimeType: MimeTypes | None = None, publicData: bool = False, streamState: StreamState | None = None, requestId: str | None = None, url: str | None = None, contentURL: str | None = None, uploadType: BlockUploadType | None = None, uploadBytes: bytes | None = None)[source]#
Bases:
CamelModel
A Block is a chunk of content within a File. It can be plain text content, image content, video content, etc. If the content is not text, the text value may be the empty string for backwards compatibility.
- static create(client: Client, file_id: str, text: str = None, tags: List[Tag] = None, content: str | bytes = None, url: str | None = None, mime_type: MimeTypes | None = None, public_data: bool = False, streaming: bool | None = None) Block [source]#
Create a new Block within a File specified by file_id.
You can create a Block in several ways: - Providing raw text as the text parameter; - Providing the content of the block as string or bytes; - Providing a publicly accessible URL where the content is stored.
- static query(client: Client, tag_filter_query: str) BlockQueryResponse [source]#
- property raw_data_url: str | None#
Return a URL at which the data content of this Block can be accessed. If public_data is True, this content can be accessed without an API key.
- set_public_data(public_data: bool)[source]#
Set the public_data flag on this Block. If this object already exists server-side, update the flag.
- stream_state: StreamState | None#
- upload_type: BlockUploadType | None#
- class steamship.data.DocTag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
A set of name constants for Tags with a kind of TagKind.doc; appropriate for HTML and Markdown ideas.
- ARTICLE = 'article'#
- BLOCK_CODE = 'block-code'#
- BLOCK_QUOTE = 'block-quote'#
- CAPTION = 'caption'#
- CHAPTER = 'chapter'#
- CHAT = 'chat'#
- DIV = 'div'#
- DOCUMENT = 'document'#
- EMPHASIZED = 'emphasized'#
- FOOTER = 'footer'#
- H1 = 'h1'#
- H2 = 'h2'#
- H3 = 'h3'#
- H4 = 'h4'#
- H5 = 'h5'#
- HEADER = 'header'#
- IMAGE = 'image'#
- LINE = 'line'#
- LINK = 'link'#
- LIST_ITEM = 'list-item'#
- MAIN = 'main'#
- METADATA = 'metadata'#
- ORDERED_LIST = 'ordered-list'#
- PAGE = 'page'#
- PARAGRAPH = 'paragraph'#
- PRE = 'pre'#
- REGION = 'region'#
- SENTENCE = 'sentence'#
- SOURCE = 'source'#
- SPAN = 'span'#
- STRONG = 'strong'#
- SUBTITLE = 'subtitle'#
- TELETYPE = 'teletype'#
- TEXT = 'text'#
- TITLE = 'title'#
- TOKEN = 'token'#
- UNDERLINED = 'underlined'#
- UNKNOWN = 'unknown'#
- UNORDERED_LIST = 'unordered-list'#
- class steamship.data.EmbeddingIndex(*, client: Client = None, id: str = None, handle: str = None, name: str = None, plugin: str = None, externalId: str = None, externalType: str = None, metadata: str = None)[source]#
Bases:
CamelModel
A persistent, read-optimized index over embeddings.
- static create(client: Client, handle: str = None, name: str = None, embedder_plugin_instance_handle: str = None, fetch_if_exists: bool = True, external_id: str = None, external_type: str = None, metadata: Any = None) EmbeddingIndex [source]#
- delete() EmbeddingIndex [source]#
- embed() Task[IndexEmbedResponse] [source]#
- insert(value: str, external_id: str = None, external_type: str = None, metadata: int | float | bool | str | List | Dict = None, reindex: bool = True, allow_long_records=False) IndexInsertResponse [source]#
- insert_file(file_id: str, block_type: str = None, external_id: str = None, external_type: str = None, metadata: int | float | bool | str | List | Dict = None, reindex: bool = True) IndexInsertResponse [source]#
- insert_many(items: List[EmbeddedItem | str], reindex: bool = True, allow_long_records=False) IndexInsertResponse [source]#
- class steamship.data.File(*, client: Client = None, id: str = None, handle: str = None, mimeType: MimeTypes = None, workspaceId: str = None, blocks: List[Block] = [], tags: List[Tag] = [], filename: str = None, publicData: bool = False)[source]#
Bases:
CamelModel
A file.
- class CreateResponse(data: Any = None, string: str = None, _bytes: bytes | io.BytesIO = None, json: io.BytesIO = None, mime_type: str = None)[source]#
Bases:
Response
- append_block(text: str = None, tags: List[Tag] = None, content: str | bytes = None, url: str | None = None, mime_type: MimeTypes | None = None, public_data: bool = False) Block [source]#
Append a new block to this File. This is a convenience wrapper around Block.create(). You should provide only one of text, content, or url.
This is a server-side operation, saving the new Block to the file. The new block is appended to this client-side File as well for convenience.
- static create(client: Client, content: str | bytes = None, mime_type: MimeTypes = None, handle: str = None, blocks: List[Block] = None, tags: List[Tag] = None, public_data: bool = False) File [source]#
- static create_with_plugin(client: Client, plugin_instance: str, url: str = None, mime_type: str = None) Task[File] [source]#
- static from_local(client: Client, file_path: str, mime_type: MimeTypes = None, handle: str = None, tags: List[Tag] = None, public_data: bool = False) Any [source]#
Loads a local file into a Steamship File.
NOTE: the file_path should be relative to where the call to from_local is happening.
Loaded files will automatically be tagged with a provenance tag.
- Parameters:
client – Steamship client for the workspace
file_path – Location of the file to upload relative to the current directory of the client
mime_type – Optional specification of a particular mime type. If not provided, a guess will be made.
handle – Intended handle (for lookups, etc.) for Steamship File
tags – Metadata to add to the Steamship File
public_data – Whether to make the Steamship File publicly-accessible
- generate(plugin_instance_handle: str, start_block_index: int = None, end_block_index: int | None = None, block_index_list: List[int] | None = None, append_output_to_file: bool = True, options: dict | None = None, wait_on_tasks: List[Task] = None, make_output_public: bool = False, streaming: bool | None = False) Task[GenerateResponse] [source]#
Generate new content from this file. Assumes this file as context for input and output. May specify start and end blocks.
- import_with_plugin(plugin_instance: str, url: str = None, mime_type: str = None) Task[File] [source]#
Run an import operation on an (empty) file object that has already been created.
- index(plugin_instance: Any = None) EmbeddingIndex [source]#
Index every block in the file.
TODO(ted): Enable indexing the results of a tag query. TODO(ted): It’s hard to load the EmbeddingIndexPluginInstance with just a handle because of the chain of things that need to be created to it to function.
- static list(client: Client, page_size: int | None = None, page_token: str | None = None, sort_order: SortOrder | None = SortOrder.DESC) ListFileResponse [source]#
- static query(client: Client, tag_filter_query: str) FileQueryResponse [source]#
- property raw_data_url: str | None#
Return a URL at which the data content of this File can be accessed. If public_data is True, this content can be accessed without an API key.
- class steamship.data.GenerationTag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
A set of name constants for Tags with a kind of TagKind.generation.
- GIST = 'gist'#
- HEADLINE = 'headline'#
- PROMPT_COMPLETION = 'prompt-completion'#
- SUMMARY = 'summary'#
- class steamship.data.Package(*, client: Client = None, id: str = None, handle: str = None, userId: str = None, profile: Manifest | None = None, description: str | None = None, readme: str | None = None, isPublic: bool = False)[source]#
Bases:
CamelModel
- static create(client: Client, handle: str = None, profile: Manifest = None, is_public=False, fetch_if_exists=False) Package [source]#
- class steamship.data.PackageInstance(*, client: Client = None, id: str = None, handle: str = None, packageId: str = None, packageHandle: str | None = None, userHandle: str = None, packageVersionId: str = None, packageVersionHandle: str | None = None, userId: str = None, invocationURL: str = None, config: Dict[str, Any] = None, workspaceId: str = None, workspaceHandle: str = None, initStatus: InvocableInitStatus | None = None, createdAt: datetime | None = None)[source]#
Bases:
CamelModel
- blocks_from_invoke(path: str, verb: Verb = Verb.POST, timeout_s: float | None = None, **kwargs) List[Block] [source]#
- static create(client: Client, package_id: str = None, package_handle: str = None, package_version_id: str = None, package_version_handle: str = None, handle: str = None, fetch_if_exists: bool = None, config: Dict[str, Any] = None) PackageInstance [source]#
- static create_local_development_instance(client: Client, local_development_url: str, package_id: str = None, package_handle: str = None, handle: str = None, fetch_if_exists: bool = True, config: Dict[str, Any] = None) PackageInstance [source]#
- delete() PackageInstance [source]#
- static get(client: Client, handle: str) PackageInstance [source]#
- init_status: InvocableInitStatus | None#
- static list(client: Client, package_id: str | None = None, package_version_id: str | None = None, include_workspace: bool | None = None, across_workspaces: bool | None = None, page_size: int | None = None, page_token: str | None = None, sort_order: SortOrder | None = SortOrder.DESC) ListPackageInstancesResponse [source]#
- task_from_invoke(path: str, verb: Verb = Verb.POST, timeout_s: float | None = None, **kwargs) Task [source]#
- class steamship.data.PackageVersion(*, client: Client = None, id: str = None, packageId: str = None, handle: str = None, configTemplate: Dict[str, Any] = None)[source]#
Bases:
CamelModel
- static create(client: Client, package_id: str | None = None, handle: str | None = None, filename: str | None = None, filebytes: bytes | None = None, config_template: Dict[str, Any] | None = None, hosting_handler: str | None = None) PackageVersion [source]#
- delete() PackageVersion [source]#
Delete this package version. If this package is public and another user has created an instance of this version, this method will throw an error and the PackageVersion will not be deleted. Deleting the PackageVersion will delete any instances of it that you have created.
- class steamship.data.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.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.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#
- class steamship.data.Tag(*, client: Client = None, id: str = None, fileId: str = None, blockId: str | None = None, kind: TagKind | str = None, name: str | None = None, value: Dict[TagValueKey | str, Any] | None = None, startIdx: int | None = None, endIdx: int | None = None, text: str | None = None)[source]#
Bases:
CamelModel
- class DeleteRequest(*, id: str = None, fileId: str = None, blockId: str = None)[source]#
Bases:
Request
- static create(client: Client, file_id: str = None, block_id: str = None, kind: str = None, name: str = None, start_idx: int = None, end_idx: int = None, value: Dict[str, Any] = None) Tag [source]#
- static query(client: Client, tag_filter_query: str) TagQueryResponse [source]#
- class steamship.data.TagKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
A set of kind constants for Tags.
These define broad categories of tags. Suggested name values for each category are found in separate enums. For example: kind=TagKind.DOCUMENT, name=DocTag.H1
- AGENT_STATUS_MESSAGE = 'agent-status-message'#
- CHAT = 'chat'#
- CHAT_HISTORY_CONTEXT = 'chat-history-context'#
- DEPENDENCY = 'dependency'#
- DOCUMENT = 'document'#
- EMBEDDING = 'embedding'#
- EMOTION = 'emotion'#
- ENTITY = 'entity'#
- FUNCTION_ARG = 'function-arg'#
- FUNCTION_SELECTION = 'function-selection'#
- GENERATION = 'generation'#
- INTENT = 'intent'#
- KIND = 'summary'#
- LLM_STATUS_MESSAGE = 'llm-status-message'#
- MESSAGE_ID = 'message-id'#
- PART_OF_SPEECH = 'part-of-speech'#
- PROVENANCE = 'provenance'#
- ROLE = 'role'#
- SEARCH_RESULT = 'search-result'#
- SENTIMENT = 'sentiment'#
- STATUS_MESSAGE = 'status-message'#
- SUMMARY = 'summary'#
- TIMESTAMP = 'timestamp'#
- TOKEN = 'token'#
- TOKENIZATION = 'tokenization'#
- TOOL_STATUS_MESSAGE = 'tool-status-message'#
- TOPIC = 'topic'#
- class steamship.data.TagValueKey(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
A set of key constants for the value object within a tag.
- BOOL_VALUE = 'bool-value'#
- DIRECT = 'direct'#
- END_TIME_S = 'end-time-s'#
- ENTITY_NAME = 'entity_name'#
- NUMBER_VALUE = 'number-value'#
- SCORE = 'score'#
- START_TIME_S = 'start-time-s'#
- STRING_VALUE = 'string-value'#
- TIMESTAMP_VALUE = 'timestamp-value'#
- VALUE = 'value'#
- VECTOR_VALUE = 'vector-value'#
- class steamship.data.TokenTag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
A set of name constants for Tags with a kind of TagKind.token; appropriate for parsing-level ideas.
- ENTITY_IOB = 'entity-iob'#
- ENTITY_TYPE = 'entity-type'#
- HEAD = 'head'#
- IS_ALPHA = 'is-alpha'#
- IS_ASCII = 'is-ascii'#
- IS_BRACKET = 'is-bracket'#
- IS_CURRENCY = 'is-currency'#
- IS_DIGIT = 'is-digit'#
- IS_LEFT_PUNCT = 'is-left-punct'#
- IS_OUT_OF_VOCABULARY = 'is-out-of-vocabulary'#
- IS_PUNCT = 'is-punct'#
- IS_QUOTE = 'is-quote'#
- IS_RIGHT_PUNCT = 'is-right-punct'#
- IS_SPACE = 'is-space'#
- IS_STOPWORD = 'is-stopword'#
- IS_TITLE = 'is-title'#
- LANGUAGE = 'language'#
- LEFT_EDGE = 'left-edge'#
- LEMMA = 'lemma'#
- LIKE_EMAIL = 'like-email'#
- LIKE_NUM = 'like-num'#
- LIKE_URL = 'like-url'#
- NORMALIZED = 'normalized'#
- PREFIX = 'prefix'#
- RIGHT_EDGE = 'right-edge'#
- SHAPE = 'shape'#
- SUFFIX = 'suffix'#
- TEXT = 'text'#
- TEXT_WITH_WHITESPACE = 'text-with-whitespace'#
- WHITESPACE = 'whitespace'#
- class steamship.data.Workspace(*, client: Client = None, id: str = None, handle: str = None)[source]#
Bases:
CamelModel
- class CreateRequest(*, id: str | None = None, handle: str | None = None, fetchIfExists: bool | None = None, externalId: str | None = None, externalType: str | None = None, metadata: str | None = None)[source]#
Bases:
Request
- static create(client: Client, handle: str | None = None, external_id: str | None = None, external_type: str | None = None, metadata: Any = None, fetch_if_exists: bool = True) Workspace [source]#
- static get(client: Client, id_: str = None, handle: str = None, fetch_if_exists: bool = None) Workspace [source]#