Class: Firecrawl::Models::AgentOptions
- Inherits:
-
Object
- Object
- Firecrawl::Models::AgentOptions
- Defined in:
- lib/firecrawl/models/agent_options.rb
Overview
Options for starting an agent task.
Constant Summary collapse
- FIELDS =
%i[ urls prompt schema integration max_credits strict_constrain_to_urls model webhook ].freeze
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ AgentOptions
constructor
A new instance of AgentOptions.
- #to_h ⇒ Object
Constructor Details
#initialize(**kwargs) ⇒ AgentOptions
Returns a new instance of AgentOptions.
14 15 16 17 |
# File 'lib/firecrawl/models/agent_options.rb', line 14 def initialize(**kwargs) FIELDS.each { |f| instance_variable_set(:"@#{f}", kwargs[f]) } raise ArgumentError, "Agent prompt is required" if prompt.nil? || prompt.empty? end |
Instance Method Details
#to_h ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/firecrawl/models/agent_options.rb', line 19 def to_h { "urls" => urls, "prompt" => prompt, "schema" => schema, "integration" => integration, "maxCredits" => max_credits, "strictConstrainToURLs" => strict_constrain_to_urls, "model" => model, "webhook" => webhook.is_a?(Hash) ? webhook : webhook&.to_h, }.compact end |