Class: Contai::Providers::N8N

Inherits:
HTTP
  • Object
show all
Defined in:
lib/contai/providers/n8n.rb

Instance Method Summary collapse

Methods inherited from HTTP

#generate

Methods inherited from Base

#generate

Constructor Details

#initialize(options = {}) ⇒ N8N

Returns a new instance of N8N.



4
5
6
7
8
9
10
11
12
13
# File 'lib/contai/providers/n8n.rb', line 4

def initialize(options = {})
  webhook_url = options[:webhook_url] || raise(ArgumentError, "N8N provider requires :webhook_url")
  
  super({
    url: webhook_url,
    method: :post,
    body_template: { prompt: "{{prompt}}" },
    response_path: options[:response_path] || "output"
  }.merge(options))
end