Class: ActivePinecone::Configuration

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_modelObject

Returns the value of attribute chat_model.



18
19
20
# File 'lib/active_pinecone.rb', line 18

def chat_model
  @chat_model
end

#dimensionObject

Returns the value of attribute dimension.



18
19
20
# File 'lib/active_pinecone.rb', line 18

def dimension
  @dimension
end

#embedding_modelObject

Returns the value of attribute embedding_model.



18
19
20
# File 'lib/active_pinecone.rb', line 18

def embedding_model
  @embedding_model
end

#metricsObject

Returns the value of attribute metrics.



18
19
20
# File 'lib/active_pinecone.rb', line 18

def metrics
  @metrics
end

#openai_access_tokenObject

Raises:



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_timeoutObject

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_keyObject

Raises:



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_environmentObject

Raises:



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