Module: RubyCoded::Auth::Providers::OpenAI

Defined in:
lib/ruby_coded/auth/providers/openai.rb

Overview

OpenAI provider’s configuration

Class Method Summary collapse

Class Method Details

.auth_methodsObject



16
17
18
19
20
21
22
23
# File 'lib/ruby_coded/auth/providers/openai.rb', line 16

def self.auth_methods
  [
    { key: :oauth,
      label: "With your OpenAI account (requires API credits, " \
             "your ChatGPT subscription does not cover API usage)" },
    { key: :api_key, label: "With an OpenAI API key (requires API credits at platform.openai.com)" }
  ]
end

.auth_urlObject



25
26
27
# File 'lib/ruby_coded/auth/providers/openai.rb', line 25

def self.auth_url
  "https://auth.openai.com/oauth/authorize"
end

.client_idObject



12
13
14
# File 'lib/ruby_coded/auth/providers/openai.rb', line 12

def self.client_id
  "app_EMoamEEZ73f0CkXaXp7hrann"
end

.console_urlObject



33
34
35
# File 'lib/ruby_coded/auth/providers/openai.rb', line 33

def self.console_url
  "https://platform.openai.com/account/api-keys"
end

.display_nameObject



8
9
10
# File 'lib/ruby_coded/auth/providers/openai.rb', line 8

def self.display_name
  "OpenAI"
end

.key_patternObject



37
38
39
# File 'lib/ruby_coded/auth/providers/openai.rb', line 37

def self.key_pattern
  /\Ask-/
end

.redirect_uriObject



41
42
43
# File 'lib/ruby_coded/auth/providers/openai.rb', line 41

def self.redirect_uri
  "http://localhost:1455/auth/callback"
end

.ruby_llm_keyObject



49
50
51
# File 'lib/ruby_coded/auth/providers/openai.rb', line 49

def self.ruby_llm_key
  :openai_api_key
end

.scopesObject



45
46
47
# File 'lib/ruby_coded/auth/providers/openai.rb', line 45

def self.scopes
  "offline_access"
end

.token_urlObject



29
30
31
# File 'lib/ruby_coded/auth/providers/openai.rb', line 29

def self.token_url
  "https://auth.openai.com/oauth/token"
end