File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77from time import sleep
88
99import json
10+ import os
1011
1112max_retries = 4
1213
13- config_paths = ['config_tutor.json' , 'app/config_tutor.json' , 'app/config_tutor_test.json' ]
14+ # Get the directory of the current file to build relative paths
15+ current_dir = os .path .dirname (os .path .abspath (__file__ ))
16+ config_test_path = os .path .join (current_dir , 'config_tutor_test.json' )
1417
1518try :
16- tutor = MathTutor ('app/config_tutor_test.json' )
19+ tutor = MathTutor (config_test_path )
1720except Exception as e :
1821 error (f"An error occurred during the initialization of the tutor: { e } " )
19- try :
20- tutor = MathTutor ('app/config_tutor_test.json' )
21- except Exception as e :
22- for _ in range (max_retries ):
23- sleep (1 )
24- try :
25- tutor = MathTutor ('config_tutor_test.json' )
26- except Exception as e :
27- error (f"An error occurred during the initialization of the tutor: { e } " )
28- error (f"An error occurred during the initialization of the tutor: { e } " )
29- raise RuntimeError ("Failed to initialize MathTutor with either config file" ) from e
22+ for _ in range (max_retries ):
23+ sleep (1 )
24+ try :
25+ tutor = MathTutor (config_test_path )
26+ except Exception as e :
27+ error (f"An error occurred during the initialization of the tutor: { e } " )
28+ error (f"An error occurred during the initialization of the tutor: { e } " )
29+ raise RuntimeError ("Failed to initialize MathTutor with either config file" ) from e
3030
3131class Params (TypedDict ):
3232 model_name : str
You can’t perform that action at this time.
0 commit comments