steamship.agents.tools package#

Subpackages#

Submodules#

steamship.agents.tools.base_tools module#

class steamship.agents.tools.base_tools.AudioBlockifierTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: str | None = None, blockifier_plugin_config: dict = {})[source]#

Bases: ScrapeAndBlockifyTool

A base class for tools that wrap Steamship Audio Blockifier plugins.

get_mime_type()[source]#
should_blockify(block: Block) bool[source]#
class steamship.agents.tools.base_tools.AudioGeneratorTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, generator_plugin_handle: str, generator_plugin_instance_handle: str | None = None, generator_plugin_config: dict = {}, merge_blocks: bool = False, make_output_public: bool = True)[source]#

Bases: GeneratorTool

A base class for tools that wrap Steamship Audio Generator plugins.

accept_output_block(block: Block) bool[source]#
make_output_public: bool#
class steamship.agents.tools.base_tools.GeneratorTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, generator_plugin_handle: str, generator_plugin_instance_handle: str | None = None, generator_plugin_config: dict = {}, merge_blocks: bool = False, make_output_public: bool = False)[source]#

Bases: Tool

A base class for tools that wrap Steamship Generator plugins. Subclass this and implement the accept_output_block method.

abstract accept_output_block(block: Block) bool[source]#
generator_plugin_config: dict#
generator_plugin_handle: str#
generator_plugin_instance_handle: str | None#
make_output_public: bool#
merge_blocks: bool#
post_process(task: Task, context: AgentContext) List[Block][source]#

In this case, the Generator returns a GeneratorResponse that has a .blocks method on it

run(tool_input: List[Block], context: AgentContext) List[Block] | Task[Any][source]#

Run the tool given the provided input and context.

At the moment, only synchronous Tools (those that return List[Block]) are supported.

Support for asynchronous Tools (those that return Task[Any]) will be added shortly.

class steamship.agents.tools.base_tools.ImageBlockifierTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: str | None = None, blockifier_plugin_config: dict = {})[source]#

Bases: ScrapeAndBlockifyTool

A base class for tools that wrap Steamship Image Blockifier plugins.

get_mime_type()[source]#
should_blockify(block: Block) bool[source]#
class steamship.agents.tools.base_tools.ImageGeneratorTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, generator_plugin_handle: str, generator_plugin_instance_handle: str | None = None, generator_plugin_config: dict = {}, merge_blocks: bool = False, make_output_public: bool = True)[source]#

Bases: GeneratorTool

A base class for tools that wrap Steamship Image Generator plugins.

accept_output_block(block: Block) bool[source]#
make_output_public: bool#
class steamship.agents.tools.base_tools.ScrapeAndBlockifyTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: str | None = None, blockifier_plugin_config: dict = {})[source]#

Bases: Tool

A base class for tools that wrap Steamship Blockifier plugin which transforms bytes to a set of blocks.

blockifier_plugin_config: dict#
blockifier_plugin_handle: str#
blockifier_plugin_instance_handle: str | None#
get_mime_type()[source]#
post_process(task: Task, context: AgentContext) List[Block][source]#

In this case, the Blockifier returns a BlockAndTagResponse that has a .file.blocks method on it

run(tool_input: List[Block], context: AgentContext) List[Block] | Task[Any][source]#

Run the tool given the provided input and context.

At the moment, only synchronous Tools (those that return List[Block]) are supported.

Support for asynchronous Tools (those that return Task[Any]) will be added shortly.

abstract should_blockify(block: Block) bool[source]#
class steamship.agents.tools.base_tools.VideoGeneratorTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, generator_plugin_handle: str, generator_plugin_instance_handle: str | None = None, generator_plugin_config: dict = {}, merge_blocks: bool = False, make_output_public: bool = True)[source]#

Bases: GeneratorTool

A base class for tools that wrap Steamship Video Generator plugins.

accept_output_block(block: Block) bool[source]#
make_output_public: bool#

Module contents#

class steamship.agents.tools.AudioBlockifierTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: str | None = None, blockifier_plugin_config: dict = {})[source]#

Bases: ScrapeAndBlockifyTool

A base class for tools that wrap Steamship Audio Blockifier plugins.

get_mime_type()[source]#
should_blockify(block: Block) bool[source]#
class steamship.agents.tools.AudioGeneratorTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, generator_plugin_handle: str, generator_plugin_instance_handle: str | None = None, generator_plugin_config: dict = {}, merge_blocks: bool = False, make_output_public: bool = True)[source]#

Bases: GeneratorTool

A base class for tools that wrap Steamship Audio Generator plugins.

accept_output_block(block: Block) bool[source]#
agent_description: str#

Description for use in an agent in order to enable Action selection. It should include a short summary of what the Tool does, what the inputs to the Tool should be, and what the outputs of the tool are.

cacheable: bool#

Whether runs of this Tool should be cached based on inputs (if caching is enabled in the AgentContext for a run). Setting this to False will make prevent any Actions that involve this tool from being cached, meaning that every Action using this Tool will result in a call to run. By default, Tools are considered cacheable.

generator_plugin_config: dict#
generator_plugin_handle: str#
generator_plugin_instance_handle: str | None#
human_description: str#

Human-friendly description. Used for logging, tool indices, etc.

is_final: bool#

Whether actions performed by this tool should have their is_final bit marked.

Setting this to True means that the output of this tool will halt the reasoning loop. Its output will be returned directly to the user.

make_output_public: bool#
merge_blocks: bool#
name: str#

The short name for the tool. This will be used by Agents to refer to this tool during action selection.

class steamship.agents.tools.GeneratorTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, generator_plugin_handle: str, generator_plugin_instance_handle: str | None = None, generator_plugin_config: dict = {}, merge_blocks: bool = False, make_output_public: bool = False)[source]#

Bases: Tool

A base class for tools that wrap Steamship Generator plugins. Subclass this and implement the accept_output_block method.

abstract accept_output_block(block: Block) bool[source]#
agent_description: str#

Description for use in an agent in order to enable Action selection. It should include a short summary of what the Tool does, what the inputs to the Tool should be, and what the outputs of the tool are.

cacheable: bool#

Whether runs of this Tool should be cached based on inputs (if caching is enabled in the AgentContext for a run). Setting this to False will make prevent any Actions that involve this tool from being cached, meaning that every Action using this Tool will result in a call to run. By default, Tools are considered cacheable.

generator_plugin_config: dict#
generator_plugin_handle: str#
generator_plugin_instance_handle: str | None#
human_description: str#

Human-friendly description. Used for logging, tool indices, etc.

is_final: bool#

Whether actions performed by this tool should have their is_final bit marked.

Setting this to True means that the output of this tool will halt the reasoning loop. Its output will be returned directly to the user.

make_output_public: bool#
merge_blocks: bool#
name: str#

The short name for the tool. This will be used by Agents to refer to this tool during action selection.

post_process(task: Task, context: AgentContext) List[Block][source]#

In this case, the Generator returns a GeneratorResponse that has a .blocks method on it

run(tool_input: List[Block], context: AgentContext) List[Block] | Task[Any][source]#

Run the tool given the provided input and context.

At the moment, only synchronous Tools (those that return List[Block]) are supported.

Support for asynchronous Tools (those that return Task[Any]) will be added shortly.

class steamship.agents.tools.ImageBlockifierTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: str | None = None, blockifier_plugin_config: dict = {})[source]#

Bases: ScrapeAndBlockifyTool

A base class for tools that wrap Steamship Image Blockifier plugins.

get_mime_type()[source]#
should_blockify(block: Block) bool[source]#
class steamship.agents.tools.ImageGeneratorTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, generator_plugin_handle: str, generator_plugin_instance_handle: str | None = None, generator_plugin_config: dict = {}, merge_blocks: bool = False, make_output_public: bool = True)[source]#

Bases: GeneratorTool

A base class for tools that wrap Steamship Image Generator plugins.

accept_output_block(block: Block) bool[source]#
agent_description: str#

Description for use in an agent in order to enable Action selection. It should include a short summary of what the Tool does, what the inputs to the Tool should be, and what the outputs of the tool are.

cacheable: bool#

Whether runs of this Tool should be cached based on inputs (if caching is enabled in the AgentContext for a run). Setting this to False will make prevent any Actions that involve this tool from being cached, meaning that every Action using this Tool will result in a call to run. By default, Tools are considered cacheable.

generator_plugin_config: dict#
generator_plugin_handle: str#
generator_plugin_instance_handle: str | None#
human_description: str#

Human-friendly description. Used for logging, tool indices, etc.

is_final: bool#

Whether actions performed by this tool should have their is_final bit marked.

Setting this to True means that the output of this tool will halt the reasoning loop. Its output will be returned directly to the user.

make_output_public: bool#
merge_blocks: bool#
name: str#

The short name for the tool. This will be used by Agents to refer to this tool during action selection.

class steamship.agents.tools.ScrapeAndBlockifyTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: str | None = None, blockifier_plugin_config: dict = {})[source]#

Bases: Tool

A base class for tools that wrap Steamship Blockifier plugin which transforms bytes to a set of blocks.

agent_description: str#

Description for use in an agent in order to enable Action selection. It should include a short summary of what the Tool does, what the inputs to the Tool should be, and what the outputs of the tool are.

blockifier_plugin_config: dict#
blockifier_plugin_handle: str#
blockifier_plugin_instance_handle: str | None#
cacheable: bool#

Whether runs of this Tool should be cached based on inputs (if caching is enabled in the AgentContext for a run). Setting this to False will make prevent any Actions that involve this tool from being cached, meaning that every Action using this Tool will result in a call to run. By default, Tools are considered cacheable.

get_mime_type()[source]#
human_description: str#

Human-friendly description. Used for logging, tool indices, etc.

is_final: bool#

Whether actions performed by this tool should have their is_final bit marked.

Setting this to True means that the output of this tool will halt the reasoning loop. Its output will be returned directly to the user.

name: str#

The short name for the tool. This will be used by Agents to refer to this tool during action selection.

post_process(task: Task, context: AgentContext) List[Block][source]#

In this case, the Blockifier returns a BlockAndTagResponse that has a .file.blocks method on it

run(tool_input: List[Block], context: AgentContext) List[Block] | Task[Any][source]#

Run the tool given the provided input and context.

At the moment, only synchronous Tools (those that return List[Block]) are supported.

Support for asynchronous Tools (those that return Task[Any]) will be added shortly.

abstract should_blockify(block: Block) bool[source]#
class steamship.agents.tools.VideoGeneratorTool(*, name: str, agent_description: str, human_description: str, is_final: bool = False, cacheable: bool = True, generator_plugin_handle: str, generator_plugin_instance_handle: str | None = None, generator_plugin_config: dict = {}, merge_blocks: bool = False, make_output_public: bool = True)[source]#

Bases: GeneratorTool

A base class for tools that wrap Steamship Video Generator plugins.

accept_output_block(block: Block) bool[source]#
agent_description: str#

Description for use in an agent in order to enable Action selection. It should include a short summary of what the Tool does, what the inputs to the Tool should be, and what the outputs of the tool are.

cacheable: bool#

Whether runs of this Tool should be cached based on inputs (if caching is enabled in the AgentContext for a run). Setting this to False will make prevent any Actions that involve this tool from being cached, meaning that every Action using this Tool will result in a call to run. By default, Tools are considered cacheable.

generator_plugin_config: dict#
generator_plugin_handle: str#
generator_plugin_instance_handle: str | None#
human_description: str#

Human-friendly description. Used for logging, tool indices, etc.

is_final: bool#

Whether actions performed by this tool should have their is_final bit marked.

Setting this to True means that the output of this tool will halt the reasoning loop. Its output will be returned directly to the user.

make_output_public: bool#
merge_blocks: bool#
name: str#

The short name for the tool. This will be used by Agents to refer to this tool during action selection.