Class: ActionAgent::AgentExecutions::Row

Inherits:
Struct
  • Object
show all
Defined in:
app/queries/action_agent/agent_executions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#action_nameObject

Returns the value of attribute action_name

Returns:

  • (Object)

    the current value of action_name



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def action_name
  @action_name
end

#agent_idObject

Returns the value of attribute agent_id

Returns:

  • (Object)

    the current value of agent_id



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def agent_id
  @agent_id
end

#costObject

Returns the value of attribute cost

Returns:

  • (Object)

    the current value of cost



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def cost
  @cost
end

#duration_msObject

Returns the value of attribute duration_ms

Returns:

  • (Object)

    the current value of duration_ms



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def duration_ms
  @duration_ms
end

#error_messageObject

Returns the value of attribute error_message

Returns:

  • (Object)

    the current value of error_message



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def error_message
  @error_message
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def id
  @id
end

#input_previewObject

Returns the value of attribute input_preview

Returns:

  • (Object)

    the current value of input_preview



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def input_preview
  @input_preview
end

#input_tokensObject

Returns the value of attribute input_tokens

Returns:

  • (Object)

    the current value of input_tokens



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def input_tokens
  @input_tokens
end

#modelObject

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def model
  @model
end

#occurred_atObject

Returns the value of attribute occurred_at

Returns:

  • (Object)

    the current value of occurred_at



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def occurred_at
  @occurred_at
end

#output_previewObject

Returns the value of attribute output_preview

Returns:

  • (Object)

    the current value of output_preview



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def output_preview
  @output_preview
end

#output_tokensObject

Returns the value of attribute output_tokens

Returns:

  • (Object)

    the current value of output_tokens



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def output_tokens
  @output_tokens
end

#providerObject

Returns the value of attribute provider

Returns:

  • (Object)

    the current value of provider



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def provider
  @provider
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def source
  @source
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def status
  @status
end

#tokensObject

Returns the value of attribute tokens

Returns:

  • (Object)

    the current value of tokens



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def tokens
  @tokens
end

#trace_idObject

Returns the value of attribute trace_id

Returns:

  • (Object)

    the current value of trace_id



38
39
40
# File 'app/queries/action_agent/agent_executions.rb', line 38

def trace_id
  @trace_id
end

Instance Method Details

#as_jsonObject



45
46
47
# File 'app/queries/action_agent/agent_executions.rb', line 45

def as_json(*)
  to_h.transform_values { |value| value.is_a?(Time) ? value.iso8601(3) : value }
end

#to_paramObject

Runs are addressable by record id; reported executions only by trace.



50
51
52
# File 'app/queries/action_agent/agent_executions.rb', line 50

def to_param
  source == "dashboard" ? id.to_s : "trace-#{id}"
end