Class: Tep::Llm::OpenAI::Completion

Inherits:
Object
  • Object
show all
Defined in:
lib/tep/openai_server.rb

Overview

A backend’s generation result: the decoded text + token usage.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCompletion

Returns a new instance of Completion.



263
264
265
266
267
# File 'lib/tep/openai_server.rb', line 263

def initialize
  @text              = ""
  @prompt_tokens     = 0
  @completion_tokens = 0
end

Instance Attribute Details

#completion_tokensObject

Returns the value of attribute completion_tokens.



261
262
263
# File 'lib/tep/openai_server.rb', line 261

def completion_tokens
  @completion_tokens
end

#prompt_tokensObject

Returns the value of attribute prompt_tokens.



261
262
263
# File 'lib/tep/openai_server.rb', line 261

def prompt_tokens
  @prompt_tokens
end

#textObject

Returns the value of attribute text.



261
262
263
# File 'lib/tep/openai_server.rb', line 261

def text
  @text
end