Class: Maglev::Configuration
- Inherits:
-
Object
- Object
- Maglev::Configuration
- Defined in:
- lib/maglev/configuration.rb
Instance Attribute Summary collapse
-
#attachment_allowed_content_types ⇒ Object
Returns the value of attribute attachment_allowed_content_types.
-
#attachment_extractor ⇒ Object
Returns the value of attribute attachment_extractor.
-
#attachment_max_bytes ⇒ Object
Returns the value of attribute attachment_max_bytes.
-
#attachment_max_characters ⇒ Object
Returns the value of attribute attachment_max_characters.
-
#authorization_adapter ⇒ Object
Returns the value of attribute authorization_adapter.
-
#chunk_size ⇒ Object
Returns the value of attribute chunk_size.
-
#context_max_characters ⇒ Object
Returns the value of attribute context_max_characters.
-
#context_per_owner_characters ⇒ Object
Returns the value of attribute context_per_owner_characters.
-
#embedding_adapter ⇒ Object
Returns the value of attribute embedding_adapter.
-
#explain_question ⇒ Object
Returns the value of attribute explain_question.
-
#generation_adapter ⇒ Object
Returns the value of attribute generation_adapter.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_relation_depth ⇒ Object
Returns the value of attribute max_relation_depth.
-
#provider_max_attempts ⇒ Object
Returns the value of attribute provider_max_attempts.
-
#provider_timeout ⇒ Object
Returns the value of attribute provider_timeout.
-
#source_redactor ⇒ Object
Returns the value of attribute source_redactor.
-
#vector_store ⇒ Object
Returns the value of attribute vector_store.
Instance Method Summary collapse
- #embedding_dimensions ⇒ Object
- #embedding_dimensions=(dimensions) ⇒ Object
- #embedding_model ⇒ Object
- #embedding_model=(model) ⇒ Object
- #embedding_provider {|@embedding_provider| ... } ⇒ Object
- #generation_model ⇒ Object
- #generation_model=(model) ⇒ Object
- #generation_provider {|@generation_provider| ... } ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/maglev/configuration.rb', line 25 def initialize @embedding_provider = ProviderConfiguration.new( url: "https://api.openai.com/v1", model: "text-embedding-3-small", dimensions: 1536 ) @generation_provider = ProviderConfiguration.new( url: "https://api.openai.com/v1", model: "gpt-4.1-mini" ) @chunk_size = 1000 @context_max_characters = 4000 @context_per_owner_characters = 1200 @explain_question = "Explain what the available knowledge says about this record." @max_relation_depth = 3 @attachment_allowed_content_types = ["text/plain", "text/markdown", "text/html", "application/xhtml+xml"] @attachment_max_bytes = 5 * 1024 * 1024 @attachment_max_characters = 20_000 @provider_max_attempts = 2 @provider_timeout = 30 @source_redactor = nil end |
Instance Attribute Details
#attachment_allowed_content_types ⇒ Object
Returns the value of attribute attachment_allowed_content_types.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def @attachment_allowed_content_types end |
#attachment_extractor ⇒ Object
Returns the value of attribute attachment_extractor.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def @attachment_extractor end |
#attachment_max_bytes ⇒ Object
Returns the value of attribute attachment_max_bytes.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def @attachment_max_bytes end |
#attachment_max_characters ⇒ Object
Returns the value of attribute attachment_max_characters.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def @attachment_max_characters end |
#authorization_adapter ⇒ Object
Returns the value of attribute authorization_adapter.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def @authorization_adapter end |
#chunk_size ⇒ Object
Returns the value of attribute chunk_size.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def chunk_size @chunk_size end |
#context_max_characters ⇒ Object
Returns the value of attribute context_max_characters.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def context_max_characters @context_max_characters end |
#context_per_owner_characters ⇒ Object
Returns the value of attribute context_per_owner_characters.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def context_per_owner_characters @context_per_owner_characters end |
#embedding_adapter ⇒ Object
Returns the value of attribute embedding_adapter.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def @embedding_adapter end |
#explain_question ⇒ Object
Returns the value of attribute explain_question.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def explain_question @explain_question end |
#generation_adapter ⇒ Object
Returns the value of attribute generation_adapter.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def generation_adapter @generation_adapter end |
#logger ⇒ Object
Returns the value of attribute logger.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def logger @logger end |
#max_relation_depth ⇒ Object
Returns the value of attribute max_relation_depth.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def max_relation_depth @max_relation_depth end |
#provider_max_attempts ⇒ Object
Returns the value of attribute provider_max_attempts.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def provider_max_attempts @provider_max_attempts end |
#provider_timeout ⇒ Object
Returns the value of attribute provider_timeout.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def provider_timeout @provider_timeout end |
#source_redactor ⇒ Object
Returns the value of attribute source_redactor.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def source_redactor @source_redactor end |
#vector_store ⇒ Object
Returns the value of attribute vector_store.
17 18 19 |
# File 'lib/maglev/configuration.rb', line 17 def vector_store @vector_store end |
Instance Method Details
#embedding_dimensions ⇒ Object
64 |
# File 'lib/maglev/configuration.rb', line 64 def = @embedding_provider.dimensions |
#embedding_dimensions=(dimensions) ⇒ Object
66 67 68 |
# File 'lib/maglev/configuration.rb', line 66 def (dimensions) @embedding_provider.dimensions = dimensions end |
#embedding_model ⇒ Object
58 |
# File 'lib/maglev/configuration.rb', line 58 def = @embedding_provider.model |
#embedding_model=(model) ⇒ Object
60 61 62 |
# File 'lib/maglev/configuration.rb', line 60 def (model) @embedding_provider.model = model end |
#embedding_provider {|@embedding_provider| ... } ⇒ Object
48 49 50 51 |
# File 'lib/maglev/configuration.rb', line 48 def yield @embedding_provider if block_given? @embedding_provider end |
#generation_model ⇒ Object
70 |
# File 'lib/maglev/configuration.rb', line 70 def generation_model = @generation_provider.model |
#generation_model=(model) ⇒ Object
72 73 74 |
# File 'lib/maglev/configuration.rb', line 72 def generation_model=(model) @generation_provider.model = model end |
#generation_provider {|@generation_provider| ... } ⇒ Object
53 54 55 56 |
# File 'lib/maglev/configuration.rb', line 53 def generation_provider yield @generation_provider if block_given? @generation_provider end |