Class: Copilot::ProviderConfig
- Inherits:
-
Struct
- Object
- Struct
- Copilot::ProviderConfig
- Defined in:
- lib/copilot/types.rb
Overview
Custom API provider configuration (BYOK).
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#azure ⇒ Object
Returns the value of attribute azure.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#bearer_token ⇒ Object
Returns the value of attribute bearer_token.
-
#type ⇒ Object
Returns the value of attribute type.
-
#wire_api ⇒ Object
Returns the value of attribute wire_api.
Instance Method Summary collapse
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key
185 186 187 |
# File 'lib/copilot/types.rb', line 185 def api_key @api_key end |
#azure ⇒ Object
Returns the value of attribute azure
185 186 187 |
# File 'lib/copilot/types.rb', line 185 def azure @azure end |
#base_url ⇒ Object
Returns the value of attribute base_url
185 186 187 |
# File 'lib/copilot/types.rb', line 185 def base_url @base_url end |
#bearer_token ⇒ Object
Returns the value of attribute bearer_token
185 186 187 |
# File 'lib/copilot/types.rb', line 185 def bearer_token @bearer_token end |
#type ⇒ Object
Returns the value of attribute type
185 186 187 |
# File 'lib/copilot/types.rb', line 185 def type @type end |
#wire_api ⇒ Object
Returns the value of attribute wire_api
185 186 187 |
# File 'lib/copilot/types.rb', line 185 def wire_api @wire_api end |
Instance Method Details
#to_wire ⇒ Object
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 |