Class: ComposableAgents::AiAgents::Tools::CreateArtifactTool
- Inherits:
-
Agents::Tool
- Object
- Agents::Tool
- ComposableAgents::AiAgents::Tools::CreateArtifactTool
- Includes:
- Mixins::Logger
- Defined in:
- lib/composable_agents/ai_agents/tools/create_artifact_tool.rb
Overview
Tool that is used to create a new artifact's content
Instance Method Summary collapse
-
#initialize(agent) ⇒ CreateArtifactTool
constructor
Constructor.
-
#perform(_tool_context, name:, content:) ⇒ String
Perform the tool's action.
Methods included from Mixins::Logger
Constructor Details
#initialize(agent) ⇒ CreateArtifactTool
Constructor
21 22 23 24 |
# File 'lib/composable_agents/ai_agents/tools/create_artifact_tool.rb', line 21 def initialize(agent) super() @agent = agent end |
Instance Method Details
#perform(_tool_context, name:, content:) ⇒ String
Perform the tool's action. This is called by ai-agents when the model requires it.
33 34 35 36 |
# File 'lib/composable_agents/ai_agents/tools/create_artifact_tool.rb', line 33 def perform(_tool_context, name:, content:) @agent.save_output_artifact(name.to_sym, content) "Artifact `#{name}` created successfully." end |