{"repo": "chatwoot/ai-agents", "files": {"lib/agents.rb": {"568b0443f8e685bfda868bcae0a74f6a7ea9d741": {"t": 1785745738.612202, "n": 4570, "h": "4bb992670a61e3a1", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\n\n # OpenAI's recommended system prompt prefix for multi-agent workflows\n # This helps agents understand they're part of a coordinated system\n RECOMMENDED_HANDOFF_PROMPT_PREFIX =\n \"# System context\\n\" \\\n \"You are part of a multi-agent system called the Ruby Agents SDK, designed to make agent \" \\\n \"coordination and execution easy. Agents uses two primary abstraction: **Agents** and \" \\\n \"**Handoffs**. An agent encompasses instructions and tools and can hand off a \" \\\n \"conversation to another agent when appropriate. \" \\\n \"Handoffs are achieved by calling a handoff function, generally named \" \\\n \"`handoff_to_`. Transfers between agents are handled seamlessly in the background; \" \\\n \"do not mention or draw attention to these transfers in your conversation with the user.\\n\"\n\n class << self\n # Logger for debugging (can be set by users)\n attr_accessor :logger\n\n # Configure both Agents and RubyLLM in one block\n def configure\n yield(configuration) if block_given?\n configure_ruby_llm!\n configuration\n end\n\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n configure_providers(config)\n configure_general_settings(config)\n end\n end\n\n def configure_providers(config)\n # OpenAI configuration\n apply_if_present(config, :openai_api_key)\n apply_if_present(config, :openai_api_base)\n apply_if_present(config, :openai_organization_id)\n apply_if_present(config, :openai_project_id)\n\n # Other providers\n apply_if_present(config, :anthropic_api_key)\n apply_if_present(config, :azure_api_base)\n apply_if_present(config, :azure_api_key)\n apply_if_present(config, :azure_ai_auth_token)\n apply_if_present(config, :gemini_api_key)\n apply_if_present(config, :deepseek_api_key)\n apply_if_present(config, :openrouter_api_key)\n apply_if_present(config, :ollama_api_base)\n\n # AWS Bedrock configuration\n apply_if_present(config, :bedrock_api_key)\n apply_if_present(config, :bedrock_secret_key)\n apply_if_present(config, :bedrock_region)\n apply_if_present(config, :bedrock_session_token)\n end\n\n def configure_general_settings(config)\n config.default_model = configuration.default_model\n config.log_level = configuration.debug == true ? :debug : :info\n apply_if_present(config, :request_timeout)\n end\n\n def apply_if_present(config, key)\n value = configuration.send(key)\n config.send(\"#{key}=\", value) if value\n end\n end\n\n class Configuration\n # Provider API keys and configuration\n attr_accessor :openai_api_key, :openai_api_base, :openai_organization_id, :openai_project_id\n attr_accessor :anthropic_api_key, :azure_api_base, :azure_api_key, :azure_ai_auth_token, :gemini_api_key,\n :deepseek_api_key, :openrouter_api_key, :ollama_api_base, :bedrock_api_key, :bedrock_secret_key,\n :bedrock_region, :bedrock_session_token\n\n # General configuration\n attr_accessor :request_timeout, :default_model, :debug\n\n def initialize\n @default_model = \"gpt-4o-mini\"\n @request_timeout = 120\n @debug = false\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key ||\n @deepseek_api_key || @openrouter_api_key || @ollama_api_base ||\n @bedrock_api_key || (@azure_api_base && (@azure_api_key || @azure_ai_auth_token))\n end\n end\nend\n\n# Core components\nrequire_relative \"agents/result\"\nrequire_relative \"agents/run_context\"\nrequire_relative \"agents/tool_context\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/helpers\"\nrequire_relative \"agents/agent\"\n\n# Execution components\nrequire_relative \"agents/tool_wrapper\"\nrequire_relative \"agents/callback_manager\"\nrequire_relative \"agents/agent_runner\"\nrequire_relative \"agents/runner\"\nrequire_relative \"agents/agent_tool\"\n"}, "da0d9a539cd95a0e88586f05f37cda9cf1fa957d": {"t": 1785756006.404164, "n": 4570, "h": "4bb992670a61e3a1", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\n\n # OpenAI's recommended system prompt prefix for multi-agent workflows\n # This helps agents understand they're part of a coordinated system\n RECOMMENDED_HANDOFF_PROMPT_PREFIX =\n \"# System context\\n\" \\\n \"You are part of a multi-agent system called the Ruby Agents SDK, designed to make agent \" \\\n \"coordination and execution easy. Agents uses two primary abstraction: **Agents** and \" \\\n \"**Handoffs**. An agent encompasses instructions and tools and can hand off a \" \\\n \"conversation to another agent when appropriate. \" \\\n \"Handoffs are achieved by calling a handoff function, generally named \" \\\n \"`handoff_to_`. Transfers between agents are handled seamlessly in the background; \" \\\n \"do not mention or draw attention to these transfers in your conversation with the user.\\n\"\n\n class << self\n # Logger for debugging (can be set by users)\n attr_accessor :logger\n\n # Configure both Agents and RubyLLM in one block\n def configure\n yield(configuration) if block_given?\n configure_ruby_llm!\n configuration\n end\n\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n configure_providers(config)\n configure_general_settings(config)\n end\n end\n\n def configure_providers(config)\n # OpenAI configuration\n apply_if_present(config, :openai_api_key)\n apply_if_present(config, :openai_api_base)\n apply_if_present(config, :openai_organization_id)\n apply_if_present(config, :openai_project_id)\n\n # Other providers\n apply_if_present(config, :anthropic_api_key)\n apply_if_present(config, :azure_api_base)\n apply_if_present(config, :azure_api_key)\n apply_if_present(config, :azure_ai_auth_token)\n apply_if_present(config, :gemini_api_key)\n apply_if_present(config, :deepseek_api_key)\n apply_if_present(config, :openrouter_api_key)\n apply_if_present(config, :ollama_api_base)\n\n # AWS Bedrock configuration\n apply_if_present(config, :bedrock_api_key)\n apply_if_present(config, :bedrock_secret_key)\n apply_if_present(config, :bedrock_region)\n apply_if_present(config, :bedrock_session_token)\n end\n\n def configure_general_settings(config)\n config.default_model = configuration.default_model\n config.log_level = configuration.debug == true ? :debug : :info\n apply_if_present(config, :request_timeout)\n end\n\n def apply_if_present(config, key)\n value = configuration.send(key)\n config.send(\"#{key}=\", value) if value\n end\n end\n\n class Configuration\n # Provider API keys and configuration\n attr_accessor :openai_api_key, :openai_api_base, :openai_organization_id, :openai_project_id\n attr_accessor :anthropic_api_key, :azure_api_base, :azure_api_key, :azure_ai_auth_token, :gemini_api_key,\n :deepseek_api_key, :openrouter_api_key, :ollama_api_base, :bedrock_api_key, :bedrock_secret_key,\n :bedrock_region, :bedrock_session_token\n\n # General configuration\n attr_accessor :request_timeout, :default_model, :debug\n\n def initialize\n @default_model = \"gpt-4o-mini\"\n @request_timeout = 120\n @debug = false\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key ||\n @deepseek_api_key || @openrouter_api_key || @ollama_api_base ||\n @bedrock_api_key || (@azure_api_base && (@azure_api_key || @azure_ai_auth_token))\n end\n end\nend\n\n# Core components\nrequire_relative \"agents/result\"\nrequire_relative \"agents/run_context\"\nrequire_relative \"agents/tool_context\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/helpers\"\nrequire_relative \"agents/agent\"\n\n# Execution components\nrequire_relative \"agents/tool_wrapper\"\nrequire_relative \"agents/callback_manager\"\nrequire_relative \"agents/agent_runner\"\nrequire_relative \"agents/runner\"\nrequire_relative \"agents/agent_tool\"\n"}, "0e39968647613d76a3c31701475960cbfa830a9f": {"t": 1785756008.06688, "n": 4284, "h": "6c683854f403a4b0", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\n\n # OpenAI's recommended system prompt prefix for multi-agent workflows\n # This helps agents understand they're part of a coordinated system\n RECOMMENDED_HANDOFF_PROMPT_PREFIX =\n \"# System context\\n\" \\\n \"You are part of a multi-agent system called the Ruby Agents SDK, designed to make agent \" \\\n \"coordination and execution easy. Agents uses two primary abstraction: **Agents** and \" \\\n \"**Handoffs**. An agent encompasses instructions and tools and can hand off a \" \\\n \"conversation to another agent when appropriate. \" \\\n \"Handoffs are achieved by calling a handoff function, generally named \" \\\n \"`handoff_to_`. Transfers between agents are handled seamlessly in the background; \" \\\n \"do not mention or draw attention to these transfers in your conversation with the user.\\n\"\n\n class << self\n # Logger for debugging (can be set by users)\n attr_accessor :logger\n\n # Configure both Agents and RubyLLM in one block\n def configure\n yield(configuration) if block_given?\n configure_ruby_llm!\n configuration\n end\n\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n configure_providers(config)\n configure_general_settings(config)\n end\n end\n\n def configure_providers(config)\n # OpenAI configuration\n apply_if_present(config, :openai_api_key)\n apply_if_present(config, :openai_api_base)\n apply_if_present(config, :openai_organization_id)\n apply_if_present(config, :openai_project_id)\n\n # Other providers\n apply_if_present(config, :anthropic_api_key)\n apply_if_present(config, :gemini_api_key)\n apply_if_present(config, :deepseek_api_key)\n apply_if_present(config, :openrouter_api_key)\n apply_if_present(config, :ollama_api_base)\n\n # AWS Bedrock configuration\n apply_if_present(config, :bedrock_api_key)\n apply_if_present(config, :bedrock_secret_key)\n apply_if_present(config, :bedrock_region)\n apply_if_present(config, :bedrock_session_token)\n end\n\n def configure_general_settings(config)\n config.default_model = configuration.default_model\n config.log_level = configuration.debug == true ? :debug : :info\n apply_if_present(config, :request_timeout)\n end\n\n def apply_if_present(config, key)\n value = configuration.send(key)\n config.send(\"#{key}=\", value) if value\n end\n end\n\n class Configuration\n # Provider API keys and configuration\n attr_accessor :openai_api_key, :openai_api_base, :openai_organization_id, :openai_project_id\n attr_accessor :anthropic_api_key, :gemini_api_key, :deepseek_api_key, :openrouter_api_key, :ollama_api_base,\n :bedrock_api_key, :bedrock_secret_key, :bedrock_region, :bedrock_session_token\n\n # General configuration\n attr_accessor :request_timeout, :default_model, :debug\n\n def initialize\n @default_model = \"gpt-4o-mini\"\n @request_timeout = 120\n @debug = false\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key ||\n @deepseek_api_key || @openrouter_api_key || @ollama_api_base ||\n @bedrock_api_key\n end\n end\nend\n\n# Core components\nrequire_relative \"agents/result\"\nrequire_relative \"agents/run_context\"\nrequire_relative \"agents/tool_context\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/helpers\"\nrequire_relative \"agents/agent\"\n\n# Execution components\nrequire_relative \"agents/tool_wrapper\"\nrequire_relative \"agents/callback_manager\"\nrequire_relative \"agents/agent_runner\"\nrequire_relative \"agents/runner\"\nrequire_relative \"agents/agent_tool\"\n"}, "fc93374a2e33553a6f52f4a51babdfa7646fe0af": {"t": 1785756009.5144722, "n": 4294, "h": "dfed0a16ff285ecd", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\n\n # OpenAI's recommended system prompt prefix for multi-agent workflows\n # This helps agents understand they're part of a coordinated system\n RECOMMENDED_HANDOFF_PROMPT_PREFIX =\n \"# System context\\n\" \\\n \"You are part of a multi-agent system called the Ruby Agents SDK, designed to make agent \" \\\n \"coordination and execution easy. Agents uses two primary abstraction: **Agents** and \" \\\n \"**Handoffs**. An agent encompasses instructions and tools and can hand off a \" \\\n \"conversation to another agent when appropriate. \" \\\n \"Handoffs are achieved by calling a handoff function, generally named \" \\\n \"`handoff_to_`. Transfers between agents are handled seamlessly in the background; \" \\\n \"do not mention or draw attention to these transfers in your conversation with the user.\\n\"\n\n class << self\n # Logger for debugging (can be set by users)\n attr_accessor :logger\n\n # Configure both Agents and RubyLLM in one block\n def configure\n yield(configuration) if block_given?\n configure_ruby_llm!\n configuration\n end\n\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n configure_providers(config)\n configure_general_settings(config)\n end\n end\n\n def configure_providers(config)\n # OpenAI configuration\n apply_if_present(config, :openai_api_key)\n apply_if_present(config, :openai_api_base)\n apply_if_present(config, :openai_organization_id)\n apply_if_present(config, :openai_project_id)\n\n # Other providers\n apply_if_present(config, :anthropic_api_key)\n apply_if_present(config, :gemini_api_key)\n apply_if_present(config, :deepseek_api_key)\n apply_if_present(config, :openrouter_api_key)\n apply_if_present(config, :ollama_api_base)\n\n # AWS Bedrock configuration\n apply_if_present(config, :bedrock_api_key)\n apply_if_present(config, :bedrock_secret_key)\n apply_if_present(config, :bedrock_region)\n apply_if_present(config, :bedrock_session_token)\n end\n\n def configure_general_settings(config)\n config.default_model = configuration.default_model\n config.log_level = configuration.debug == true ? :debug : :info\n apply_if_present(config, :request_timeout)\n end\n\n def apply_if_present(config, key)\n value = configuration.send(key)\n config.send(\"#{key}=\", value) if value\n end\n end\n\n class Configuration\n # Provider API keys and configuration\n attr_accessor :openai_api_key, :openai_api_base, :openai_organization_id, :openai_project_id\n attr_accessor :anthropic_api_key, :gemini_api_key, :deepseek_api_key, :openrouter_api_key, :ollama_api_base,\n :bedrock_api_key, :bedrock_secret_key, :bedrock_region, :bedrock_session_token\n\n # General configuration\n attr_accessor :request_timeout, :default_model, :debug\n\n def initialize\n @default_model = \"gpt-4o-mini\"\n @request_timeout = 120\n @debug = false\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key ||\n @deepseek_api_key || @openrouter_api_key || @ollama_api_base ||\n @bedrock_api_key\n end\n end\nend\n\n# Core components\nrequire_relative \"agents/result\"\nrequire_relative \"agents/run_context\"\nrequire_relative \"agents/tool_context\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/agent\"\n\n# Execution components\nrequire_relative \"agents/tool_wrapper\"\nrequire_relative \"agents/message_extractor\"\nrequire_relative \"agents/callback_manager\"\nrequire_relative \"agents/agent_runner\"\nrequire_relative \"agents/runner\"\nrequire_relative \"agents/agent_tool\"\n"}, "8f255b1cb7a882a8b552711d52d08660fdacb406": {"t": 1785756010.9074733, "n": 4325, "h": "977548f534e4f28e", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\n\n # OpenAI's recommended system prompt prefix for multi-agent workflows\n # This helps agents understand they're part of a coordinated system\n RECOMMENDED_HANDOFF_PROMPT_PREFIX =\n \"# System context\\n\" \\\n \"You are part of a multi-agent system called the Ruby Agents SDK, designed to make agent \" \\\n \"coordination and execution easy. Agents uses two primary abstraction: **Agents** and \" \\\n \"**Handoffs**. An agent encompasses instructions and tools and can hand off a \" \\\n \"conversation to another agent when appropriate. \" \\\n \"Handoffs are achieved by calling a handoff function, generally named \" \\\n \"`handoff_to_`. Transfers between agents are handled seamlessly in the background; \" \\\n \"do not mention or draw attention to these transfers in your conversation with the user.\\n\"\n\n class << self\n # Logger for debugging (can be set by users)\n attr_accessor :logger\n\n # Configure both Agents and RubyLLM in one block\n def configure\n yield(configuration) if block_given?\n configure_ruby_llm!\n configuration\n end\n\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n configure_providers(config)\n configure_general_settings(config)\n end\n end\n\n def configure_providers(config)\n # OpenAI configuration\n apply_if_present(config, :openai_api_key)\n apply_if_present(config, :openai_api_base)\n apply_if_present(config, :openai_organization_id)\n apply_if_present(config, :openai_project_id)\n\n # Other providers\n apply_if_present(config, :anthropic_api_key)\n apply_if_present(config, :gemini_api_key)\n apply_if_present(config, :deepseek_api_key)\n apply_if_present(config, :openrouter_api_key)\n apply_if_present(config, :ollama_api_base)\n\n # AWS Bedrock configuration\n apply_if_present(config, :bedrock_api_key)\n apply_if_present(config, :bedrock_secret_key)\n apply_if_present(config, :bedrock_region)\n apply_if_present(config, :bedrock_session_token)\n end\n\n def configure_general_settings(config)\n config.default_model = configuration.default_model\n config.log_level = configuration.debug == true ? :debug : :info\n apply_if_present(config, :request_timeout)\n end\n\n def apply_if_present(config, key)\n value = configuration.send(key)\n config.send(\"#{key}=\", value) if value\n end\n end\n\n class Configuration\n # Provider API keys and configuration\n attr_accessor :openai_api_key, :openai_api_base, :openai_organization_id, :openai_project_id\n attr_accessor :anthropic_api_key, :gemini_api_key, :deepseek_api_key, :openrouter_api_key, :ollama_api_base,\n :bedrock_api_key, :bedrock_secret_key, :bedrock_region, :bedrock_session_token\n\n # General configuration\n attr_accessor :request_timeout, :default_model, :debug\n\n def initialize\n @default_model = \"gpt-4o-mini\"\n @request_timeout = 120\n @debug = false\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key ||\n @deepseek_api_key || @openrouter_api_key || @ollama_api_base ||\n @bedrock_api_key\n end\n end\nend\n\n# Core components\nrequire_relative \"agents/result\"\nrequire_relative \"agents/run_context\"\nrequire_relative \"agents/tool_context\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/agent\"\n\n# Execution components\nrequire_relative \"agents/chat\"\nrequire_relative \"agents/tool_wrapper\"\nrequire_relative \"agents/message_extractor\"\nrequire_relative \"agents/callback_manager\"\nrequire_relative \"agents/agent_runner\"\nrequire_relative \"agents/runner\"\nrequire_relative \"agents/agent_tool\"\n"}, "b9695c9a094dc12b6c5ecff47acae5c9af63c1ca": {"t": 1785756012.152048, "n": 3187, "h": "f8242cd441d09fc8", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\n\n # OpenAI's recommended system prompt prefix for multi-agent workflows\n # This helps agents understand they're part of a coordinated system\n RECOMMENDED_HANDOFF_PROMPT_PREFIX =\n \"# System context\\n\" \\\n \"You are part of a multi-agent system called the Ruby Agents SDK, designed to make agent \" \\\n \"coordination and execution easy. Agents uses two primary abstraction: **Agents** and \" \\\n \"**Handoffs**. An agent encompasses instructions and tools and can hand off a \" \\\n \"conversation to another agent when appropriate. \" \\\n \"Handoffs are achieved by calling a handoff function, generally named \" \\\n \"`handoff_to_`. Transfers between agents are handled seamlessly in the background; \" \\\n \"do not mention or draw attention to these transfers in your conversation with the user.\\n\"\n\n class << self\n # Logger for debugging (can be set by users)\n attr_accessor :logger\n\n # Configure both Agents and RubyLLM in one block\n def configure\n yield(configuration) if block_given?\n configure_ruby_llm!\n configuration\n end\n\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n config.default_model = configuration.default_model\n config.log_level = configuration.debug == true ? :debug : :info\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n end\n end\n end\n\n class Configuration\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key, :request_timeout, :default_model, :debug\n\n def initialize\n @default_model = \"gpt-4o-mini\"\n @request_timeout = 120\n @debug = false\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n end\nend\n\n# Core components\nrequire_relative \"agents/result\"\nrequire_relative \"agents/run_context\"\nrequire_relative \"agents/tool_context\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/agent\"\n\n# Execution components\nrequire_relative \"agents/chat\"\nrequire_relative \"agents/tool_wrapper\"\nrequire_relative \"agents/message_extractor\"\nrequire_relative \"agents/callback_manager\"\nrequire_relative \"agents/agent_runner\"\nrequire_relative \"agents/runner\"\nrequire_relative \"agents/agent_tool\"\n"}, "62e0c6c130cbdd812f477dd002eaca7ad18b9b64": {"t": 1785756013.526763, "n": 3100, "h": "e80af3cb8ff290c4", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\n\n # OpenAI's recommended system prompt prefix for multi-agent workflows\n # This helps agents understand they're part of a coordinated system\n RECOMMENDED_HANDOFF_PROMPT_PREFIX =\n \"# System context\\n\" \\\n \"You are part of a multi-agent system called the Ruby Agents SDK, designed to make agent \" \\\n \"coordination and execution easy. Agents uses two primary abstraction: **Agents** and \" \\\n \"**Handoffs**. An agent encompasses instructions and tools and can hand off a \" \\\n \"conversation to another agent when appropriate. \" \\\n \"Handoffs are achieved by calling a handoff function, generally named \" \\\n \"`handoff_to_`. Transfers between agents are handled seamlessly in the background; \" \\\n \"do not mention or draw attention to these transfers in your conversation with the user.\\n\"\n\n class << self\n # Logger for debugging (can be set by users)\n attr_accessor :logger\n\n # Configure both Agents and RubyLLM in one block\n def configure\n yield(configuration) if block_given?\n configure_ruby_llm!\n configuration\n end\n\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n config.default_model = configuration.default_model\n config.log_level = configuration.debug == true ? :debug : :info\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n end\n end\n end\n\n class Configuration\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key, :request_timeout, :default_model, :debug\n\n def initialize\n @default_model = \"gpt-4o-mini\"\n @request_timeout = 120\n @debug = false\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n end\nend\n\n# Core components\nrequire_relative \"agents/result\"\nrequire_relative \"agents/run_context\"\nrequire_relative \"agents/tool_context\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/agent\"\n\n# Execution components\nrequire_relative \"agents/chat\"\nrequire_relative \"agents/tool_wrapper\"\nrequire_relative \"agents/agent_runner\"\nrequire_relative \"agents/runner\"\nrequire_relative \"agents/agent_tool\"\n"}, "8cb41b8f10b2ae0b8b1a6798571051dd8a4f806c": {"t": 1785756014.7471373, "n": 3063, "h": "d5c49119433801a9", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\n\n # OpenAI's recommended system prompt prefix for multi-agent workflows\n # This helps agents understand they're part of a coordinated system\n RECOMMENDED_HANDOFF_PROMPT_PREFIX =\n \"# System context\\n\" \\\n \"You are part of a multi-agent system called the Ruby Agents SDK, designed to make agent \" \\\n \"coordination and execution easy. Agents uses two primary abstraction: **Agents** and \" \\\n \"**Handoffs**. An agent encompasses instructions and tools and can hand off a \" \\\n \"conversation to another agent when appropriate. \" \\\n \"Handoffs are achieved by calling a handoff function, generally named \" \\\n \"`handoff_to_`. Transfers between agents are handled seamlessly in the background; \" \\\n \"do not mention or draw attention to these transfers in your conversation with the user.\\n\"\n\n class << self\n # Logger for debugging (can be set by users)\n attr_accessor :logger\n\n # Configure both Agents and RubyLLM in one block\n def configure\n yield(configuration) if block_given?\n configure_ruby_llm!\n configuration\n end\n\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n config.default_model = configuration.default_model\n config.log_level = configuration.debug == true ? :debug : :info\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n end\n end\n end\n\n class Configuration\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key, :request_timeout, :default_model, :debug\n\n def initialize\n @default_model = \"gpt-4o-mini\"\n @request_timeout = 120\n @debug = false\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n end\nend\n\n# Core components\nrequire_relative \"agents/result\"\nrequire_relative \"agents/run_context\"\nrequire_relative \"agents/tool_context\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/agent\"\n\n# Execution components\nrequire_relative \"agents/chat\"\nrequire_relative \"agents/tool_wrapper\"\nrequire_relative \"agents/agent_runner\"\nrequire_relative \"agents/runner\"\n"}, "ae93a2b30c7e61a4c3393092903a62e70ee173c6": {"t": 1785756016.1084337, "n": 3024, "h": "232787faf55653b1", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\n\n # OpenAI's recommended system prompt prefix for multi-agent workflows\n # This helps agents understand they're part of a coordinated system\n RECOMMENDED_HANDOFF_PROMPT_PREFIX =\n \"# System context\\n\" \\\n \"You are part of a multi-agent system called the Ruby Agents SDK, designed to make agent \" \\\n \"coordination and execution easy. Agents uses two primary abstraction: **Agents** and \" \\\n \"**Handoffs**. An agent encompasses instructions and tools and can hand off a \" \\\n \"conversation to another agent when appropriate. \" \\\n \"Handoffs are achieved by calling a handoff function, generally named \" \\\n \"`handoff_to_`. Transfers between agents are handled seamlessly in the background; \" \\\n \"do not mention or draw attention to these transfers in your conversation with the user.\\n\"\n\n class << self\n # Logger for debugging (can be set by users)\n attr_accessor :logger\n\n # Configure both Agents and RubyLLM in one block\n def configure\n yield(configuration) if block_given?\n configure_ruby_llm!\n configuration\n end\n\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n config.default_model = configuration.default_model\n config.log_level = configuration.debug == true ? :debug : :info\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n end\n end\n end\n\n class Configuration\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key, :request_timeout, :default_model, :debug\n\n def initialize\n @default_model = \"gpt-4o-mini\"\n @request_timeout = 120\n @debug = false\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n end\nend\n\n# Core components\nrequire_relative \"agents/result\"\nrequire_relative \"agents/run_context\"\nrequire_relative \"agents/tool_context\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/agent\"\n\n# Execution components\nrequire_relative \"agents/chat\"\nrequire_relative \"agents/tool_wrapper\"\nrequire_relative \"agents/runner\"\n"}, "1d21fa2efad397423664fa2bc91c092b937d9b3b": {"t": 1785756017.7637424, "n": 2174, "h": "41c062a177bd952b", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\n\n class << self\n # Logger for debugging (can be set by users)\n attr_accessor :logger\n\n # Configure both Agents and RubyLLM in one block\n def configure\n yield(configuration) if block_given?\n configure_ruby_llm!\n configuration\n end\n\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n config.default_model = configuration.default_model\n config.log_level = configuration.debug == true ? :debug : :info\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n end\n end\n end\n\n class Configuration\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key, :request_timeout, :default_model, :debug\n\n def initialize\n @default_model = \"gpt-4o-mini\"\n @request_timeout = 120\n @debug = false\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n end\nend\n\n# Core components\nrequire_relative \"agents/result\"\nrequire_relative \"agents/run_context\"\nrequire_relative \"agents/tool_context\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/agent\"\n\n# Execution components\nrequire_relative \"agents/tool_wrapper\"\nrequire_relative \"agents/runner\"\n"}, "b17ef5aca94aae4fe9cd4e7ea48143ca0a68bdfa": {"t": 1785756019.178153, "n": 4479, "h": "af4c9c55fc946ff6", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\nend\n\nrequire_relative \"agents/context\"\nrequire_relative \"agents/result\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/guardrail\"\nrequire_relative \"agents/agent\"\nrequire_relative \"agents/runner\"\nrequire_relative \"agents/items\"\n\nmodule Agents\n # Recommended prompt prefix for agents that use handoffs\n RECOMMENDED_HANDOFF_PROMPT_PREFIX = <<~PREFIX.freeze\n # System context\n You are part of a multi-agent system called the 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 `transfer_to_`.#{\" \"}\n\n CRITICAL: Transfers between agents are handled seamlessly in the background and are completely invisible to users. NEVER mention transfers, handoffs, or connecting to other agents in your conversation with the user. Simply call the transfer function when needed without any explanation to the user.\n PREFIX\n\n class << self\n # Configure both Agents and RubyLLM in one block\n # @yield [Agents::Configuration] Configuration instance\n # @return [Agents::Configuration] The configuration\n def configure\n yield(configuration) if block_given?\n # Apply RubyLLM configuration after our configuration is set\n configure_ruby_llm!\n configuration\n end\n\n # Get the current configuration\n # @return [Agents::Configuration] The configuration instance\n def configuration\n @configuration ||= Configuration.new\n end\n\n # Helper method to add handoff instructions to agent prompts\n def prompt_with_handoff_instructions(prompt)\n \"#{RECOMMENDED_HANDOFF_PROMPT_PREFIX}\\n\\n#{prompt}\"\n end\n\n private\n\n # Configure RubyLLM with our settings\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n # Pass through API keys\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n\n # Pass through other settings\n config.default_model = configuration.default_model\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n config.log_level = configuration.debug ? :debug : :info\n end\n end\n end\n\n # Configuration class that mirrors RubyLLM's configuration options\n # plus Agents-specific settings\n class Configuration\n # RubyLLM configuration options\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key\n attr_accessor :request_timeout, :retry_attempts, :retry_intervals, :max_turns, :default_timeout\n\n # Agents-specific configuration\n attr_accessor :default_provider, :default_model, :debug\n\n # Initialize with sensible defaults\n def initialize\n # Agents defaults\n @default_provider = :openai\n @default_model = \"gpt-4.1-mini\"\n @debug = false\n @max_turns = 10\n @default_timeout = 300\n\n # RubyLLM defaults\n @openai_api_key = ENV.fetch(\"OPENAI_API_KEY\", nil)\n @anthropic_api_key = ENV.fetch(\"ANTHROPIC_API_KEY\", nil)\n @gemini_api_key = ENV.fetch(\"GEMINI_API_KEY\", nil)\n @request_timeout = 120\n @retry_attempts = 3\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n\n # Get available providers based on configured API keys\n # @return [Array] Available providers\n def available_providers\n providers = []\n providers << :openai if @openai_api_key\n providers << :anthropic if @anthropic_api_key\n providers << :gemini if @gemini_api_key\n providers\n end\n end\nend\n"}, "1aabb92bcab1662bf8418dc71199d82b66bcc9c3": {"t": 1785756020.3153749, "n": 4447, "h": "1791bb75e5a936f7", "c": "# frozen_string_literal: true\n\n# Main entry point for the Ruby AI Agents SDK\n# This file sets up the core Agents module namespace and provides global configuration\n# for the multi-agent system including LLM provider setup, API keys, and system defaults.\n# It serves as the central configuration hub that other components depend on.\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\nend\n\nrequire_relative \"agents/context\"\nrequire_relative \"agents/result\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/guardrail\"\nrequire_relative \"agents/agent\"\nrequire_relative \"agents/runner\"\n\nmodule Agents\n # Recommended prompt prefix for agents that use handoffs\n RECOMMENDED_HANDOFF_PROMPT_PREFIX = <<~PREFIX.freeze\n # System context\n You are part of a multi-agent system called the 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 `transfer_to_`.#{\" \"}\n\n CRITICAL: Transfers between agents are handled seamlessly in the background and are completely invisible to users. NEVER mention transfers, handoffs, or connecting to other agents in your conversation with the user. Simply call the transfer function when needed without any explanation to the user.\n PREFIX\n\n class << self\n # Configure both Agents and RubyLLM in one block\n # @yield [Agents::Configuration] Configuration instance\n # @return [Agents::Configuration] The configuration\n def configure\n yield(configuration) if block_given?\n # Apply RubyLLM configuration after our configuration is set\n configure_ruby_llm!\n configuration\n end\n\n # Get the current configuration\n # @return [Agents::Configuration] The configuration instance\n def configuration\n @configuration ||= Configuration.new\n end\n\n # Helper method to add handoff instructions to agent prompts\n def prompt_with_handoff_instructions(prompt)\n \"#{RECOMMENDED_HANDOFF_PROMPT_PREFIX}\\n\\n#{prompt}\"\n end\n\n private\n\n # Configure RubyLLM with our settings\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n # Pass through API keys\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n\n # Pass through other settings\n config.default_model = configuration.default_model\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n config.log_level = configuration.debug ? :debug : :info\n end\n end\n end\n\n # Configuration class that mirrors RubyLLM's configuration options\n # plus Agents-specific settings\n class Configuration\n # RubyLLM configuration options\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key\n attr_accessor :request_timeout, :retry_attempts, :retry_intervals, :max_turns, :default_timeout\n\n # Agents-specific configuration\n attr_accessor :default_provider, :default_model, :debug\n\n # Initialize with sensible defaults\n def initialize\n # Agents defaults\n @default_provider = :openai\n @default_model = \"gpt-4.1-mini\"\n @debug = false\n @max_turns = 10\n @default_timeout = 300\n\n # RubyLLM defaults\n @openai_api_key = ENV.fetch(\"OPENAI_API_KEY\", nil)\n @anthropic_api_key = ENV.fetch(\"ANTHROPIC_API_KEY\", nil)\n @gemini_api_key = ENV.fetch(\"GEMINI_API_KEY\", nil)\n @request_timeout = 120\n @retry_attempts = 3\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n\n # Get available providers based on configured API keys\n # @return [Array] Available providers\n def available_providers\n providers = []\n providers << :openai if @openai_api_key\n providers << :anthropic if @anthropic_api_key\n providers << :gemini if @gemini_api_key\n providers\n end\n end\nend\n"}, "9ebac2783ff74046220559d15740beb179d93363": {"t": 1785756021.8565626, "n": 4145, "h": "5ebf951165eecf97", "c": "# frozen_string_literal: true\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\nend\n\nrequire_relative \"agents/context\"\nrequire_relative \"agents/result\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/guardrail\"\nrequire_relative \"agents/agent\"\nrequire_relative \"agents/runner\"\n\nmodule Agents\n # Recommended prompt prefix for agents that use handoffs\n RECOMMENDED_HANDOFF_PROMPT_PREFIX = <<~PREFIX.freeze\n # System context\n You are part of a multi-agent system called the 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 `transfer_to_`.#{\" \"}\n\n CRITICAL: Transfers between agents are handled seamlessly in the background and are completely invisible to users. NEVER mention transfers, handoffs, or connecting to other agents in your conversation with the user. Simply call the transfer function when needed without any explanation to the user.\n PREFIX\n\n class << self\n # Configure both Agents and RubyLLM in one block\n # @yield [Agents::Configuration] Configuration instance\n # @return [Agents::Configuration] The configuration\n def configure\n yield(configuration) if block_given?\n # Apply RubyLLM configuration after our configuration is set\n configure_ruby_llm!\n configuration\n end\n\n # Get the current configuration\n # @return [Agents::Configuration] The configuration instance\n def configuration\n @configuration ||= Configuration.new\n end\n\n # Helper method to add handoff instructions to agent prompts\n def prompt_with_handoff_instructions(prompt)\n \"#{RECOMMENDED_HANDOFF_PROMPT_PREFIX}\\n\\n#{prompt}\"\n end\n\n private\n\n # Configure RubyLLM with our settings\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n # Pass through API keys\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n\n # Pass through other settings\n config.default_model = configuration.default_model\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n config.log_level = configuration.debug ? :debug : :info\n end\n end\n end\n\n # Configuration class that mirrors RubyLLM's configuration options\n # plus Agents-specific settings\n class Configuration\n # RubyLLM configuration options\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key\n attr_accessor :request_timeout, :retry_attempts, :retry_intervals, :max_turns, :default_timeout\n\n # Agents-specific configuration\n attr_accessor :default_provider, :default_model, :debug\n\n # Initialize with sensible defaults\n def initialize\n # Agents defaults\n @default_provider = :openai\n @default_model = \"gpt-4.1-mini\"\n @debug = false\n @max_turns = 10\n @default_timeout = 300\n\n # RubyLLM defaults\n @openai_api_key = ENV.fetch(\"OPENAI_API_KEY\", nil)\n @anthropic_api_key = ENV.fetch(\"ANTHROPIC_API_KEY\", nil)\n @gemini_api_key = ENV.fetch(\"GEMINI_API_KEY\", nil)\n @request_timeout = 120\n @retry_attempts = 3\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n\n # Get available providers based on configured API keys\n # @return [Array] Available providers\n def available_providers\n providers = []\n providers << :openai if @openai_api_key\n providers << :anthropic if @anthropic_api_key\n providers << :gemini if @gemini_api_key\n providers\n end\n end\nend\n"}, "69d03d7bcb41b7d9c303e30da25b349110e4d0e5": {"t": 1785756023.0761306, "n": 4109, "h": "83c0e7134da356f6", "c": "# frozen_string_literal: true\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\nend\n\nrequire_relative \"agents/context\"\nrequire_relative \"agents/result\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/agent\"\nrequire_relative \"agents/runner\"\n\nmodule Agents\n # Recommended prompt prefix for agents that use handoffs\n RECOMMENDED_HANDOFF_PROMPT_PREFIX = <<~PREFIX.freeze\n # System context\n You are part of a multi-agent system called the 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 `transfer_to_`.#{\" \"}\n\n CRITICAL: Transfers between agents are handled seamlessly in the background and are completely invisible to users. NEVER mention transfers, handoffs, or connecting to other agents in your conversation with the user. Simply call the transfer function when needed without any explanation to the user.\n PREFIX\n\n class << self\n # Configure both Agents and RubyLLM in one block\n # @yield [Agents::Configuration] Configuration instance\n # @return [Agents::Configuration] The configuration\n def configure\n yield(configuration) if block_given?\n # Apply RubyLLM configuration after our configuration is set\n configure_ruby_llm!\n configuration\n end\n\n # Get the current configuration\n # @return [Agents::Configuration] The configuration instance\n def configuration\n @configuration ||= Configuration.new\n end\n\n # Helper method to add handoff instructions to agent prompts\n def prompt_with_handoff_instructions(prompt)\n \"#{RECOMMENDED_HANDOFF_PROMPT_PREFIX}\\n\\n#{prompt}\"\n end\n\n private\n\n # Configure RubyLLM with our settings\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n # Pass through API keys\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n\n # Pass through other settings\n config.default_model = configuration.default_model\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n config.log_level = configuration.debug ? :debug : :info\n end\n end\n end\n\n # Configuration class that mirrors RubyLLM's configuration options\n # plus Agents-specific settings\n class Configuration\n # RubyLLM configuration options\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key\n attr_accessor :request_timeout, :retry_attempts, :retry_intervals, :max_turns, :default_timeout\n\n # Agents-specific configuration\n attr_accessor :default_provider, :default_model, :debug\n\n # Initialize with sensible defaults\n def initialize\n # Agents defaults\n @default_provider = :openai\n @default_model = \"gpt-4.1-mini\"\n @debug = false\n @max_turns = 10\n @default_timeout = 300\n\n # RubyLLM defaults\n @openai_api_key = ENV.fetch(\"OPENAI_API_KEY\", nil)\n @anthropic_api_key = ENV.fetch(\"ANTHROPIC_API_KEY\", nil)\n @gemini_api_key = ENV.fetch(\"GEMINI_API_KEY\", nil)\n @request_timeout = 120\n @retry_attempts = 3\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n\n # Get available providers based on configured API keys\n # @return [Array] Available providers\n def available_providers\n providers = []\n providers << :openai if @openai_api_key\n providers << :anthropic if @anthropic_api_key\n providers << :gemini if @gemini_api_key\n providers\n end\n end\nend\n"}, "251060854783393b0ce32c73f4eba9825b0290ec": {"t": 1785756024.5104465, "n": 3947, "h": "16baefd503943e06", "c": "# frozen_string_literal: true\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\nend\n\nrequire_relative \"agents/context\"\nrequire_relative \"agents/result\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/handoff\"\nrequire_relative \"agents/agent\"\nrequire_relative \"agents/runner\"\n\nmodule Agents\n # Recommended prompt prefix for agents that use handoffs\n RECOMMENDED_HANDOFF_PROMPT_PREFIX = <<~PREFIX\n # System context\n You are part of a multi-agent system called the 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 `transfer_to_`. 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 PREFIX\n\n class << self\n # Configure both Agents and RubyLLM in one block\n # @yield [Agents::Configuration] Configuration instance\n # @return [Agents::Configuration] The configuration\n def configure\n yield(configuration) if block_given?\n # Apply RubyLLM configuration after our configuration is set\n configure_ruby_llm!\n configuration\n end\n\n # Get the current configuration\n # @return [Agents::Configuration] The configuration instance\n def configuration\n @configuration ||= Configuration.new\n end\n\n # Helper method to add handoff instructions to agent prompts\n def prompt_with_handoff_instructions(prompt)\n \"#{RECOMMENDED_HANDOFF_PROMPT_PREFIX}\\n\\n#{prompt}\"\n end\n\n private\n\n # Configure RubyLLM with our settings\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n # Pass through API keys\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n\n # Pass through other settings\n config.default_model = configuration.default_model\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n config.log_level = configuration.debug ? :debug : :info\n end\n end\n end\n\n # Configuration class that mirrors RubyLLM's configuration options\n # plus Agents-specific settings\n class Configuration\n # RubyLLM configuration options\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key\n attr_accessor :request_timeout, :retry_attempts, :retry_intervals, :max_turns, :default_timeout\n\n # Agents-specific configuration\n attr_accessor :default_provider, :default_model, :debug\n\n # Initialize with sensible defaults\n def initialize\n # Agents defaults\n @default_provider = :openai\n @default_model = \"gpt-4.1-mini\"\n @debug = false\n @max_turns = 10\n @default_timeout = 300\n\n # RubyLLM defaults\n @openai_api_key = ENV.fetch(\"OPENAI_API_KEY\", nil)\n @anthropic_api_key = ENV.fetch(\"ANTHROPIC_API_KEY\", nil)\n @gemini_api_key = ENV.fetch(\"GEMINI_API_KEY\", nil)\n @request_timeout = 120\n @retry_attempts = 3\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n\n # Get available providers based on configured API keys\n # @return [Array] Available providers\n def available_providers\n providers = []\n providers << :openai if @openai_api_key\n providers << :anthropic if @anthropic_api_key\n providers << :gemini if @gemini_api_key\n providers\n end\n end\nend\n"}, "00ac410b893052d2897e96a94bf03165d2dac1c2": {"t": 1785756025.7453957, "n": 3045, "h": "0714f0427ee7082c", "c": "# frozen_string_literal: true\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\nend\n\nrequire_relative \"agents/context\"\nrequire_relative \"agents/result\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/agent\"\nrequire_relative \"agents/runner\"\n\nmodule Agents\n class << self\n # Configure both Agents and RubyLLM in one block\n # @yield [Agents::Configuration] Configuration instance\n # @return [Agents::Configuration] The configuration\n def configure\n yield(configuration) if block_given?\n # Apply RubyLLM configuration after our configuration is set\n configure_ruby_llm!\n configuration\n end\n\n # Get the current configuration\n # @return [Agents::Configuration] The configuration instance\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n # Configure RubyLLM with our settings\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n # Pass through API keys\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n\n # Pass through other settings\n config.default_model = configuration.default_model\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n config.log_level = configuration.debug ? :debug : :info\n end\n end\n end\n\n # Configuration class that mirrors RubyLLM's configuration options\n # plus Agents-specific settings\n class Configuration\n # RubyLLM configuration options\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key\n attr_accessor :request_timeout, :retry_attempts, :retry_intervals, :max_turns, :default_timeout\n\n # Agents-specific configuration\n attr_accessor :default_provider, :default_model, :debug\n\n # Initialize with sensible defaults\n def initialize\n # Agents defaults\n @default_provider = :openai\n @default_model = \"gpt-4.1-mini\"\n @debug = false\n @max_turns = 10\n @default_timeout = 300\n\n # RubyLLM defaults\n @openai_api_key = ENV.fetch(\"OPENAI_API_KEY\", nil)\n @anthropic_api_key = ENV.fetch(\"ANTHROPIC_API_KEY\", nil)\n @gemini_api_key = ENV.fetch(\"GEMINI_API_KEY\", nil)\n @request_timeout = 120\n @retry_attempts = 3\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n\n # Get available providers based on configured API keys\n # @return [Array] Available providers\n def available_providers\n providers = []\n providers << :openai if @openai_api_key\n providers << :anthropic if @anthropic_api_key\n providers << :gemini if @gemini_api_key\n providers\n end\n end\nend\n"}, "aaef0aee7f8d7921fd591af8180164b5ce569e0e": {"t": 1785756027.0302558, "n": 3011, "h": "45cc66abd6dfc2d9", "c": "# frozen_string_literal: true\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\n\nmodule Agents\n class Error < StandardError; end\nend\n\nrequire_relative \"agents/result\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/agent\"\nrequire_relative \"agents/runner\"\n\nmodule Agents\n class << self\n # Configure both Agents and RubyLLM in one block\n # @yield [Agents::Configuration] Configuration instance\n # @return [Agents::Configuration] The configuration\n def configure\n yield(configuration) if block_given?\n # Apply RubyLLM configuration after our configuration is set\n configure_ruby_llm!\n configuration\n end\n\n # Get the current configuration\n # @return [Agents::Configuration] The configuration instance\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n # Configure RubyLLM with our settings\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n # Pass through API keys\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n\n # Pass through other settings\n config.default_model = configuration.default_model\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n config.log_level = configuration.debug ? :debug : :info\n end\n end\n end\n\n # Configuration class that mirrors RubyLLM's configuration options\n # plus Agents-specific settings\n class Configuration\n # RubyLLM configuration options\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key\n attr_accessor :request_timeout, :retry_attempts, :retry_intervals, :max_turns, :default_timeout\n\n # Agents-specific configuration\n attr_accessor :default_provider, :default_model, :debug\n\n # Initialize with sensible defaults\n def initialize\n # Agents defaults\n @default_provider = :openai\n @default_model = \"gpt-4.1-mini\"\n @debug = false\n @max_turns = 10\n @default_timeout = 300\n\n # RubyLLM defaults\n @openai_api_key = ENV.fetch(\"OPENAI_API_KEY\", nil)\n @anthropic_api_key = ENV.fetch(\"ANTHROPIC_API_KEY\", nil)\n @gemini_api_key = ENV.fetch(\"GEMINI_API_KEY\", nil)\n @request_timeout = 120\n @retry_attempts = 3\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n\n # Get available providers based on configured API keys\n # @return [Array] Available providers\n def available_providers\n providers = []\n providers << :openai if @openai_api_key\n providers << :anthropic if @anthropic_api_key\n providers << :gemini if @gemini_api_key\n providers\n end\n end\nend\n"}, "d1939d7e6b2ef3b01d0f7baae3c2ff53fdb26aed": {"t": 1785756028.7168427, "n": 2992, "h": "e10510276995d72a", "c": "# frozen_string_literal: true\n\nrequire \"ruby_llm\"\nrequire_relative \"agents/version\"\nrequire_relative \"agents/result\"\nrequire_relative \"agents/tool\"\nrequire_relative \"agents/agent\"\nrequire_relative \"agents/runner\"\n\nmodule Agents\n class Error < StandardError; end\n\n class << self\n # Configure both Agents and RubyLLM in one block\n # @yield [Agents::Configuration] Configuration instance\n # @return [Agents::Configuration] The configuration\n def configure\n yield(configuration) if block_given?\n # Apply RubyLLM configuration after our configuration is set\n configure_ruby_llm!\n configuration\n end\n\n # Get the current configuration\n # @return [Agents::Configuration] The configuration instance\n def configuration\n @configuration ||= Configuration.new\n end\n\n private\n\n # Configure RubyLLM with our settings\n def configure_ruby_llm!\n RubyLLM.configure do |config|\n # Pass through API keys\n config.openai_api_key = configuration.openai_api_key if configuration.openai_api_key\n config.anthropic_api_key = configuration.anthropic_api_key if configuration.anthropic_api_key\n config.gemini_api_key = configuration.gemini_api_key if configuration.gemini_api_key\n\n # Pass through other settings\n config.default_model = configuration.default_model\n config.request_timeout = configuration.request_timeout if configuration.request_timeout\n config.log_level = configuration.debug ? :debug : :info\n end\n end\n end\n\n # Configuration class that mirrors RubyLLM's configuration options\n # plus Agents-specific settings\n class Configuration\n # RubyLLM configuration options\n attr_accessor :openai_api_key, :anthropic_api_key, :gemini_api_key\n attr_accessor :request_timeout, :retry_attempts, :retry_intervals, :max_turns, :default_timeout\n\n # Agents-specific configuration\n attr_accessor :default_provider, :default_model, :debug\n\n # Initialize with sensible defaults\n def initialize\n # Agents defaults\n @default_provider = :openai\n @default_model = \"gpt-4.1-mini\"\n @debug = false\n @max_turns = 10\n @default_timeout = 300\n\n # RubyLLM defaults\n @openai_api_key = ENV.fetch(\"OPENAI_API_KEY\", nil)\n @anthropic_api_key = ENV.fetch(\"ANTHROPIC_API_KEY\", nil)\n @gemini_api_key = ENV.fetch(\"GEMINI_API_KEY\", nil)\n @request_timeout = 120\n @retry_attempts = 3\n end\n\n # Check if at least one provider is configured\n # @return [Boolean] True if any provider has an API key\n def configured?\n @openai_api_key || @anthropic_api_key || @gemini_api_key\n end\n\n # Get available providers based on configured API keys\n # @return [Array] Available providers\n def available_providers\n providers = []\n providers << :openai if @openai_api_key\n providers << :anthropic if @anthropic_api_key\n providers << :gemini if @gemini_api_key\n providers\n end\n end\nend\n"}}, "spec/agents_spec.rb": {"568b0443f8e685bfda868bcae0a74f6a7ea9d741": {"t": 1785745739.2098951, "n": 11326, "h": "fa8fe377a4bfa3d2", "c": "# frozen_string_literal: true\n\nrequire_relative \"../lib/agents\"\n\nRSpec.describe Agents do\n describe \"module structure\" do\n it \"defines the main module\" do\n expect(described_class).to be_a(Module)\n end\n\n it \"defines Error class\" do\n expect(Agents::Error).to be < StandardError\n end\n\n it \"defines RECOMMENDED_HANDOFF_PROMPT_PREFIX constant\" do\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to be_a(String)\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"multi-agent system\")\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"Ruby Agents SDK\")\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"handoff_to_\")\n end\n end\n\n describe \".logger\" do\n it \"allows setting and getting logger\" do\n logger = instance_double(Logger)\n described_class.logger = logger\n expect(described_class.logger).to eq(logger)\n end\n end\n\n describe \".configuration\" do\n it \"returns a Configuration instance\" do\n expect(described_class.configuration).to be_a(Agents::Configuration)\n end\n\n it \"returns the same instance on multiple calls\" do\n config1 = described_class.configuration\n config2 = described_class.configuration\n expect(config1).to be(config2)\n end\n end\n\n describe \".configure\" do\n let(:mock_ruby_llm_config) do\n Class.new do\n attr_writer :openai_api_key, :openai_api_base, :openai_organization_id, :openai_project_id,\n :anthropic_api_key, :azure_api_base, :azure_api_key, :azure_ai_auth_token, :gemini_api_key,\n :deepseek_api_key, :openrouter_api_key, :ollama_api_base, :bedrock_api_key, :bedrock_secret_key,\n :bedrock_region, :bedrock_session_token, :default_model, :log_level, :request_timeout\n attr_reader :azure_api_base, :azure_api_key, :azure_ai_auth_token, :log_level\n end.new\n end\n\n before do\n # Reset configuration for testing\n described_class.instance_variable_set(:@configuration, nil)\n end\n\n it \"yields configuration to the block\" do\n yielded_config = nil\n described_class.configure do |config|\n yielded_config = config\n end\n expect(yielded_config).to be_a(Agents::Configuration)\n end\n\n it \"configures RubyLLM with openai_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.openai_api_key = \"test-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"configures RubyLLM with anthropic_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.anthropic_api_key = \"test-anthropic-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"configures RubyLLM with gemini_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.gemini_api_key = \"test-gemini-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"sets debug log level when debug is true\" do\n allow(RubyLLM).to receive(:configure).and_yield(mock_ruby_llm_config)\n\n described_class.configure do |config|\n config.debug = true\n end\n\n expect(mock_ruby_llm_config.log_level).to eq(:debug)\n end\n\n it \"sets info log level when debug is false\" do\n allow(RubyLLM).to receive(:configure).and_yield(mock_ruby_llm_config)\n\n described_class.configure do |config|\n config.debug = false\n end\n\n expect(mock_ruby_llm_config.log_level).to eq(:info)\n end\n\n it \"returns the configuration instance\" do\n result = described_class.configure {}\n expect(result).to be_a(Agents::Configuration)\n end\n\n it \"configures RubyLLM with all new provider keys\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.openai_api_base = \"https://custom.openai.com\"\n config.openai_organization_id = \"org-123\"\n config.openai_project_id = \"proj-456\"\n config.azure_api_base = \"https://example.openai.azure.com\"\n config.azure_api_key = \"test-azure-key\"\n config.azure_ai_auth_token = \"test-azure-token\"\n config.deepseek_api_key = \"test-deepseek\"\n config.openrouter_api_key = \"test-openrouter\"\n config.ollama_api_base = \"http://localhost:11434\"\n config.bedrock_api_key = \"test-bedrock-key\"\n config.bedrock_secret_key = \"test-bedrock-secret\"\n config.bedrock_region = \"us-east-1\"\n config.bedrock_session_token = \"test-session\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"applies Azure config fields to RubyLLM config\" do\n allow(RubyLLM).to receive(:configure).and_yield(mock_ruby_llm_config)\n\n described_class.configure do |config|\n config.azure_api_base = \"https://example.openai.azure.com\"\n config.azure_api_key = \"test-azure-key\"\n config.azure_ai_auth_token = \"test-azure-token\"\n end\n\n expect(mock_ruby_llm_config.azure_api_base).to eq(\"https://example.openai.azure.com\")\n expect(mock_ruby_llm_config.azure_api_key).to eq(\"test-azure-key\")\n expect(mock_ruby_llm_config.azure_ai_auth_token).to eq(\"test-azure-token\")\n end\n end\nend\n\nRSpec.describe Agents::Configuration do\n let(:config) { described_class.new }\n\n describe \"#initialize\" do\n it \"sets default values\" do\n expect(config.default_model).to eq(\"gpt-4o-mini\")\n expect(config.request_timeout).to eq(120)\n expect(config.debug).to be false\n end\n\n it \"initializes API keys as nil\" do\n expect(config.openai_api_key).to be_nil\n expect(config.openai_api_base).to be_nil\n expect(config.openai_organization_id).to be_nil\n expect(config.openai_project_id).to be_nil\n expect(config.anthropic_api_key).to be_nil\n expect(config.azure_api_base).to be_nil\n expect(config.azure_api_key).to be_nil\n expect(config.azure_ai_auth_token).to be_nil\n expect(config.gemini_api_key).to be_nil\n expect(config.deepseek_api_key).to be_nil\n expect(config.openrouter_api_key).to be_nil\n expect(config.ollama_api_base).to be_nil\n expect(config.bedrock_api_key).to be_nil\n expect(config.bedrock_secret_key).to be_nil\n expect(config.bedrock_region).to be_nil\n expect(config.bedrock_session_token).to be_nil\n end\n end\n\n describe \"attribute accessors\" do\n it \"allows setting and getting openai_api_key\" do\n config.openai_api_key = \"test-openai-key\"\n expect(config.openai_api_key).to eq(\"test-openai-key\")\n end\n\n it \"allows setting and getting anthropic_api_key\" do\n config.anthropic_api_key = \"test-anthropic-key\"\n expect(config.anthropic_api_key).to eq(\"test-anthropic-key\")\n end\n\n it \"allows setting and getting Azure config\" do\n config.azure_api_base = \"https://example.openai.azure.com\"\n config.azure_api_key = \"test-azure-key\"\n config.azure_ai_auth_token = \"test-azure-token\"\n\n expect(config.azure_api_base).to eq(\"https://example.openai.azure.com\")\n expect(config.azure_api_key).to eq(\"test-azure-key\")\n expect(config.azure_ai_auth_token).to eq(\"test-azure-token\")\n end\n\n it \"allows setting and getting gemini_api_key\" do\n config.gemini_api_key = \"test-gemini-key\"\n expect(config.gemini_api_key).to eq(\"test-gemini-key\")\n end\n\n it \"allows setting and getting request_timeout\" do\n config.request_timeout = 300\n expect(config.request_timeout).to eq(300)\n end\n\n it \"allows setting and getting default_model\" do\n config.default_model = \"gpt-4\"\n expect(config.default_model).to eq(\"gpt-4\")\n end\n\n it \"allows setting and getting debug\" do\n config.debug = true\n expect(config.debug).to be true\n end\n\n it \"allows setting and getting openai_api_base\" do\n config.openai_api_base = \"https://custom.openai.com\"\n expect(config.openai_api_base).to eq(\"https://custom.openai.com\")\n end\n\n it \"allows setting and getting openai_organization_id\" do\n config.openai_organization_id = \"org-123\"\n expect(config.openai_organization_id).to eq(\"org-123\")\n end\n\n it \"allows setting and getting openai_project_id\" do\n config.openai_project_id = \"proj-456\"\n expect(config.openai_project_id).to eq(\"proj-456\")\n end\n\n it \"allows setting and getting deepseek_api_key\" do\n config.deepseek_api_key = \"test-deepseek-key\"\n expect(config.deepseek_api_key).to eq(\"test-deepseek-key\")\n end\n\n it \"allows setting and getting openrouter_api_key\" do\n config.openrouter_api_key = \"test-openrouter-key\"\n expect(config.openrouter_api_key).to eq(\"test-openrouter-key\")\n end\n\n it \"allows setting and getting ollama_api_base\" do\n config.ollama_api_base = \"http://localhost:11434\"\n expect(config.ollama_api_base).to eq(\"http://localhost:11434\")\n end\n\n it \"allows setting and getting bedrock credentials\" do\n config.bedrock_api_key = \"test-bedrock-key\"\n config.bedrock_secret_key = \"test-bedrock-secret\"\n config.bedrock_region = \"us-east-1\"\n config.bedrock_session_token = \"test-session-token\"\n\n expect(config.bedrock_api_key).to eq(\"test-bedrock-key\")\n expect(config.bedrock_secret_key).to eq(\"test-bedrock-secret\")\n expect(config.bedrock_region).to eq(\"us-east-1\")\n expect(config.bedrock_session_token).to eq(\"test-session-token\")\n end\n end\n\n describe \"#configured?\" do\n it \"returns false when no API keys are set\" do\n expect(config).not_to be_configured\n end\n\n it \"returns truthy when openai_api_key is set\" do\n config.openai_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when anthropic_api_key is set\" do\n config.anthropic_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when gemini_api_key is set\" do\n config.gemini_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when multiple API keys are set\" do\n config.openai_api_key = \"openai-key\"\n config.anthropic_api_key = \"anthropic-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when deepseek_api_key is set\" do\n config.deepseek_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when openrouter_api_key is set\" do\n config.openrouter_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when ollama_api_base is set\" do\n config.ollama_api_base = \"http://localhost:11434\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when bedrock_api_key is set\" do\n config.bedrock_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when Azure API key and base are set\" do\n config.azure_api_base = \"https://example.openai.azure.com\"\n config.azure_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when Azure auth token and base are set\" do\n config.azure_api_base = \"https://example.openai.azure.com\"\n config.azure_ai_auth_token = \"test-token\"\n expect(config).to be_configured\n end\n end\nend\n"}, "da0d9a539cd95a0e88586f05f37cda9cf1fa957d": {"t": 1785756008.792951, "n": 11326, "h": "fa8fe377a4bfa3d2", "c": "# frozen_string_literal: true\n\nrequire_relative \"../lib/agents\"\n\nRSpec.describe Agents do\n describe \"module structure\" do\n it \"defines the main module\" do\n expect(described_class).to be_a(Module)\n end\n\n it \"defines Error class\" do\n expect(Agents::Error).to be < StandardError\n end\n\n it \"defines RECOMMENDED_HANDOFF_PROMPT_PREFIX constant\" do\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to be_a(String)\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"multi-agent system\")\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"Ruby Agents SDK\")\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"handoff_to_\")\n end\n end\n\n describe \".logger\" do\n it \"allows setting and getting logger\" do\n logger = instance_double(Logger)\n described_class.logger = logger\n expect(described_class.logger).to eq(logger)\n end\n end\n\n describe \".configuration\" do\n it \"returns a Configuration instance\" do\n expect(described_class.configuration).to be_a(Agents::Configuration)\n end\n\n it \"returns the same instance on multiple calls\" do\n config1 = described_class.configuration\n config2 = described_class.configuration\n expect(config1).to be(config2)\n end\n end\n\n describe \".configure\" do\n let(:mock_ruby_llm_config) do\n Class.new do\n attr_writer :openai_api_key, :openai_api_base, :openai_organization_id, :openai_project_id,\n :anthropic_api_key, :azure_api_base, :azure_api_key, :azure_ai_auth_token, :gemini_api_key,\n :deepseek_api_key, :openrouter_api_key, :ollama_api_base, :bedrock_api_key, :bedrock_secret_key,\n :bedrock_region, :bedrock_session_token, :default_model, :log_level, :request_timeout\n attr_reader :azure_api_base, :azure_api_key, :azure_ai_auth_token, :log_level\n end.new\n end\n\n before do\n # Reset configuration for testing\n described_class.instance_variable_set(:@configuration, nil)\n end\n\n it \"yields configuration to the block\" do\n yielded_config = nil\n described_class.configure do |config|\n yielded_config = config\n end\n expect(yielded_config).to be_a(Agents::Configuration)\n end\n\n it \"configures RubyLLM with openai_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.openai_api_key = \"test-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"configures RubyLLM with anthropic_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.anthropic_api_key = \"test-anthropic-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"configures RubyLLM with gemini_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.gemini_api_key = \"test-gemini-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"sets debug log level when debug is true\" do\n allow(RubyLLM).to receive(:configure).and_yield(mock_ruby_llm_config)\n\n described_class.configure do |config|\n config.debug = true\n end\n\n expect(mock_ruby_llm_config.log_level).to eq(:debug)\n end\n\n it \"sets info log level when debug is false\" do\n allow(RubyLLM).to receive(:configure).and_yield(mock_ruby_llm_config)\n\n described_class.configure do |config|\n config.debug = false\n end\n\n expect(mock_ruby_llm_config.log_level).to eq(:info)\n end\n\n it \"returns the configuration instance\" do\n result = described_class.configure {}\n expect(result).to be_a(Agents::Configuration)\n end\n\n it \"configures RubyLLM with all new provider keys\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.openai_api_base = \"https://custom.openai.com\"\n config.openai_organization_id = \"org-123\"\n config.openai_project_id = \"proj-456\"\n config.azure_api_base = \"https://example.openai.azure.com\"\n config.azure_api_key = \"test-azure-key\"\n config.azure_ai_auth_token = \"test-azure-token\"\n config.deepseek_api_key = \"test-deepseek\"\n config.openrouter_api_key = \"test-openrouter\"\n config.ollama_api_base = \"http://localhost:11434\"\n config.bedrock_api_key = \"test-bedrock-key\"\n config.bedrock_secret_key = \"test-bedrock-secret\"\n config.bedrock_region = \"us-east-1\"\n config.bedrock_session_token = \"test-session\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"applies Azure config fields to RubyLLM config\" do\n allow(RubyLLM).to receive(:configure).and_yield(mock_ruby_llm_config)\n\n described_class.configure do |config|\n config.azure_api_base = \"https://example.openai.azure.com\"\n config.azure_api_key = \"test-azure-key\"\n config.azure_ai_auth_token = \"test-azure-token\"\n end\n\n expect(mock_ruby_llm_config.azure_api_base).to eq(\"https://example.openai.azure.com\")\n expect(mock_ruby_llm_config.azure_api_key).to eq(\"test-azure-key\")\n expect(mock_ruby_llm_config.azure_ai_auth_token).to eq(\"test-azure-token\")\n end\n end\nend\n\nRSpec.describe Agents::Configuration do\n let(:config) { described_class.new }\n\n describe \"#initialize\" do\n it \"sets default values\" do\n expect(config.default_model).to eq(\"gpt-4o-mini\")\n expect(config.request_timeout).to eq(120)\n expect(config.debug).to be false\n end\n\n it \"initializes API keys as nil\" do\n expect(config.openai_api_key).to be_nil\n expect(config.openai_api_base).to be_nil\n expect(config.openai_organization_id).to be_nil\n expect(config.openai_project_id).to be_nil\n expect(config.anthropic_api_key).to be_nil\n expect(config.azure_api_base).to be_nil\n expect(config.azure_api_key).to be_nil\n expect(config.azure_ai_auth_token).to be_nil\n expect(config.gemini_api_key).to be_nil\n expect(config.deepseek_api_key).to be_nil\n expect(config.openrouter_api_key).to be_nil\n expect(config.ollama_api_base).to be_nil\n expect(config.bedrock_api_key).to be_nil\n expect(config.bedrock_secret_key).to be_nil\n expect(config.bedrock_region).to be_nil\n expect(config.bedrock_session_token).to be_nil\n end\n end\n\n describe \"attribute accessors\" do\n it \"allows setting and getting openai_api_key\" do\n config.openai_api_key = \"test-openai-key\"\n expect(config.openai_api_key).to eq(\"test-openai-key\")\n end\n\n it \"allows setting and getting anthropic_api_key\" do\n config.anthropic_api_key = \"test-anthropic-key\"\n expect(config.anthropic_api_key).to eq(\"test-anthropic-key\")\n end\n\n it \"allows setting and getting Azure config\" do\n config.azure_api_base = \"https://example.openai.azure.com\"\n config.azure_api_key = \"test-azure-key\"\n config.azure_ai_auth_token = \"test-azure-token\"\n\n expect(config.azure_api_base).to eq(\"https://example.openai.azure.com\")\n expect(config.azure_api_key).to eq(\"test-azure-key\")\n expect(config.azure_ai_auth_token).to eq(\"test-azure-token\")\n end\n\n it \"allows setting and getting gemini_api_key\" do\n config.gemini_api_key = \"test-gemini-key\"\n expect(config.gemini_api_key).to eq(\"test-gemini-key\")\n end\n\n it \"allows setting and getting request_timeout\" do\n config.request_timeout = 300\n expect(config.request_timeout).to eq(300)\n end\n\n it \"allows setting and getting default_model\" do\n config.default_model = \"gpt-4\"\n expect(config.default_model).to eq(\"gpt-4\")\n end\n\n it \"allows setting and getting debug\" do\n config.debug = true\n expect(config.debug).to be true\n end\n\n it \"allows setting and getting openai_api_base\" do\n config.openai_api_base = \"https://custom.openai.com\"\n expect(config.openai_api_base).to eq(\"https://custom.openai.com\")\n end\n\n it \"allows setting and getting openai_organization_id\" do\n config.openai_organization_id = \"org-123\"\n expect(config.openai_organization_id).to eq(\"org-123\")\n end\n\n it \"allows setting and getting openai_project_id\" do\n config.openai_project_id = \"proj-456\"\n expect(config.openai_project_id).to eq(\"proj-456\")\n end\n\n it \"allows setting and getting deepseek_api_key\" do\n config.deepseek_api_key = \"test-deepseek-key\"\n expect(config.deepseek_api_key).to eq(\"test-deepseek-key\")\n end\n\n it \"allows setting and getting openrouter_api_key\" do\n config.openrouter_api_key = \"test-openrouter-key\"\n expect(config.openrouter_api_key).to eq(\"test-openrouter-key\")\n end\n\n it \"allows setting and getting ollama_api_base\" do\n config.ollama_api_base = \"http://localhost:11434\"\n expect(config.ollama_api_base).to eq(\"http://localhost:11434\")\n end\n\n it \"allows setting and getting bedrock credentials\" do\n config.bedrock_api_key = \"test-bedrock-key\"\n config.bedrock_secret_key = \"test-bedrock-secret\"\n config.bedrock_region = \"us-east-1\"\n config.bedrock_session_token = \"test-session-token\"\n\n expect(config.bedrock_api_key).to eq(\"test-bedrock-key\")\n expect(config.bedrock_secret_key).to eq(\"test-bedrock-secret\")\n expect(config.bedrock_region).to eq(\"us-east-1\")\n expect(config.bedrock_session_token).to eq(\"test-session-token\")\n end\n end\n\n describe \"#configured?\" do\n it \"returns false when no API keys are set\" do\n expect(config).not_to be_configured\n end\n\n it \"returns truthy when openai_api_key is set\" do\n config.openai_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when anthropic_api_key is set\" do\n config.anthropic_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when gemini_api_key is set\" do\n config.gemini_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when multiple API keys are set\" do\n config.openai_api_key = \"openai-key\"\n config.anthropic_api_key = \"anthropic-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when deepseek_api_key is set\" do\n config.deepseek_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when openrouter_api_key is set\" do\n config.openrouter_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when ollama_api_base is set\" do\n config.ollama_api_base = \"http://localhost:11434\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when bedrock_api_key is set\" do\n config.bedrock_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when Azure API key and base are set\" do\n config.azure_api_base = \"https://example.openai.azure.com\"\n config.azure_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when Azure auth token and base are set\" do\n config.azure_api_base = \"https://example.openai.azure.com\"\n config.azure_ai_auth_token = \"test-token\"\n expect(config).to be_configured\n end\n end\nend\n"}, "8f255b1cb7a882a8b552711d52d08660fdacb406": {"t": 1785756010.1842625, "n": 9415, "h": "d5dab6cd77deac7b", "c": "# frozen_string_literal: true\n\nrequire_relative \"../lib/agents\"\n\nRSpec.describe Agents do\n describe \"module structure\" do\n it \"defines the main module\" do\n expect(described_class).to be_a(Module)\n end\n\n it \"defines Error class\" do\n expect(Agents::Error).to be < StandardError\n end\n\n it \"defines RECOMMENDED_HANDOFF_PROMPT_PREFIX constant\" do\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to be_a(String)\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"multi-agent system\")\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"Ruby Agents SDK\")\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"handoff_to_\")\n end\n end\n\n describe \".logger\" do\n it \"allows setting and getting logger\" do\n logger = instance_double(Logger)\n described_class.logger = logger\n expect(described_class.logger).to eq(logger)\n end\n end\n\n describe \".configuration\" do\n it \"returns a Configuration instance\" do\n expect(described_class.configuration).to be_a(Agents::Configuration)\n end\n\n it \"returns the same instance on multiple calls\" do\n config1 = described_class.configuration\n config2 = described_class.configuration\n expect(config1).to be(config2)\n end\n end\n\n describe \".configure\" do\n let(:mock_ruby_llm_config) do\n Class.new do\n attr_writer :openai_api_key, :openai_api_base, :openai_organization_id, :openai_project_id,\n :anthropic_api_key, :gemini_api_key, :deepseek_api_key, :openrouter_api_key,\n :ollama_api_base, :bedrock_api_key, :bedrock_secret_key, :bedrock_region,\n :bedrock_session_token, :default_model, :log_level, :request_timeout\n attr_reader :log_level\n end.new\n end\n\n before do\n # Reset configuration for testing\n described_class.instance_variable_set(:@configuration, nil)\n end\n\n it \"yields configuration to the block\" do\n yielded_config = nil\n described_class.configure do |config|\n yielded_config = config\n end\n expect(yielded_config).to be_a(Agents::Configuration)\n end\n\n it \"configures RubyLLM with openai_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.openai_api_key = \"test-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"configures RubyLLM with anthropic_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.anthropic_api_key = \"test-anthropic-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"configures RubyLLM with gemini_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.gemini_api_key = \"test-gemini-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"sets debug log level when debug is true\" do\n allow(RubyLLM).to receive(:configure).and_yield(mock_ruby_llm_config)\n\n described_class.configure do |config|\n config.debug = true\n end\n\n expect(mock_ruby_llm_config.log_level).to eq(:debug)\n end\n\n it \"sets info log level when debug is false\" do\n allow(RubyLLM).to receive(:configure).and_yield(mock_ruby_llm_config)\n\n described_class.configure do |config|\n config.debug = false\n end\n\n expect(mock_ruby_llm_config.log_level).to eq(:info)\n end\n\n it \"returns the configuration instance\" do\n result = described_class.configure {}\n expect(result).to be_a(Agents::Configuration)\n end\n\n it \"configures RubyLLM with all new provider keys\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.openai_api_base = \"https://custom.openai.com\"\n config.openai_organization_id = \"org-123\"\n config.openai_project_id = \"proj-456\"\n config.deepseek_api_key = \"test-deepseek\"\n config.openrouter_api_key = \"test-openrouter\"\n config.ollama_api_base = \"http://localhost:11434\"\n config.bedrock_api_key = \"test-bedrock-key\"\n config.bedrock_secret_key = \"test-bedrock-secret\"\n config.bedrock_region = \"us-east-1\"\n config.bedrock_session_token = \"test-session\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n end\nend\n\nRSpec.describe Agents::Configuration do\n let(:config) { described_class.new }\n\n describe \"#initialize\" do\n it \"sets default values\" do\n expect(config.default_model).to eq(\"gpt-4o-mini\")\n expect(config.request_timeout).to eq(120)\n expect(config.debug).to be false\n end\n\n it \"initializes API keys as nil\" do\n expect(config.openai_api_key).to be_nil\n expect(config.openai_api_base).to be_nil\n expect(config.openai_organization_id).to be_nil\n expect(config.openai_project_id).to be_nil\n expect(config.anthropic_api_key).to be_nil\n expect(config.gemini_api_key).to be_nil\n expect(config.deepseek_api_key).to be_nil\n expect(config.openrouter_api_key).to be_nil\n expect(config.ollama_api_base).to be_nil\n expect(config.bedrock_api_key).to be_nil\n expect(config.bedrock_secret_key).to be_nil\n expect(config.bedrock_region).to be_nil\n expect(config.bedrock_session_token).to be_nil\n end\n end\n\n describe \"attribute accessors\" do\n it \"allows setting and getting openai_api_key\" do\n config.openai_api_key = \"test-openai-key\"\n expect(config.openai_api_key).to eq(\"test-openai-key\")\n end\n\n it \"allows setting and getting anthropic_api_key\" do\n config.anthropic_api_key = \"test-anthropic-key\"\n expect(config.anthropic_api_key).to eq(\"test-anthropic-key\")\n end\n\n it \"allows setting and getting gemini_api_key\" do\n config.gemini_api_key = \"test-gemini-key\"\n expect(config.gemini_api_key).to eq(\"test-gemini-key\")\n end\n\n it \"allows setting and getting request_timeout\" do\n config.request_timeout = 300\n expect(config.request_timeout).to eq(300)\n end\n\n it \"allows setting and getting default_model\" do\n config.default_model = \"gpt-4\"\n expect(config.default_model).to eq(\"gpt-4\")\n end\n\n it \"allows setting and getting debug\" do\n config.debug = true\n expect(config.debug).to be true\n end\n\n it \"allows setting and getting openai_api_base\" do\n config.openai_api_base = \"https://custom.openai.com\"\n expect(config.openai_api_base).to eq(\"https://custom.openai.com\")\n end\n\n it \"allows setting and getting openai_organization_id\" do\n config.openai_organization_id = \"org-123\"\n expect(config.openai_organization_id).to eq(\"org-123\")\n end\n\n it \"allows setting and getting openai_project_id\" do\n config.openai_project_id = \"proj-456\"\n expect(config.openai_project_id).to eq(\"proj-456\")\n end\n\n it \"allows setting and getting deepseek_api_key\" do\n config.deepseek_api_key = \"test-deepseek-key\"\n expect(config.deepseek_api_key).to eq(\"test-deepseek-key\")\n end\n\n it \"allows setting and getting openrouter_api_key\" do\n config.openrouter_api_key = \"test-openrouter-key\"\n expect(config.openrouter_api_key).to eq(\"test-openrouter-key\")\n end\n\n it \"allows setting and getting ollama_api_base\" do\n config.ollama_api_base = \"http://localhost:11434\"\n expect(config.ollama_api_base).to eq(\"http://localhost:11434\")\n end\n\n it \"allows setting and getting bedrock credentials\" do\n config.bedrock_api_key = \"test-bedrock-key\"\n config.bedrock_secret_key = \"test-bedrock-secret\"\n config.bedrock_region = \"us-east-1\"\n config.bedrock_session_token = \"test-session-token\"\n\n expect(config.bedrock_api_key).to eq(\"test-bedrock-key\")\n expect(config.bedrock_secret_key).to eq(\"test-bedrock-secret\")\n expect(config.bedrock_region).to eq(\"us-east-1\")\n expect(config.bedrock_session_token).to eq(\"test-session-token\")\n end\n end\n\n describe \"#configured?\" do\n it \"returns false when no API keys are set\" do\n expect(config).not_to be_configured\n end\n\n it \"returns truthy when openai_api_key is set\" do\n config.openai_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when anthropic_api_key is set\" do\n config.anthropic_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when gemini_api_key is set\" do\n config.gemini_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when multiple API keys are set\" do\n config.openai_api_key = \"openai-key\"\n config.anthropic_api_key = \"anthropic-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when deepseek_api_key is set\" do\n config.deepseek_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when openrouter_api_key is set\" do\n config.openrouter_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when ollama_api_base is set\" do\n config.ollama_api_base = \"http://localhost:11434\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when bedrock_api_key is set\" do\n config.bedrock_api_key = \"test-key\"\n expect(config).to be_configured\n end\n end\nend\n"}, "ae93a2b30c7e61a4c3393092903a62e70ee173c6": {"t": 1785756011.444093, "n": 5702, "h": "8940d9ff8c62a1b0", "c": "# frozen_string_literal: true\n\nrequire_relative \"../lib/agents\"\n\nRSpec.describe Agents do\n describe \"module structure\" do\n it \"defines the main module\" do\n expect(described_class).to be_a(Module)\n end\n\n it \"defines Error class\" do\n expect(Agents::Error).to be < StandardError\n end\n\n it \"defines RECOMMENDED_HANDOFF_PROMPT_PREFIX constant\" do\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to be_a(String)\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"multi-agent system\")\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"Ruby Agents SDK\")\n expect(described_class::RECOMMENDED_HANDOFF_PROMPT_PREFIX).to include(\"handoff_to_\")\n end\n end\n\n describe \".logger\" do\n it \"allows setting and getting logger\" do\n logger = instance_double(Logger)\n described_class.logger = logger\n expect(described_class.logger).to eq(logger)\n end\n end\n\n describe \".configuration\" do\n it \"returns a Configuration instance\" do\n expect(described_class.configuration).to be_a(Agents::Configuration)\n end\n\n it \"returns the same instance on multiple calls\" do\n config1 = described_class.configuration\n config2 = described_class.configuration\n expect(config1).to be(config2)\n end\n end\n\n describe \".configure\" do\n let(:mock_ruby_llm_config) do\n Class.new do\n attr_writer :openai_api_key, :anthropic_api_key, :gemini_api_key,\n :default_model, :log_level, :request_timeout\n attr_reader :log_level\n end.new\n end\n\n before do\n # Reset configuration for testing\n described_class.instance_variable_set(:@configuration, nil)\n end\n\n it \"yields configuration to the block\" do\n yielded_config = nil\n described_class.configure do |config|\n yielded_config = config\n end\n expect(yielded_config).to be_a(Agents::Configuration)\n end\n\n it \"configures RubyLLM with openai_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.openai_api_key = \"test-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"configures RubyLLM with anthropic_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.anthropic_api_key = \"test-anthropic-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"configures RubyLLM with gemini_api_key\" do\n allow(RubyLLM).to receive(:configure)\n\n described_class.configure do |config|\n config.gemini_api_key = \"test-gemini-key\"\n end\n\n expect(RubyLLM).to have_received(:configure)\n end\n\n it \"sets debug log level when debug is true\" do\n allow(RubyLLM).to receive(:configure).and_yield(mock_ruby_llm_config)\n\n described_class.configure do |config|\n config.debug = true\n end\n\n expect(mock_ruby_llm_config.log_level).to eq(:debug)\n end\n\n it \"sets info log level when debug is false\" do\n allow(RubyLLM).to receive(:configure).and_yield(mock_ruby_llm_config)\n\n described_class.configure do |config|\n config.debug = false\n end\n\n expect(mock_ruby_llm_config.log_level).to eq(:info)\n end\n\n it \"returns the configuration instance\" do\n result = described_class.configure {}\n expect(result).to be_a(Agents::Configuration)\n end\n end\nend\n\nRSpec.describe Agents::Configuration do\n let(:config) { described_class.new }\n\n describe \"#initialize\" do\n it \"sets default values\" do\n expect(config.default_model).to eq(\"gpt-4o-mini\")\n expect(config.request_timeout).to eq(120)\n expect(config.debug).to be false\n end\n\n it \"initializes API keys as nil\" do\n expect(config.openai_api_key).to be_nil\n expect(config.anthropic_api_key).to be_nil\n expect(config.gemini_api_key).to be_nil\n end\n end\n\n describe \"attribute accessors\" do\n it \"allows setting and getting openai_api_key\" do\n config.openai_api_key = \"test-openai-key\"\n expect(config.openai_api_key).to eq(\"test-openai-key\")\n end\n\n it \"allows setting and getting anthropic_api_key\" do\n config.anthropic_api_key = \"test-anthropic-key\"\n expect(config.anthropic_api_key).to eq(\"test-anthropic-key\")\n end\n\n it \"allows setting and getting gemini_api_key\" do\n config.gemini_api_key = \"test-gemini-key\"\n expect(config.gemini_api_key).to eq(\"test-gemini-key\")\n end\n\n it \"allows setting and getting request_timeout\" do\n config.request_timeout = 300\n expect(config.request_timeout).to eq(300)\n end\n\n it \"allows setting and getting default_model\" do\n config.default_model = \"gpt-4\"\n expect(config.default_model).to eq(\"gpt-4\")\n end\n\n it \"allows setting and getting debug\" do\n config.debug = true\n expect(config.debug).to be true\n end\n end\n\n describe \"#configured?\" do\n it \"returns false when no API keys are set\" do\n expect(config).not_to be_configured\n end\n\n it \"returns truthy when openai_api_key is set\" do\n config.openai_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when anthropic_api_key is set\" do\n config.anthropic_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when gemini_api_key is set\" do\n config.gemini_api_key = \"test-key\"\n expect(config).to be_configured\n end\n\n it \"returns truthy when multiple API keys are set\" do\n config.openai_api_key = \"openai-key\"\n config.anthropic_api_key = \"anthropic-key\"\n expect(config).to be_configured\n end\n end\nend\n"}}}}