Class: EmbeddingUtil::Configuration
- Inherits:
-
Object
- Object
- EmbeddingUtil::Configuration
- Defined in:
- lib/embedding_util/configuration.rb
Instance Attribute Summary collapse
-
#embedding_endpoint ⇒ Object
Returns the value of attribute embedding_endpoint.
-
#embedding_port ⇒ Object
Returns the value of attribute embedding_port.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#host ⇒ Object
Returns the value of attribute host.
-
#profile ⇒ Object
Returns the value of attribute profile.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#reranker_endpoint ⇒ Object
Returns the value of attribute reranker_endpoint.
-
#reranker_port ⇒ Object
Returns the value of attribute reranker_port.
-
#runtime ⇒ Object
Returns the value of attribute runtime.
-
#shutdown_idle ⇒ Object
Returns the value of attribute shutdown_idle.
-
#startup_timeout ⇒ Object
Returns the value of attribute startup_timeout.
-
#state_dir ⇒ Object
Returns the value of attribute state_dir.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
- #embedding_endpoint_url ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reranker_endpoint_url ⇒ Object
- #resolved_profile ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/embedding_util/configuration.rb', line 9 def initialize @profile = :small_multilingual_v1 @provider = :auto self.runtime = ENV.fetch("EMBEDDING_UTIL_RUNTIME", "auto") @endpoint = ENV["EMBEDDING_UTIL_ENDPOINT"] @embedding_endpoint = ENV["EMBEDDING_UTIL_EMBEDDING_ENDPOINT"] @reranker_endpoint = ENV["EMBEDDING_UTIL_RERANKER_ENDPOINT"] @timeout = Float(ENV.fetch("EMBEDDING_UTIL_TIMEOUT", "60")) @startup_timeout = Float(ENV.fetch("EMBEDDING_UTIL_STARTUP_TIMEOUT", "3600")) @shutdown_idle = Integer(ENV.fetch("EMBEDDING_UTIL_SHUTDOWN_IDLE", "300")) @host = ENV.fetch("EMBEDDING_UTIL_HOST", "127.0.0.1") @embedding_port = Integer(ENV.fetch("EMBEDDING_UTIL_EMBEDDING_PORT", "18080")) @reranker_port = Integer(ENV.fetch("EMBEDDING_UTIL_RERANKER_PORT", "18081")) @state_dir = ENV.fetch("EMBEDDING_UTIL_STATE_DIR", File.("~/.local/state/embedding_util")) @verbose = ENV.fetch("EMBEDDING_UTIL_VERBOSE", "false").match?(/\A(?:1|true|yes|on)\z/i) end |
Instance Attribute Details
#embedding_endpoint ⇒ Object
Returns the value of attribute embedding_endpoint.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def @embedding_endpoint end |
#embedding_port ⇒ Object
Returns the value of attribute embedding_port.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def @embedding_port end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def endpoint @endpoint end |
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def host @host end |
#profile ⇒ Object
Returns the value of attribute profile.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def profile @profile end |
#provider ⇒ Object
Returns the value of attribute provider.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def provider @provider end |
#reranker_endpoint ⇒ Object
Returns the value of attribute reranker_endpoint.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def reranker_endpoint @reranker_endpoint end |
#reranker_port ⇒ Object
Returns the value of attribute reranker_port.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def reranker_port @reranker_port end |
#runtime ⇒ Object
Returns the value of attribute runtime.
7 8 9 |
# File 'lib/embedding_util/configuration.rb', line 7 def runtime @runtime end |
#shutdown_idle ⇒ Object
Returns the value of attribute shutdown_idle.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def shutdown_idle @shutdown_idle end |
#startup_timeout ⇒ Object
Returns the value of attribute startup_timeout.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def startup_timeout @startup_timeout end |
#state_dir ⇒ Object
Returns the value of attribute state_dir.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def state_dir @state_dir end |
#timeout ⇒ Object
Returns the value of attribute timeout.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def timeout @timeout end |
#verbose ⇒ Object
Returns the value of attribute verbose.
5 6 7 |
# File 'lib/embedding_util/configuration.rb', line 5 def verbose @verbose end |
Instance Method Details
#embedding_endpoint_url ⇒ Object
34 35 36 |
# File 'lib/embedding_util/configuration.rb', line 34 def || endpoint end |
#reranker_endpoint_url ⇒ Object
38 39 40 |
# File 'lib/embedding_util/configuration.rb', line 38 def reranker_endpoint_url reranker_endpoint || endpoint end |