Class: Cadenya::Models::AIProviderKeySpec

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/cadenya/models/ai_provider_key_spec.rb,
sig/cadenya/models/ai_provider_key_spec.rbs

Defined Under Namespace

Modules: Provider Classes: Config, Credentials

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(headers: nil) ⇒ Object

CredentialHeaders carries arbitrary HTTP headers sent with every request to the provider (e.g. "Bearer ...", "X-Api-Key": "...").

Parameters:

  • headers (Hash{Symbol=>String}) (defaults to: nil)


# File 'lib/cadenya/models/ai_provider_key_spec.rb', line 30

Instance Attribute Details

#configCadenya::Models::AIProviderKeySpec::Config?

AIProviderConfig holds non-secret, provider-specific settings. The set case must correspond to AIProviderKeySpec.provider. Providers with no settings (Anthropic, Gemini) simply leave this unset. The endpoint of a named provider is fixed and intentionally not overridable here; use the OpenAI-compatible provider to target a custom endpoint.



14
# File 'lib/cadenya/models/ai_provider_key_spec.rb', line 14

optional :config, -> { Cadenya::AIProviderKeySpec::Config }

#credentialsCadenya::Models::AIProviderKeySpec::Credentials?

AIProviderCredential is the secret material used to authenticate with a provider. The set case must correspond to AIProviderKeySpec.provider. The server encrypts the serialized message at rest and never returns it on reads.



22
# File 'lib/cadenya/models/ai_provider_key_spec.rb', line 22

optional :credentials, -> { Cadenya::AIProviderKeySpec::Credentials }

#providerSymbol, ...

The AI provider this key authenticates against.



28
# File 'lib/cadenya/models/ai_provider_key_spec.rb', line 28

optional :provider, enum: -> { Cadenya::AIProviderKeySpec::Provider }

Instance Method Details

#to_hash{

Returns:

  • ({)


35
# File 'sig/cadenya/models/ai_provider_key_spec.rbs', line 35

def to_hash: -> {