Class: Exa::Services::AgentRunEvents

Inherits:
Object
  • Object
show all
Defined in:
lib/exa/services/agent_run_events.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection, run_id:, **params) ⇒ AgentRunEvents

Returns a new instance of AgentRunEvents.



8
9
10
11
12
# File 'lib/exa/services/agent_run_events.rb', line 8

def initialize(connection, run_id:, **params)
  @connection = connection
  @run_id = run_id
  @params = params
end

Instance Method Details

#callObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/exa/services/agent_run_events.rb', line 14

def call
  response = @connection.get("/agent/runs/#{@run_id}/events", @params)
  body = response.body

  # Confirmed live: GET /agent/runs/{id}/events returns a paginated list
  # {object: "list", data: [...], hasMore, nextCursor}.
  Resources::AgentRunEventList.new(
    data: body["data"] || [],
    has_more: body["hasMore"],
    next_cursor: body["nextCursor"]
  )
end