Class: Exa::Services::AgentRunGet
- Inherits:
-
Object
- Object
- Exa::Services::AgentRunGet
- Defined in:
- lib/exa/services/agent_run_get.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(connection, run_id:, **params) ⇒ AgentRunGet
constructor
A new instance of AgentRunGet.
Constructor Details
#initialize(connection, run_id:, **params) ⇒ AgentRunGet
Returns a new instance of AgentRunGet.
8 9 10 11 12 |
# File 'lib/exa/services/agent_run_get.rb', line 8 def initialize(connection, run_id:, **params) @connection = connection @run_id = run_id @params = params end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/exa/services/agent_run_get.rb', line 14 def call response = @connection.get("/agent/runs/#{@run_id}", @params) body = response.body Resources::AgentRun.new( id: body["id"], object: body["object"], status: body["status"], stop_reason: body["stopReason"], created_at: body["createdAt"], completed_at: body["completedAt"], request: body["request"], output: body["output"], usage: body["usage"], cost_dollars: body["costDollars"] ) end |