Skip to content

Commit

Permalink
API: Add alias names to field descriptions
Browse files Browse the repository at this point in the history
Helps with understanding API aliases. These aliases should not be
used but are helpful for developers who want frontend compat.

Signed-off-by: kingbri <[email protected]>
  • Loading branch information
bdashore3 committed Jan 9, 2024
1 parent 1dbebd4 commit 7a29664
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions OAI/types/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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):
Expand Down

0 comments on commit 7a29664

Please sign in to comment.