struct

Crig::Providers::ChatGPT::Client

Inherits Struct < Value < Object

Constructors

from_env
Source
from_val(token : String) : self
Source
new(access_token : String, account_id : String | Nil = nil, base_url : String = CHATGPT_API_BASE_URL, default_instructions : String | Nil = DEFAULT_INSTRUCTIONS, originator : String = DEFAULT_ORIGINATOR, user_agent : String = DEFAULT_USER_AGENT)
Source

Class methods

builder
Source

Instance methods

access_token
Source
account_id
Source
base_url
Source
build_uri(path : String) : String
Source
completion_model(model : String) : ResponsesCompletionModel
Source
oauth_authenticate(authenticator : OAuth::Authenticator) : Nil

Trigger the OAuth device-code flow. Resolves when user authorizes.

Source
post(path : String, body : String) : HTTP::Client::Response
Source