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.
effort: valid values are "low", "medium", and "high"; sets the reasoning budget for the run (every level runs spark-2).
Constant Summary collapse
- FIELDS =
%i[ urls prompt schema integration max_credits strict_constrain_to_urls model effort webhook audit_metadata ].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.
17 18 19 20 21 22 23 |
# File 'lib/firecrawl/models/agent_options.rb', line 17 def initialize(**kwargs) FIELDS.each { |f| instance_variable_set(:"@#{f}", kwargs[f]) } if && !.is_a?(AuditMetadata) raise ArgumentError, "audit_metadata must be an AuditMetadata" end raise ArgumentError, "Agent prompt is required" if prompt.nil? || prompt.empty? end |
Instance Method Details
#to_h ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/firecrawl/models/agent_options.rb', line 25 def to_h { "urls" => urls, "prompt" => prompt, "schema" => schema, "integration" => integration, "maxCredits" => max_credits, "strictConstrainToURLs" => strict_constrain_to_urls, "model" => model, "effort" => effort, "webhook" => webhook.is_a?(Hash) ? webhook : webhook&.to_h, "auditMetadata" => &.to_h, }.compact end |