Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 29 additions & 9 deletions docs/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,26 @@ <h2 id="modelcontextprotocolserver">ModelContextProtocolServer</h2>
<h2
id="postgresqldatabaseconfiguration">PostgreSQLDatabaseConfiguration</h2>
<p>PostgreSQL database configuration.</p>
<p>PostgreSQL database is used by Lightspeed Core Stack service for
storing information about conversation IDs. It can also be leveraged to
store conversation history and information about quota usage.</p>
<p>Useful resources:</p>
<ul>
<li><a
href="https://www.psycopg.org/psycopg3/docs/api/connections.html">Psycopg:
connection classes</a></li>
<li><a href="https://www.connectionstrings.com/postgresql/">PostgreSQL
connection strings</a></li>
<li><a
href="https://www.freecodecamp.org/news/postgresql-in-python/">How to
Use PostgreSQL in Python</a></li>
</ul>
<table>
<colgroup>
<col style="width: 26%" />
<col style="width: 23%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr class="header">
<th>Field</th>
Expand All @@ -768,47 +787,48 @@ <h2 id="modelcontextprotocolserver">ModelContextProtocolServer</h2>
<tr class="odd">
<td>host</td>
<td>string</td>
<td></td>
<td>Database server host or socket directory</td>
</tr>
<tr class="even">
<td>port</td>
<td>integer</td>
<td></td>
<td>Database server port</td>
</tr>
<tr class="odd">
<td>db</td>
<td>string</td>
<td></td>
<td>Database name to connect to</td>
</tr>
<tr class="even">
<td>user</td>
<td>string</td>
<td></td>
<td>Database user name used to authenticate</td>
</tr>
<tr class="odd">
<td>password</td>
<td>string</td>
<td></td>
<td>Password used to authenticate</td>
</tr>
<tr class="even">
<td>namespace</td>
<td></td>
<td></td>
<td>Database namespace</td>
</tr>
<tr class="odd">
<td>ssl_mode</td>
<td>string</td>
<td></td>
<td>SSL mode</td>
</tr>
<tr class="even">
<td>gss_encmode</td>
<td>string</td>
<td></td>
<td>This option determines whether or with what priority a secure GSS
TCP/IP connection will be negotiated with the server.</td>
</tr>
<tr class="odd">
<td>ca_cert_path</td>
<td></td>
<td></td>
<td>Path to CA certificate</td>
</tr>
</tbody>
</table>
Expand Down
28 changes: 19 additions & 9 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,28 @@ model context protocol server configuration.

PostgreSQL database configuration.

PostgreSQL database is used by Lightspeed Core Stack service for storing information about
conversation IDs. It can also be leveraged to store conversation history and information
about quota usage.

Useful resources:

- [Psycopg: connection classes](https://www.psycopg.org/psycopg3/docs/api/connections.html)
- [PostgreSQL connection strings](https://www.connectionstrings.com/postgresql/)
- [How to Use PostgreSQL in Python](https://www.freecodecamp.org/news/postgresql-in-python/)


| Field | Type | Description |
|-------|------|-------------|
| host | string | |
| port | integer | |
| db | string | |
| user | string | |
| password | string | |
| namespace | | |
| ssl_mode | string | |
| gss_encmode | string | |
| ca_cert_path | | |
| host | string | Database server host or socket directory |
| port | integer | Database server port |
| db | string | Database name to connect to |
| user | string | Database user name used to authenticate |
| password | string | Password used to authenticate |
| namespace | | Database namespace |
| ssl_mode | string | SSL mode |
| gss_encmode | string | This option determines whether or with what priority a secure GSS TCP/IP connection will be negotiated with the server. |
| ca_cert_path | | Path to CA certificate |


## QuotaHandlersConfiguration
Expand Down
14 changes: 7 additions & 7 deletions docs/config.puml
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ class "ModelContextProtocolServer" as src.models.config.ModelContextProtocolServ
}
class "PostgreSQLDatabaseConfiguration" as src.models.config.PostgreSQLDatabaseConfiguration {
ca_cert_path : Optional[FilePath]
db : str
gss_encmode : str
host : str
db : Optional[str]
gss_encmode : Optional[str]
host : Optional[str]
namespace : Optional[str]
password : SecretStr
port : Annotated
ssl_mode : str
user : str
password : Optional[SecretStr]
port : Optional[PositiveInt]
ssl_mode : Optional[str]
user : Optional[str]
Comment on lines +130 to +137
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical inconsistency: Field types don't match the actual implementation.

The PlantUML diagram shows several fields as Optional that are NOT optional in the actual PostgreSQLDatabaseConfiguration class in src/models/config.py:

Incorrectly marked as Optional:

  • db (line 130): Should be str (required field with Field(...))
  • gss_encmode (line 131): Should be str (has default value)
  • host (line 132): Should be str (has default value "localhost")
  • password (line 134): Should be SecretStr (required field with Field(...))
  • port (line 135): Should be PositiveInt (has default value 5432)
  • ssl_mode (line 136): Should be str (has default value)
  • user (line 137): Should be str (required field with Field(...))

Correctly marked as Optional:

  • ca_cert_path (line 129): Optional[FilePath]
  • namespace (line 133): Optional[str]

Apply this diff to correct the field types:

 class "PostgreSQLDatabaseConfiguration" as src.models.config.PostgreSQLDatabaseConfiguration {
   ca_cert_path : Optional[FilePath]
-  db : Optional[str]
-  gss_encmode : Optional[str]
-  host : Optional[str]
+  db : str
+  gss_encmode : str
+  host : str
   namespace : Optional[str]
-  password : Optional[SecretStr]
-  port : Optional[PositiveInt]
-  ssl_mode : Optional[str]
-  user : Optional[str]
+  password : SecretStr
+  port : PositiveInt
+  ssl_mode : str
+  user : str
   check_postgres_configuration() -> Self
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
db : Optional[str]
gss_encmode : Optional[str]
host : Optional[str]
namespace : Optional[str]
password : SecretStr
port : Annotated
ssl_mode : str
user : str
password : Optional[SecretStr]
port : Optional[PositiveInt]
ssl_mode : Optional[str]
user : Optional[str]
ca_cert_path : Optional[FilePath]
db : str
gss_encmode : str
host : str
namespace : Optional[str]
password : SecretStr
port : PositiveInt
ssl_mode : str
user : str
🤖 Prompt for AI Agents
In docs/config.puml around lines 130 to 137, the PlantUML types for several
PostgreSQLDatabaseConfiguration fields are incorrect: update the types to match
src/models/config.py by changing db from Optional[str] to str, gss_encmode from
Optional[str] to str, host from Optional[str] to str, password from
Optional[SecretStr] to SecretStr, port from Optional[PositiveInt] to
PositiveInt, ssl_mode from Optional[str] to str, and user from Optional[str] to
str; keep ca_cert_path as Optional[FilePath] and namespace as Optional[str]
unchanged.

check_postgres_configuration() -> Self
}
class "QuotaHandlersConfiguration" as src.models.config.QuotaHandlersConfiguration {
Expand Down
Loading
Loading