@@ -153,17 +153,73 @@ class InMemoryCacheConfig(ConfigurationBase):
153153
154154
155155class PostgreSQLDatabaseConfiguration (ConfigurationBase ):
156- """PostgreSQL database configuration."""
156+ """PostgreSQL database configuration.
157157
158- host : str = "localhost"
159- port : PositiveInt = 5432
160- db : str
161- user : str
162- password : SecretStr
163- namespace : Optional [str ] = "lightspeed-stack"
164- ssl_mode : str = constants .POSTGRES_DEFAULT_SSL_MODE
165- gss_encmode : str = constants .POSTGRES_DEFAULT_GSS_ENCMODE
166- ca_cert_path : Optional [FilePath ] = None
158+ PostgreSQL database is used by Lightspeed Core Stack service for storing information about
159+ conversation IDs. It can also be leveraged to store conversation history and information
160+ about quota usage.
161+
162+ Useful resources:
163+
164+ - [Psycopg: connection classes](https://www.psycopg.org/psycopg3/docs/api/connections.html)
165+ - [PostgreSQL connection strings](https://www.connectionstrings.com/postgresql/)
166+ - [How to Use PostgreSQL in Python](https://www.freecodecamp.org/news/postgresql-in-python/)
167+ """
168+
169+ host : str = Field (
170+ "localhost" ,
171+ title = "Hostname" ,
172+ description = "Database server host or socket directory" ,
173+ )
174+
175+ port : PositiveInt = Field (
176+ 5432 ,
177+ title = "Port" ,
178+ description = "Database server port" ,
179+ )
180+
181+ db : str = Field (
182+ ...,
183+ title = "Database name" ,
184+ description = "Database name to connect to" ,
185+ )
186+
187+ user : str = Field (
188+ ...,
189+ title = "User name" ,
190+ description = "Database user name used to authenticate" ,
191+ )
192+
193+ password : SecretStr = Field (
194+ ...,
195+ title = "Password" ,
196+ description = "Password used to authenticate" ,
197+ )
198+
199+ namespace : Optional [str ] = Field (
200+ "lightspeed-stack" ,
201+ title = "Name space" ,
202+ description = "Database namespace" ,
203+ )
204+
205+ ssl_mode : str = Field (
206+ constants .POSTGRES_DEFAULT_SSL_MODE ,
207+ title = "SSL mode" ,
208+ description = "SSL mode" ,
209+ )
210+
211+ gss_encmode : str = Field (
212+ constants .POSTGRES_DEFAULT_GSS_ENCMODE ,
213+ title = "GSS encmode" ,
214+ description = "This option determines whether or with what priority a secure GSS "
215+ "TCP/IP connection will be negotiated with the server." ,
216+ )
217+
218+ ca_cert_path : Optional [FilePath ] = Field (
219+ None ,
220+ title = "CA certificate path" ,
221+ description = "Path to CA certificate" ,
222+ )
167223
168224 @model_validator (mode = "after" )
169225 def check_postgres_configuration (self ) -> Self :
0 commit comments