Package com.bytedesk.ai.alibaba.memory
Class MysqlChatMemoryRepository
java.lang.Object
com.bytedesk.ai.alibaba.memory.JdbcChatMemoryRepository
com.bytedesk.ai.alibaba.memory.MysqlChatMemoryRepository
- All Implemented Interfaces:
org.springframework.ai.chat.memory.ChatMemoryRepository
MySQL implementation of chat memory repository
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class com.bytedesk.ai.alibaba.memory.JdbcChatMemoryRepository
TABLE_NAME
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
MysqlChatMemoryRepository
(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
createTableSql
(String tableName) protected String
Get the SQL statement used to add recordsprotected String
Get the SQL statement used for querying recordsprotected String
hasTableSql
(String tableName) Methods inherited from class com.bytedesk.ai.alibaba.memory.JdbcChatMemoryRepository
deleteByConversationId, findByConversationId, findConversationIds, saveAll
-
Field Details
-
MYSQL_QUERY_ADD
- See Also:
-
MYSQL_QUERY_GET
- See Also:
-
-
Constructor Details
-
MysqlChatMemoryRepository
private MysqlChatMemoryRepository(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
-
-
Method Details
-
mysqlBuilder
-
hasTableSql
- Specified by:
hasTableSql
in classJdbcChatMemoryRepository
-
createTableSql
- Specified by:
createTableSql
in classJdbcChatMemoryRepository
-
getAddSql
Description copied from class:JdbcChatMemoryRepository
Get the SQL statement used to add records- Overrides:
getAddSql
in classJdbcChatMemoryRepository
- Returns:
- SQL
-
getGetSql
Description copied from class:JdbcChatMemoryRepository
Get the SQL statement used for querying records- Overrides:
getGetSql
in classJdbcChatMemoryRepository
- Returns:
- SQL
-