2424 speaker_b = data ["conversation" ]["speaker_b" ]
2525 conversation_i = data ["conversation" ]
2626
27+ db_name = "shared-db-locomo-case"
28+
29+ openapi_config = {
30+ "model_name_or_path" : "gpt-4o-mini" ,
31+ "temperature" : 0.8 ,
32+ "max_tokens" : 1024 ,
33+ "api_key" : "your-api-key-here" ,
34+ "api_base" : "https://api.openai.com/v1" ,
35+ }
2736
28- # === Create MOS Config ===
29- def get_user_configs (db_name , user_name ):
30- openapi_config = {
31- "model_name_or_path" : "gpt-4o-mini" ,
32- "temperature" : 0.8 ,
33- "max_tokens" : 1024 ,
34- "api_key" : "your-api-key-here" ,
35- "api_base" : "https://api.openai.com/v1" ,
36- }
37- neo4j_uri = os .getenv ("NEO4J_URI" , "bolt://localhost:7687" )
38- neo4j_config = {
39- "uri" : neo4j_uri ,
40- "user" : "neo4j" ,
41- "password" : "12345678" ,
42- "db_name" : db_name ,
43- "user_name" : user_name ,
44- "use_multi_db" : False ,
45- "embedding_dimension" : 3072 ,
46- "auto_create" : True ,
47- }
4837
38+ # === Create MOS Config ===
39+ def get_user_configs (user_name ):
4940 mos_config = MOSConfig (
5041 user_id = user_name ,
5142 chat_model = {"backend" : "openai" , "config" : openapi_config },
@@ -80,6 +71,22 @@ def get_user_configs(db_name, user_name):
8071 max_turns_window = 20 ,
8172 )
8273
74+ return mos_config
75+
76+
77+ # === Get Memory Cube Config ===
78+ def get_mem_cube_config (user_name ):
79+ neo4j_uri = os .getenv ("NEO4J_URI" , "bolt://localhost:7687" )
80+ neo4j_config = {
81+ "uri" : neo4j_uri ,
82+ "user" : "neo4j" ,
83+ "password" : "12345678" ,
84+ "db_name" : db_name ,
85+ "user_name" : "will be updated" ,
86+ "use_multi_db" : False ,
87+ "embedding_dimension" : 3072 ,
88+ "auto_create" : True ,
89+ }
8390 cube_config = GeneralMemCubeConfig .model_validate (
8491 {
8592 "user_id" : user_name ,
@@ -106,20 +113,20 @@ def get_user_configs(db_name, user_name):
106113 )
107114
108115 mem_cube = GeneralMemCube (cube_config )
109- return mos_config , mem_cube
116+ return mem_cube
110117
111118
112119# === Initialize MOSProduct ===
113- db_name = "shared-db-locomo-case"
114- root_config , _ = get_user_configs (db_name = db_name , user_name = "system" )
120+ root_config = get_user_configs (user_name = "system" )
115121mos_product = MOSProduct (default_config = root_config )
116122
117123
118124# === Register both users ===
119125users = {}
120126for speaker in [speaker_a , speaker_b ]:
121127 user_id = speaker .lower () + "_test"
122- config , mem_cube = get_user_configs (db_name , user_id )
128+ config = get_user_configs (user_id )
129+ mem_cube = get_mem_cube_config (user_id )
123130 result = mos_product .user_register (
124131 user_id = user_id ,
125132 user_name = speaker ,
0 commit comments