Class: Soka::LLMs::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/soka/llms/base.rb

Overview

Result structure for LLM responses

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



6
7
8
# File 'lib/soka/llms/base.rb', line 6

def content
  @content
end

#finish_reasonObject

Returns the value of attribute finish_reason

Returns:

  • (Object)

    the current value of finish_reason



6
7
8
# File 'lib/soka/llms/base.rb', line 6

def finish_reason
  @finish_reason
end

#input_tokensObject

Returns the value of attribute input_tokens

Returns:

  • (Object)

    the current value of input_tokens



6
7
8
# File 'lib/soka/llms/base.rb', line 6

def input_tokens
  @input_tokens
end

#modelObject

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



6
7
8
# File 'lib/soka/llms/base.rb', line 6

def model
  @model
end

#output_tokensObject

Returns the value of attribute output_tokens

Returns:

  • (Object)

    the current value of output_tokens



6
7
8
# File 'lib/soka/llms/base.rb', line 6

def output_tokens
  @output_tokens
end

#raw_responseObject

Returns the value of attribute raw_response

Returns:

  • (Object)

    the current value of raw_response



6
7
8
# File 'lib/soka/llms/base.rb', line 6

def raw_response
  @raw_response
end

Instance Method Details

#successful?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/soka/llms/base.rb', line 8

def successful?
  !content.nil? && !content.empty?
end