struct AI::Provider::LanguageModel::CallOptions

Overview

Call options for language model.

Included Modules

Defined in:

ai/provider/language_model/call_options.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(prompt : Prompt, max_output_tokens : Int32 | Nil = nil, temperature : Float64 | Nil = nil, stop_sequences : Array(String) | Nil = nil, top_p : Float64 | Nil = nil, top_k : Int32 | Nil = nil, presence_penalty : Float64 | Nil = nil, frequency_penalty : Float64 | Nil = nil, response_format : ResponseFormat | Nil = nil, seed : Int32 | Nil = nil, tools : Array(Tool) | Nil = nil, tool_choice : ToolChoice | Nil = nil, include_raw_chunks : Bool | Nil = nil, headers : Shared::Headers | Nil = nil, provider_options : Shared::ProviderOptions | Nil = nil) #

[View source]
def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

[View source]

Instance Method Detail

def frequency_penalty : Float64 | Nil #

Frequency penalty.


[View source]
def headers : Shared::Headers | Nil #

Additional HTTP headers.


[View source]
def include_raw_chunks : Bool | Nil #

Include raw chunks in stream.


[View source]
def max_output_tokens : Int32 | Nil #

Maximum number of tokens to generate.


[View source]
def presence_penalty : Float64 | Nil #

Presence penalty.


[View source]
def prompt : Prompt #

The prompt to send to the model.


[View source]
def provider_options : Shared::ProviderOptions | Nil #

Provider-specific options.


[View source]
def response_format : ResponseFormat | Nil #

Response format.


[View source]
def seed : Int32 | Nil #

Random seed.


[View source]
def stop_sequences : Array(String) | Nil #

Stop sequences.


[View source]
def temperature : Float64 | Nil #

Temperature setting.


[View source]
def tool_choice : ToolChoice | Nil #

Tool choice.


[View source]
def tools : Array(Tool) | Nil #

Available tools.


[View source]
def top_k : Int32 | Nil #

Top K sampling.


[View source]
def top_p : Float64 | Nil #

Nucleus sampling.


[View source]