From 7a29664f067d0b57b9b36a925d19dc2f65d17779 Mon Sep 17 00:00:00 2001 From: kingbri Date: Mon, 8 Jan 2024 23:00:33 -0500 Subject: [PATCH] API: Add alias names to field descriptions Helps with understanding API aliases. These aliases should not be used but are helpful for developers who want frontend compat. Signed-off-by: kingbri --- OAI/types/common.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OAI/types/common.py b/OAI/types/common.py index b18e9d71..df543495 100644 --- a/OAI/types/common.py +++ b/OAI/types/common.py @@ -78,7 +78,9 @@ class CommonCompletionRequest(BaseModel): # Aliased variables typical: Optional[float] = Field( - default=1.0, validation_alias=AliasChoices("typical", "typical_p") + default=1.0, + validation_alias=AliasChoices("typical", "typical_p"), + description="Aliases: typical_p", ) penalty_range: Optional[int] = Field( @@ -88,10 +90,13 @@ class CommonCompletionRequest(BaseModel): "repetition_range", "repetition_penalty_range", ), + description="Aliases: repetition_range, repetition_penalty_range", ) cfg_scale: Optional[float] = Field( - default=1.0, validation_alias=AliasChoices("cfg_scale", "guidance_scale") + default=1.0, + validation_alias=AliasChoices("cfg_scale", "guidance_scale"), + description="Aliases: guidance_scale", ) def to_gen_params(self):