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



313
314
315
# File 'lib/copilot/types.rb', line 313

def api_key
  @api_key
end

#azureObject

Returns the value of attribute azure

Returns:

  • (Object)

    the current value of azure



313
314
315
# File 'lib/copilot/types.rb', line 313

def azure
  @azure
end

#base_urlObject

Returns the value of attribute base_url

Returns:

  • (Object)

    the current value of base_url



313
314
315
# File 'lib/copilot/types.rb', line 313

def base_url
  @base_url
end

#bearer_tokenObject

Returns the value of attribute bearer_token

Returns:

  • (Object)

    the current value of bearer_token



313
314
315
# File 'lib/copilot/types.rb', line 313

def bearer_token
  @bearer_token
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



313
314
315
# File 'lib/copilot/types.rb', line 313

def type
  @type
end

#wire_apiObject

Returns the value of attribute wire_api

Returns:

  • (Object)

    the current value of wire_api



313
314
315
# File 'lib/copilot/types.rb', line 313

def wire_api
  @wire_api
end

Instance Method Details

#to_wireObject



317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/copilot/types.rb', line 317

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