feat(memory-api): implement memory read/write API service endpoints
- Add MemoryAPIService with read_memory and write_memory methods for managing user memories - Create memory_api_schema.py with request/response schemas for read and write operations - Implement write_memory_api_service endpoint for storing memory content with configurable storage backends - Implement read_memory_api_service endpoint for querying memories with context-aware responses - Add memory-specific error codes (MEMORY_WRITE_FAILED, MEMORY_READ_FAILED, MEMORY_CONFIG_NOT_FOUND) to error_codes.py
This commit is contained in:
@@ -78,6 +78,11 @@ class BizCode(IntEnum):
|
||||
EMBEDDING_FAILED = 9002
|
||||
SEARCH_FAILED = 9003
|
||||
|
||||
# Memory API(95xx)
|
||||
MEMORY_WRITE_FAILED = 9501
|
||||
MEMORY_READ_FAILED = 9502
|
||||
MEMORY_CONFIG_NOT_FOUND = 9503
|
||||
|
||||
# 系统(100xx)
|
||||
INTERNAL_ERROR = 10001
|
||||
DB_ERROR = 10002
|
||||
@@ -148,6 +153,12 @@ HTTP_MAPPING = {
|
||||
BizCode.INDEX_BUILD_FAILED: 500,
|
||||
BizCode.EMBEDDING_FAILED: 500,
|
||||
BizCode.SEARCH_FAILED: 500,
|
||||
|
||||
# Memory API 错误码映射
|
||||
BizCode.MEMORY_WRITE_FAILED: 500,
|
||||
BizCode.MEMORY_READ_FAILED: 500,
|
||||
BizCode.MEMORY_CONFIG_NOT_FOUND: 400,
|
||||
|
||||
BizCode.INTERNAL_ERROR: 500,
|
||||
BizCode.DB_ERROR: 500,
|
||||
BizCode.SERVICE_UNAVAILABLE: 503,
|
||||
|
||||
Reference in New Issue
Block a user