@@ -263,7 +263,7 @@ def _validate_config(self, config: GlobalConfig):
263
263
read and before every write to the config file. Guarantees that the
264
264
config file conforms to the JSON Schema, and that the language and
265
265
embedding models have authn credentials if specified."""
266
- self .validator .validate (config .dict ())
266
+ self .validator .validate (config .model_dump ())
267
267
268
268
# validate language model config
269
269
if config .model_provider_id :
@@ -349,10 +349,10 @@ def _write_config(self, new_config: GlobalConfig):
349
349
350
350
self ._validate_config (new_config )
351
351
with open (self .config_path , "w" ) as f :
352
- json .dump (new_config .dict (), f , indent = self .indentation_depth )
352
+ json .dump (new_config .model_dump (), f , indent = self .indentation_depth )
353
353
354
354
def delete_api_key (self , key_name : str ):
355
- config_dict = self ._read_config ().dict ()
355
+ config_dict = self ._read_config ().model_dump ()
356
356
required_keys = []
357
357
for provider in [
358
358
self .lm_provider ,
@@ -386,15 +386,15 @@ def update_config(self, config_update: UpdateConfigRequest): # type:ignore
386
386
if not api_key_value :
387
387
raise KeyEmptyError ("API key value cannot be empty." )
388
388
389
- config_dict = self ._read_config ().dict ()
390
- Merger .merge (config_dict , config_update .dict (exclude_unset = True ))
389
+ config_dict = self ._read_config ().model_dump ()
390
+ Merger .merge (config_dict , config_update .model_dump (exclude_unset = True ))
391
391
self ._write_config (GlobalConfig (** config_dict ))
392
392
393
393
# this cannot be a property, as the parent Configurable already defines the
394
394
# self.config attr.
395
395
def get_config (self ):
396
396
config = self ._read_config ()
397
- config_dict = config .dict (exclude_unset = True )
397
+ config_dict = config .model_dump (exclude_unset = True )
398
398
api_key_names = list (config_dict .pop ("api_keys" ).keys ())
399
399
return DescribeConfigResponse (
400
400
** config_dict , api_keys = api_key_names , last_read = self ._last_read
0 commit comments