Class: Copilot::ProviderConfig

Inherits:
Struct
  • Object
show all
Defined in:
lib/copilot/types.rb

Overview

Custom API provider configuration (BYOK).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key

Returns:

  • (Object)

    the current value of api_key



185
186
187
# File 'lib/copilot/types.rb', line 185

def api_key
  @api_key
end

#azureObject

Returns the value of attribute azure

Returns:

  • (Object)

    the current value of azure



185
186
187
# File 'lib/copilot/types.rb', line 185

def azure
  @azure
end

#base_urlObject

Returns the value of attribute base_url

Returns:

  • (Object)

    the current value of base_url



185
186
187
# File 'lib/copilot/types.rb', line 185

def base_url
  @base_url
end

#bearer_tokenObject

Returns the value of attribute bearer_token

Returns:

  • (Object)

    the current value of bearer_token



185
186
187
# File 'lib/copilot/types.rb', line 185

def bearer_token
  @bearer_token
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



185
186
187
# File 'lib/copilot/types.rb', line 185

def type
  @type
end

#wire_apiObject

Returns the value of attribute wire_api

Returns:

  • (Object)

    the current value of wire_api



185
186
187
# File 'lib/copilot/types.rb', line 185

def wire_api
  @wire_api
end

Instance Method Details

#to_wireObject



189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/copilot/types.rb', line 189

def to_wire
  h = {}
  h[:type] = type if type
  h[:wireApi] = wire_api if wire_api
  h[:baseUrl] = base_url if base_url
  h[:apiKey] = api_key if api_key
  h[:bearerToken] = bearer_token if bearer_token
  if azure
    az = {}
    az[:apiVersion] = azure[:api_version] if azure[:api_version]
    h[:azure] = az unless az.empty?
  end
  h
end