Class: Exa::Client
- Inherits:
-
Internal::Transport::BaseClient
- Object
- Internal::Transport::BaseClient
- Exa::Client
- Defined in:
- lib/exa/client.rb
Constant Summary collapse
- DEFAULT_BASE_URL =
"https://api.exa.ai"
Constants inherited from Internal::Transport::BaseClient
Internal::Transport::BaseClient::DEFAULT_INITIAL_RETRY_DELAY, Internal::Transport::BaseClient::DEFAULT_MAX_RETRIES, Internal::Transport::BaseClient::DEFAULT_MAX_RETRY_DELAY, Internal::Transport::BaseClient::DEFAULT_TIMEOUT, Internal::Transport::BaseClient::PLATFORM_HEADERS
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#imports ⇒ Object
readonly
Returns the value of attribute imports.
-
#research ⇒ Object
readonly
Returns the value of attribute research.
-
#search ⇒ Object
readonly
Returns the value of attribute search.
-
#webhooks ⇒ Object
readonly
Returns the value of attribute webhooks.
-
#websets ⇒ Object
readonly
Returns the value of attribute websets.
Attributes inherited from Internal::Transport::BaseClient
#base_url, #headers, #initial_retry_delay, #max_retries, #max_retry_delay, #requester, #timeout
Instance Method Summary collapse
-
#initialize(api_key: ENV["EXA_API_KEY"], base_url: ENV["EXA_BASE_URL"] || DEFAULT_BASE_URL, **opts) ⇒ Client
constructor
A new instance of Client.
Methods inherited from Internal::Transport::BaseClient
Constructor Details
#initialize(api_key: ENV["EXA_API_KEY"], base_url: ENV["EXA_BASE_URL"] || DEFAULT_BASE_URL, **opts) ⇒ Client
Returns a new instance of Client.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/exa/client.rb', line 9 def initialize( api_key: ENV["EXA_API_KEY"], base_url: ENV["EXA_BASE_URL"] || DEFAULT_BASE_URL, **opts ) raise Exa::Errors::ConfigurationError, "api_key is required" if api_key.nil? || api_key.empty? @api_key = api_key super(base_url: base_url, **opts) @search = Exa::Resources::Search.new(client: self) @research = Exa::Resources::Research.new(client: self) @websets = Exa::Resources::Websets.new(client: self) @events = Exa::Resources::Events.new(client: self) @webhooks = Exa::Resources::Webhooks.new(client: self) @imports = Exa::Resources::Imports.new(client: self) end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/exa/client.rb', line 7 def api_key @api_key end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
7 8 9 |
# File 'lib/exa/client.rb', line 7 def events @events end |
#imports ⇒ Object (readonly)
Returns the value of attribute imports.
7 8 9 |
# File 'lib/exa/client.rb', line 7 def imports @imports end |
#research ⇒ Object (readonly)
Returns the value of attribute research.
7 8 9 |
# File 'lib/exa/client.rb', line 7 def research @research end |
#search ⇒ Object (readonly)
Returns the value of attribute search.
7 8 9 |
# File 'lib/exa/client.rb', line 7 def search @search end |
#webhooks ⇒ Object (readonly)
Returns the value of attribute webhooks.
7 8 9 |
# File 'lib/exa/client.rb', line 7 def webhooks @webhooks end |
#websets ⇒ Object (readonly)
Returns the value of attribute websets.
7 8 9 |
# File 'lib/exa/client.rb', line 7 def websets @websets end |