Class: Tep::Llm::OpenAI::Sampling
- Inherits:
-
Object
- Object
- Tep::Llm::OpenAI::Sampling
- 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
-
#max_tokens ⇒ Object
Returns the value of attribute max_tokens.
-
#temperature ⇒ Object
Returns the value of attribute temperature.
-
#top_p ⇒ Object
Returns the value of attribute top_p.
Instance Method Summary collapse
-
#initialize ⇒ Sampling
constructor
A new instance of Sampling.
Constructor Details
#initialize ⇒ Sampling
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_tokens ⇒ Object
Returns the value of attribute max_tokens.
250 251 252 |
# File 'lib/tep/openai_server.rb', line 250 def max_tokens @max_tokens end |
#temperature ⇒ Object
Returns the value of attribute temperature.
250 251 252 |
# File 'lib/tep/openai_server.rb', line 250 def temperature @temperature end |
#top_p ⇒ Object
Returns the value of attribute top_p.
250 251 252 |
# File 'lib/tep/openai_server.rb', line 250 def top_p @top_p end |