Spaces:
Sleeping
Sleeping
Download apps/ruby-sdk/lib/firecrawl/models/agent_options.rb from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 888 Bytes
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/ruby-sdk/lib/firecrawl/models/agent_options.rb
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/ruby-sdk/lib/firecrawl/models/agent_options.rb
-
curl -L -o agent_options.rb https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/ruby-sdk/lib/firecrawl/models/agent_options.rb
888 Bytes
| # frozen_string_literal: true | |
| module Firecrawl | |
| module Models | |
| # Options for starting an agent task. | |
| class AgentOptions | |
| FIELDS = %i[ | |
| urls prompt schema integration max_credits | |
| strict_constrain_to_urls model webhook | |
| ].freeze | |
| attr_reader(*FIELDS) | |
| def initialize(**kwargs) | |
| FIELDS.each { |f| instance_variable_set(:"@#{f}", kwargs[f]) } | |
| raise ArgumentError, "Agent prompt is required" if prompt.nil? || prompt.empty? | |
| end | |
| 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 | |
| end | |
| end | |
| end | |