Class: BxBuilderChain::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/bx_builder_chain/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/bx_builder_chain/configuration.rb', line 9

def initialize
  @pg_url = ENV['DB_URL'] || nil
  @openai_api_key = ENV['OPENAI_API_KEY']
  @public_namespace = 'public'
  @threshold = 0.25
  @default_prompt_template = "Context information is below
--------------------
%{context}
--------------------
Given the context information and not prior knowledge
answer the question: %{question}"
  @database_host = ENV['DB_HOSTNAME']
  @database_port = ENV['DB_PORT']
  @database_name = ENV['DB_NAME']
  @database_user = ENV['DB_USER']
  @database_password = ENV['DB_PASSWORD']
end

Instance Attribute Details

#database_hostObject

Returns the value of attribute database_host.



5
6
7
# File 'lib/bx_builder_chain/configuration.rb', line 5

def database_host
  @database_host
end

#database_nameObject

Returns the value of attribute database_name.



5
6
7
# File 'lib/bx_builder_chain/configuration.rb', line 5

def database_name
  @database_name
end

#database_passwordObject

Returns the value of attribute database_password.



5
6
7
# File 'lib/bx_builder_chain/configuration.rb', line 5

def database_password
  @database_password
end

#database_portObject

Returns the value of attribute database_port.



5
6
7
# File 'lib/bx_builder_chain/configuration.rb', line 5

def database_port
  @database_port
end

#database_userObject

Returns the value of attribute database_user.



5
6
7
# File 'lib/bx_builder_chain/configuration.rb', line 5

def database_user
  @database_user
end

#default_prompt_templateObject

Returns the value of attribute default_prompt_template.



5
6
7
# File 'lib/bx_builder_chain/configuration.rb', line 5

def default_prompt_template
  @default_prompt_template
end

#openai_api_keyObject

Returns the value of attribute openai_api_key.



5
6
7
# File 'lib/bx_builder_chain/configuration.rb', line 5

def openai_api_key
  @openai_api_key
end

#pg_urlObject

Returns the value of attribute pg_url.



5
6
7
# File 'lib/bx_builder_chain/configuration.rb', line 5

def pg_url
  @pg_url
end

#public_namespaceObject

Returns the value of attribute public_namespace.



5
6
7
# File 'lib/bx_builder_chain/configuration.rb', line 5

def public_namespace
  @public_namespace
end

#thresholdObject

Returns the value of attribute threshold.



5
6
7
# File 'lib/bx_builder_chain/configuration.rb', line 5

def threshold
  @threshold
end