Class: Leash::Integration::BraveSearchClient
- Inherits:
-
Object
- Object
- Leash::Integration::BraveSearchClient
- Defined in:
- lib/leash/integration/brave-search.rb
Instance Method Summary collapse
-
#brave_local_search(query, count: nil) ⇒ Object
Searches for local businesses and places using Brave’s Local Search API.
-
#brave_web_search(query, count: nil, offset: nil) ⇒ Object
Performs a web search using the Brave Search API, ideal for general queries, news, articles, and online content.
-
#initialize(leash) ⇒ BraveSearchClient
constructor
Create a new Brave Search integration client.
Constructor Details
#initialize(leash) ⇒ BraveSearchClient
Create a new Brave Search integration client.
11 12 13 |
# File 'lib/leash/integration/brave-search.rb', line 11 def initialize(leash) @leash = leash end |
Instance Method Details
#brave_local_search(query, count: nil) ⇒ Object
Searches for local businesses and places using Brave’s Local Search API. Best for queries related to physical locations, businesses, restaurants, services, etc. Returns detailed information includi…
35 36 37 38 39 40 41 |
# File 'lib/leash/integration/brave-search.rb', line 35 def brave_local_search(query, count: nil) params = { 'query' => query, 'count' => count }.compact @leash.call('brave-search', 'brave_local_search', params) end |
#brave_web_search(query, count: nil, offset: nil) ⇒ Object
Performs a web search using the Brave Search API, ideal for general queries, news, articles, and online content. Use this for broad information gathering, recent events, or when you need diverse we…
21 22 23 24 25 26 27 28 |
# File 'lib/leash/integration/brave-search.rb', line 21 def brave_web_search(query, count: nil, offset: nil) params = { 'query' => query, 'count' => count, 'offset' => offset }.compact @leash.call('brave-search', 'brave_web_search', params) end |