Module: Ragents
- Defined in:
- lib/ragents.rb,
lib/ragents/tool.rb,
lib/ragents/agent.rb,
lib/ragents/context.rb,
lib/ragents/message.rb,
lib/ragents/railtie.rb,
lib/ragents/version.rb,
lib/ragents/provider.rb,
lib/ragents/orchestrator.rb,
lib/ragents/providers/test.rb,
lib/ragents/providers/ruby_llm.rb
Overview
Ragents - A Ractor-based AI agent framework
Ragents provides concurrent, isolated agent execution using Ruby’s Ractor primitive. It uses RubyLLM as the LLM backend, giving access to 500+ models across all major providers (OpenAI, Anthropic, Gemini, Ollama, etc.)
Defined Under Namespace
Modules: Providers Classes: Agent, Configuration, Context, Error, MaxIterationsError, Message, Orchestrator, Provider, Railtie, Response, SupervisorError, Tool, ToolCall, ToolRegistry, Workflow
Constant Summary collapse
- VERSION =
"0.2.0"
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns the value of attribute configuration.
Class Method Summary collapse
- .configure {|configuration| ... } ⇒ Object
-
.execute_on_main(&block) ⇒ Object
Execute a block on the main thread from within a Ractor This is used for operations that can’t run in Ractors.
- .provider(name) ⇒ Object
-
.providers ⇒ Object
Default provider registry.
- .register_provider(name, provider) ⇒ Object
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
35 36 37 |
# File 'lib/ragents.rb', line 35 def configuration @configuration end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
37 38 39 40 41 |
# File 'lib/ragents.rb', line 37 def configure self.configuration ||= Configuration.new yield(configuration) if block_given? configuration end |
.execute_on_main(&block) ⇒ Object
Execute a block on the main thread from within a Ractor This is used for operations that can’t run in Ractors
45 46 47 48 49 50 51 |
# File 'lib/ragents.rb', line 45 def execute_on_main(&block) if Ractor.current == Ractor.main block.call else raise Error, "Main thread execution from Ractor requires setup of main_executor" end end |
.provider(name) ⇒ Object
62 63 64 |
# File 'lib/ragents.rb', line 62 def provider(name) providers[name.to_sym] end |
.providers ⇒ Object
Default provider registry
54 55 56 |
# File 'lib/ragents.rb', line 54 def providers @providers ||= {} end |
.register_provider(name, provider) ⇒ Object
58 59 60 |
# File 'lib/ragents.rb', line 58 def register_provider(name, provider) providers[name.to_sym] = provider end |