Class: Assistant::ChatService::Result

Inherits:
Data
  • Object
show all
Defined in:
app/services/assistant/chat_service.rb

Overview

Result object containing response and usage stats (immutable)
Includes model_reason for auto-selection and thinking_text for extended reasoning traces

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content: nil, model: nil, input_tokens: nil, output_tokens: nil, cached_tokens: nil, cache_creation_tokens: nil, response_time: nil, model_reason: nil, thinking_text: nil, tool_limit_reached: false, tool_stats: {}) ⇒ Result

Returns a new instance of Result.



301
# File 'app/services/assistant/chat_service.rb', line 301

def initialize(content: nil, model: nil, input_tokens: nil, output_tokens: nil, cached_tokens: nil, cache_creation_tokens: nil, response_time: nil, model_reason: nil, thinking_text: nil, tool_limit_reached: false, tool_stats: {}) = super

Instance Attribute Details

#cache_creation_tokensObject (readonly)

Returns the value of attribute cache_creation_tokens

Returns:

  • (Object)

    the current value of cache_creation_tokens



288
289
290
# File 'app/services/assistant/chat_service.rb', line 288

def cache_creation_tokens
  @cache_creation_tokens
end

#cached_tokensObject (readonly)

Returns the value of attribute cached_tokens

Returns:

  • (Object)

    the current value of cached_tokens



288
289
290
# File 'app/services/assistant/chat_service.rb', line 288

def cached_tokens
  @cached_tokens
end

#contentObject (readonly)

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



288
289
290
# File 'app/services/assistant/chat_service.rb', line 288

def content
  @content
end

#input_tokensObject (readonly)

Returns the value of attribute input_tokens

Returns:

  • (Object)

    the current value of input_tokens



288
289
290
# File 'app/services/assistant/chat_service.rb', line 288

def input_tokens
  @input_tokens
end

#modelObject (readonly)

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



288
289
290
# File 'app/services/assistant/chat_service.rb', line 288

def model
  @model
end

#model_reasonObject (readonly)

Returns the value of attribute model_reason

Returns:

  • (Object)

    the current value of model_reason



288
289
290
# File 'app/services/assistant/chat_service.rb', line 288

def model_reason
  @model_reason
end

#output_tokensObject (readonly)

Returns the value of attribute output_tokens

Returns:

  • (Object)

    the current value of output_tokens



288
289
290
# File 'app/services/assistant/chat_service.rb', line 288

def output_tokens
  @output_tokens
end

#response_timeObject (readonly)

Returns the value of attribute response_time

Returns:

  • (Object)

    the current value of response_time



288
289
290
# File 'app/services/assistant/chat_service.rb', line 288

def response_time
  @response_time
end

#thinking_textObject (readonly)

Returns the value of attribute thinking_text

Returns:

  • (Object)

    the current value of thinking_text



288
289
290
# File 'app/services/assistant/chat_service.rb', line 288

def thinking_text
  @thinking_text
end

#tool_limit_reachedObject (readonly)

Returns the value of attribute tool_limit_reached

Returns:

  • (Object)

    the current value of tool_limit_reached



288
289
290
# File 'app/services/assistant/chat_service.rb', line 288

def tool_limit_reached
  @tool_limit_reached
end

#tool_statsObject (readonly)

Returns the value of attribute tool_stats

Returns:

  • (Object)

    the current value of tool_stats



288
289
290
# File 'app/services/assistant/chat_service.rb', line 288

def tool_stats
  @tool_stats
end