fix(mm): make key required in openapi schema for model config

This commit is contained in:
psychedelicious 2024-03-05 12:35:52 +11:00
parent 6829610a71
commit a8b6635050

View File

@ -162,7 +162,11 @@ class ModelConfigBase(BaseModel):
description="Default settings for this model", default=None
)
model_config = ConfigDict(validate_assignment=True)
@staticmethod
def json_schema_extra(schema: dict[str, Any], model_class: Type[BaseModel]) -> None:
schema["required"].extend(["key"])
model_config = ConfigDict(validate_assignment=True, json_schema_extra=json_schema_extra)
class CheckpointConfigBase(ModelConfigBase):