🐛 fix(util.py): set default value for model_name in format_dict function
The format_dict function was updated to set a default value for the model_name key in the value dictionary for the OpenAI, ChatOpenAI, and Anthropic models. This ensures that the model_name key always has a value, even if the options list is empty.
This commit is contained in:
parent
a05a9202e8
commit
c0a8d15dc2
1 changed files with 3 additions and 0 deletions
|
|
@ -299,12 +299,15 @@ def format_dict(d, name: Optional[str] = None):
|
|||
if name == "OpenAI" and key == "model_name":
|
||||
value["options"] = constants.OPENAI_MODELS
|
||||
value["list"] = True
|
||||
value["value"] = constants.OPENAI_MODELS[0]
|
||||
elif name == "ChatOpenAI" and key == "model_name":
|
||||
value["options"] = constants.CHAT_OPENAI_MODELS
|
||||
value["list"] = True
|
||||
value["value"] = constants.CHAT_OPENAI_MODELS[0]
|
||||
elif (name == "Anthropic" or name == "ChatAnthropic") and key == "model_name":
|
||||
value["options"] = constants.ANTHROPIC_MODELS
|
||||
value["list"] = True
|
||||
value["value"] = constants.ANTHROPIC_MODELS[0]
|
||||
return d
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue