@@ -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 :
@@ -352,10 +352,10 @@ def _write_config(self, new_config: GlobalConfig):
352
352
353
353
self ._validate_config (new_config )
354
354
with open (self .config_path , "w" ) as f :
355
- json .dump (new_config .dict (), f , indent = self .indentation_depth )
355
+ json .dump (new_config .model_dump (), f , indent = self .indentation_depth )
356
356
357
357
def delete_api_key (self , key_name : str ):
358
- config_dict = self ._read_config ().dict ()
358
+ config_dict = self ._read_config ().model_dump ()
359
359
required_keys = []
360
360
for provider in [
361
361
self .lm_provider ,
@@ -389,15 +389,15 @@ def update_config(self, config_update: UpdateConfigRequest): # type:ignore
389
389
if not api_key_value :
390
390
raise KeyEmptyError ("API key value cannot be empty." )
391
391
392
- config_dict = self ._read_config ().dict ()
393
- Merger .merge (config_dict , config_update .dict (exclude_unset = True ))
392
+ config_dict = self ._read_config ().model_dump ()
393
+ Merger .merge (config_dict , config_update .model_dump (exclude_unset = True ))
394
394
self ._write_config (GlobalConfig (** config_dict ))
395
395
396
396
# this cannot be a property, as the parent Configurable already defines the
397
397
# self.config attr.
398
398
def get_config (self ):
399
399
config = self ._read_config ()
400
- config_dict = config .dict (exclude_unset = True )
400
+ config_dict = config .model_dump (exclude_unset = True )
401
401
api_key_names = list (config_dict .pop ("api_keys" ).keys ())
402
402
return DescribeConfigResponse (
403
403
** config_dict , api_keys = api_key_names , last_read = self ._last_read
0 commit comments