Class: ActivePinecone::Configuration
- Inherits:
-
Object
- Object
- ActivePinecone::Configuration
- Defined in:
- lib/active_pinecone.rb
Constant Summary collapse
- DEFAULT_DIMENTION =
1536
- DEFAULT_METRICS =
'cosine'
- DEFAULT_EMBEDDING_MODEL =
'text-embedding-ada-002'
- DEFAULT_CHAT_MODEL =
'gpt-3.5-turbo'
- DEFAULT_REQUEST_TIMEOUT =
120
Instance Attribute Summary collapse
-
#chat_model ⇒ Object
Returns the value of attribute chat_model.
-
#dimension ⇒ Object
Returns the value of attribute dimension.
-
#embedding_model ⇒ Object
Returns the value of attribute embedding_model.
-
#metrics ⇒ Object
Returns the value of attribute metrics.
- #openai_access_token ⇒ Object
-
#openai_request_timeout ⇒ Object
Returns the value of attribute openai_request_timeout.
- #pinecone_api_key ⇒ Object
- #pinecone_environment ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/active_pinecone.rb', line 27 def initialize @openai_access_token = nil @openai_request_timeout = DEFAULT_REQUEST_TIMEOUT @pinecone_api_key = nil @pinecone_environment = nil @embedding_model = DEFAULT_EMBEDDING_MODEL @chat_model = DEFAULT_CHAT_MODEL @dimension = DEFAULT_DIMENTION @metrics = DEFAULT_METRICS end |
Instance Attribute Details
#chat_model ⇒ Object
Returns the value of attribute chat_model.
18 19 20 |
# File 'lib/active_pinecone.rb', line 18 def chat_model @chat_model end |
#dimension ⇒ Object
Returns the value of attribute dimension.
18 19 20 |
# File 'lib/active_pinecone.rb', line 18 def dimension @dimension end |
#embedding_model ⇒ Object
Returns the value of attribute embedding_model.
18 19 20 |
# File 'lib/active_pinecone.rb', line 18 def @embedding_model end |
#metrics ⇒ Object
Returns the value of attribute metrics.
18 19 20 |
# File 'lib/active_pinecone.rb', line 18 def metrics @metrics end |
#openai_access_token ⇒ Object
38 39 40 41 42 |
# File 'lib/active_pinecone.rb', line 38 def openai_access_token return @openai_access_token if @openai_access_token raise ConfigurationError, 'OpenAI access token missing! See https://github.com/moekidev/actve_pinecone#usage' end |
#openai_request_timeout ⇒ Object
Returns the value of attribute openai_request_timeout.
18 19 20 |
# File 'lib/active_pinecone.rb', line 18 def openai_request_timeout @openai_request_timeout end |
#pinecone_api_key ⇒ Object
44 45 46 47 48 |
# File 'lib/active_pinecone.rb', line 44 def pinecone_api_key return @pinecone_api_key if @pinecone_api_key raise ConfigurationError, 'Pinecone API key missing! See https://github.com/moekidev/active_pinecone#usage' end |
#pinecone_environment ⇒ Object
50 51 52 53 54 |
# File 'lib/active_pinecone.rb', line 50 def pinecone_environment return @pinecone_environment if @pinecone_environment raise ConfigurationError, 'Pinecone environment missing! See https://github.com/moekidev/active_pinecone#usage' end |