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, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: Optional[str] = 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, generator_plugin_handle: str, generator_plugin_instance_handle: Optional[str] = None, generator_plugin_config: dict = {}, merge_blocks: bool = False)[source]#

Bases: GeneratorTool

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

accept_output_block(block: Block) bool[source]#
class steamship.agents.tools.base_tools.GeneratorTool(*, name: str, agent_description: str, human_description: str, generator_plugin_handle: str, generator_plugin_instance_handle: Optional[str] = None, generator_plugin_config: dict = {}, merge_blocks: 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: Optional[str]#
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) Union[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, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: Optional[str] = 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, generator_plugin_handle: str, generator_plugin_instance_handle: Optional[str] = None, generator_plugin_config: dict = {}, merge_blocks: bool = False)[source]#

Bases: GeneratorTool

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

accept_output_block(block: Block) bool[source]#
class steamship.agents.tools.base_tools.ScrapeAndBlockifyTool(*, name: str, agent_description: str, human_description: str, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: Optional[str] = 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: Optional[str]#
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) Union[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]#

Module contents#

class steamship.agents.tools.AudioBlockifierTool(*, name: str, agent_description: str, human_description: str, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: Optional[str] = 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, generator_plugin_handle: str, generator_plugin_instance_handle: Optional[str] = None, generator_plugin_config: dict = {}, merge_blocks: bool = False)[source]#

Bases: GeneratorTool

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

accept_output_block(block: Block) bool[source]#
class steamship.agents.tools.GeneratorTool(*, name: str, agent_description: str, human_description: str, generator_plugin_handle: str, generator_plugin_instance_handle: Optional[str] = None, generator_plugin_config: dict = {}, merge_blocks: 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.

generator_plugin_config: dict#
generator_plugin_handle: str#
generator_plugin_instance_handle: Optional[str]#
human_description: str#

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

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) Union[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, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: Optional[str] = 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, generator_plugin_handle: str, generator_plugin_instance_handle: Optional[str] = None, generator_plugin_config: dict = {}, merge_blocks: bool = False)[source]#

Bases: GeneratorTool

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

accept_output_block(block: Block) bool[source]#
class steamship.agents.tools.ScrapeAndBlockifyTool(*, name: str, agent_description: str, human_description: str, blockifier_plugin_handle: str, blockifier_plugin_instance_handle: Optional[str] = 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: Optional[str]#
get_mime_type()[source]#
human_description: str#

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

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) Union[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]#