Class: RailsOrchestrator::Client
- Inherits:
-
Object
- Object
- RailsOrchestrator::Client
- Defined in:
- lib/rails_orchestrator/client.rb
Instance Method Summary collapse
- #chat(messages) ⇒ Object
-
#initialize(config: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(config: nil) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/rails_orchestrator/client.rb', line 9 def initialize(config: nil) @config = config || RailsOrchestrator.configuration end |
Instance Method Details
#chat(messages) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rails_orchestrator/client.rb', line 13 def chat() = .to_a if .is_a?(Conversation) = () body = { model: @config.model, messages: , stream: false } Response.new(post("/api/chat", body)) end |