Skip to content

Commit

Permalink
Fixes bug for saving config (#296)
Browse files Browse the repository at this point in the history
When the config values can have different types - example, AI client
config that supports Azure OpenAI or OpenAI, with different BaseModels
  • Loading branch information
markwaddle authored Dec 30, 2024
1 parent a80b3b7 commit ebb7ede
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def replace_config_secret_str_masked_values(model_values: ModelT, original_model
updated_model_values = model_values.model_copy()
for field_name, field_info in updated_model_values.model_fields.items():
field_value = getattr(updated_model_values, field_name)
if isinstance(field_value, BaseModel):
if isinstance(field_value, BaseModel) and hasattr(original_model_values, field_name):
updated_value = replace_config_secret_str_masked_values(
field_value,
getattr(original_model_values, field_name),
Expand Down

0 comments on commit ebb7ede

Please sign in to comment.