class OpenAI::Client
- OpenAI::Client
- Reference
- Object
Defined in:
openai/client.crConstructors
Instance Method Summary
- #api_key=(api_key : String)
- #completions(prompt : String | Nil = nil, max_tokens : Int32 | Nil = nil, temperature : Float64 | Nil = nil, top_p : Int | Float64 | Nil = nil, n : Int32 | Nil = nil, logprobs : Int32 | Nil = nil, echo : Bool | Nil = nil, stop : String | Nil | Array(String) = nil, presence_penalty : Float64 | Nil = nil, frequency_penalty : Float64 | Nil = nil, engine : String = default_engine, username : String = default_username)
- #completions(prompt : String | Nil = nil, max_tokens : Int32 | Nil = nil, temperature : Float64 | Nil = nil, top_p : Int | Float64 | Nil = nil, n : Int32 | Nil = nil, logprobs : Int32 | Nil = nil, echo : Bool | Nil = nil, stop : String | Nil | Array(String) = nil, presence_penalty : Float64 | Nil = nil, frequency_penalty : Float64 | Nil = nil, engine : String = default_engine, username : String = default_username, &block : Completion -> _)
- #default_engine : String
- #default_engine=(default_engine : String)
- #default_username : String
- #default_username=(default_username : String)
- #engine(id : String = default_engine)
- #engines
- #filter(prompt : String, username : String = default_username)
- #last_response : LastResponse | Nil
- #search(documents : Array(String), query : String, engine : String = default_engine)
Constructor Detail
def self.new(api_key : String, default_username : String = "testuser", default_engine : String = "davinci")
#
Instance Method Detail
def completions(prompt : String | Nil = nil, max_tokens : Int32 | Nil = nil, temperature : Float64 | Nil = nil, top_p : Int | Float64 | Nil = nil, n : Int32 | Nil = nil, logprobs : Int32 | Nil = nil, echo : Bool | Nil = nil, stop : String | Nil | Array(String) = nil, presence_penalty : Float64 | Nil = nil, frequency_penalty : Float64 | Nil = nil, engine : String = default_engine, username : String = default_username)
#
def completions(prompt : String | Nil = nil, max_tokens : Int32 | Nil = nil, temperature : Float64 | Nil = nil, top_p : Int | Float64 | Nil = nil, n : Int32 | Nil = nil, logprobs : Int32 | Nil = nil, echo : Bool | Nil = nil, stop : String | Nil | Array(String) = nil, presence_penalty : Float64 | Nil = nil, frequency_penalty : Float64 | Nil = nil, engine : String = default_engine, username : String = default_username, &block : Completion -> _)
#
def search(documents : Array(String), query : String, engine : String = default_engine)
#