-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py
More file actions
28 lines (23 loc) · 793 Bytes
/
config.py
File metadata and controls
28 lines (23 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from pydantic_settings import BaseSettings, SettingsConfigDict
from typing import Optional
class MemoryServiceConfig(BaseSettings):
# Infinity 配置
INFINITY_HOST: str = "localhost"
INFINITY_PORT: int = 23817
# 向量服务配置
EMBEDDING_SERVICE_TYPE: str = "openai"
EMBEDDING_SERVICE_URL: str = "https://openai.linktre.cc/v1/embeddings"
EMBEDDING_API_KEY: str = ""
EMBEDDING_MODEL: str = "text-embedding-3-small"
EMBEDDING_DIM: int = 1536
# 数据库配置
DEFAULT_DATABASE: str = "memory_store"
TABLE_PREFIX: str = "memories_"
# HNSW索引配置
HNSW_M: int = 16
HNSW_EF_CONSTRUCTION: int = 200
# 使用新的配置方式
model_config = SettingsConfigDict(
env_file=".env",
case_sensitive=True
)