Class: Tep::Llm::OpenAI::Sampling

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

Overview

Sampling parameters handed to the backend. v1 carries max_tokens + temperature + top_p (the three OpenAI completion knobs every client sets). Floats parsed via Tep::Json.get_float. Defaults match OpenAI’s API defaults so a backend that ignores sampling gets pass-through behavior.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSampling

Returns a new instance of Sampling.



252
253
254
255
256
# File 'lib/tep/openai_server.rb', line 252

def initialize
  @max_tokens  = 0
  @temperature = 1.0
  @top_p       = 1.0
end

Instance Attribute Details

#max_tokensObject

Returns the value of attribute max_tokens.



250
251
252
# File 'lib/tep/openai_server.rb', line 250

def max_tokens
  @max_tokens
end

#temperatureObject

Returns the value of attribute temperature.



250
251
252
# File 'lib/tep/openai_server.rb', line 250

def temperature
  @temperature
end

#top_pObject

Returns the value of attribute top_p.



250
251
252
# File 'lib/tep/openai_server.rb', line 250

def top_p
  @top_p
end