Class: DSPy::Registry::SignatureRegistry::RegistryConfig

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dspy/registry/signature_registry.rb

Overview

Configuration for the registry

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRegistryConfig

Returns a new instance of RegistryConfig.



174
175
176
177
178
179
180
181
# File 'lib/dspy/registry/signature_registry.rb', line 174

def initialize
  @registry_path = "./dspy_registry"
  @config_file = "registry.yml"
  @auto_version = true
  @max_versions_per_signature = 10
  @backup_on_deploy = true
  @version_format = "v%Y%m%d_%H%M%S" # timestamp-based versions
end

Instance Attribute Details

#auto_versionObject

Returns the value of attribute auto_version.



162
163
164
# File 'lib/dspy/registry/signature_registry.rb', line 162

def auto_version
  @auto_version
end

#backup_on_deployObject

Returns the value of attribute backup_on_deploy.



168
169
170
# File 'lib/dspy/registry/signature_registry.rb', line 168

def backup_on_deploy
  @backup_on_deploy
end

#config_fileObject

Returns the value of attribute config_file.



159
160
161
# File 'lib/dspy/registry/signature_registry.rb', line 159

def config_file
  @config_file
end

#max_versions_per_signatureObject

Returns the value of attribute max_versions_per_signature.



165
166
167
# File 'lib/dspy/registry/signature_registry.rb', line 165

def max_versions_per_signature
  @max_versions_per_signature
end

#registry_pathObject

Returns the value of attribute registry_path.



156
157
158
# File 'lib/dspy/registry/signature_registry.rb', line 156

def registry_path
  @registry_path
end

#version_formatObject

Returns the value of attribute version_format.



171
172
173
# File 'lib/dspy/registry/signature_registry.rb', line 171

def version_format
  @version_format
end

Instance Method Details

#from_h(data) ⇒ Object



196
197
198
199
200
201
202
203
# File 'lib/dspy/registry/signature_registry.rb', line 196

def from_h(data)
  @registry_path = data[:registry_path] if data[:registry_path]
  @config_file = data[:config_file] if data[:config_file]
  @auto_version = data[:auto_version] if data.key?(:auto_version)
  @max_versions_per_signature = data[:max_versions_per_signature] if data[:max_versions_per_signature]
  @backup_on_deploy = data[:backup_on_deploy] if data.key?(:backup_on_deploy)
  @version_format = data[:version_format] if data[:version_format]
end

#to_hObject



184
185
186
187
188
189
190
191
192
193
# File 'lib/dspy/registry/signature_registry.rb', line 184

def to_h
  {
    registry_path: @registry_path,
    config_file: @config_file,
    auto_version: @auto_version,
    max_versions_per_signature: @max_versions_per_signature,
    backup_on_deploy: @backup_on_deploy,
    version_format: @version_format
  }
end