Class: Exa::Services::ResearchStart
- Inherits:
-
Object
- Object
- Exa::Services::ResearchStart
- Defined in:
- lib/exa/services/research_start.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(connection, **params) ⇒ ResearchStart
constructor
A new instance of ResearchStart.
Constructor Details
#initialize(connection, **params) ⇒ ResearchStart
Returns a new instance of ResearchStart.
6 7 8 9 |
# File 'lib/exa/services/research_start.rb', line 6 def initialize(connection, **params) @connection = connection @params = params end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/exa/services/research_start.rb', line 11 def call response = @connection.post("/research/v1", @params) body = response.body Resources::ResearchTask.new( research_id: body["researchId"], created_at: body["createdAt"], status: body["status"], instructions: body["instructions"], model: body["model"], output_schema: body["outputSchema"] ) end |