Module: Agents
- Defined in:
- lib/agents/tool.rb,
lib/agents.rb,
lib/agents/agent.rb,
lib/agents/result.rb,
lib/agents/runner.rb,
lib/agents/handoff.rb,
lib/agents/helpers.rb,
lib/agents/version.rb,
lib/agents/agent_tool.rb,
lib/agents/run_context.rb,
lib/agents/agent_runner.rb,
lib/agents/tool_context.rb,
lib/agents/tool_wrapper.rb,
lib/agents/helpers/headers.rb,
lib/agents/callback_manager.rb,
lib/agents/helpers/message_extractor.rb
Overview
Service object responsible for extracting and formatting conversation messages from RubyLLM chat objects into a format suitable for persistence and context restoration.
Handles different message types:
-
User messages: Basic content preservation
-
Assistant messages: Includes agent attribution and tool calls
-
Tool result messages: Links back to original tool calls
Defined Under Namespace
Modules: Helpers Classes: Agent, AgentRunner, AgentTool, CallbackManager, Configuration, Error, HandoffTool, RunContext, RunResult, Runner, Tool, ToolContext, ToolWrapper
Constant Summary collapse
- RECOMMENDED_HANDOFF_PROMPT_PREFIX =
OpenAI’s recommended system prompt prefix for multi-agent workflows This helps agents understand they’re part of a coordinated system
"# System context\n" \ "You are part of a multi-agent system called the Ruby Agents SDK, designed to make agent " \ "coordination and execution easy. Agents uses two primary abstraction: **Agents** and " \ "**Handoffs**. An agent encompasses instructions and tools and can hand off a " \ "conversation to another agent when appropriate. " \ "Handoffs are achieved by calling a handoff function, generally named " \ "`handoff_to_<agent_name>`. Transfers between agents are handled seamlessly in the background; " \ "do not mention or draw attention to these transfers in your conversation with the user.\n"
- VERSION =
"0.7.0"
Class Attribute Summary collapse
-
.logger ⇒ Object
Logger for debugging (can be set by users).
Class Method Summary collapse
- .configuration ⇒ Object
-
.configure {|configuration| ... } ⇒ Object
Configure both Agents and RubyLLM in one block.
Class Attribute Details
.logger ⇒ Object
Logger for debugging (can be set by users)
28 29 30 |
# File 'lib/agents.rb', line 28 def logger @logger end |
Class Method Details
.configuration ⇒ Object
37 38 39 |
# File 'lib/agents.rb', line 37 def configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
Configure both Agents and RubyLLM in one block
31 32 33 34 35 |
# File 'lib/agents.rb', line 31 def configure yield(configuration) if block_given? configure_ruby_llm! configuration end |