Using Plugins#
Steamship Plugins perform specific tasks related to AI.
This page is about using existing plugins. If you want to develop a Plugin
, see Developing Plugins
Steamship supports the following types of plugins:
File Importers pull raw data from common external sources into Files.
Blockifiers extract text and other content from raw data from Files to Blocks.
Generators create new Blocks (content) from existing Blocks (content).
Embedders convert content into a vector representation. This is primarily used in combination with Steamship’s built in Embedding Search.
Plugin Instances#
To use a Plugin
, create an instance of it. When building into a Package, We recommend doing this in the constructor, and saving the result as a member
variable.
gpt4 = steamship.use_plugin("gpt-4")
gpt4
is now a PluginInstance
. The instance contains the plugin’s configuration and is locked to the current version of the Plugin
.
To use a specific version of the Plugin
, pass the version handle:
gpt4 = steamship.use_plugin("gpt-4", version="0.0.1-rc.4")
To override default configuration parameters or provide required configuration values, pass a dict
of values in the config
parameter:
gpt4 = steamship.use_plugin("gpt-4", config={"max_tokens":1024})
To see available configuration parameters, check the documentation of the specific Plugin
.
To use a PluginInstance
, call the type-specific methods on it:
result_task = gpt4.generate(text="What's up GPT?")
Plugin invocations return asynchronous Tasks so that you can easily run many plugins and control when you need the results.
See the plugin individual plugin types for further info on how each can be called.