Example for logit_bias, closes #36

This commit is contained in:
Simon Willison 2023-07-10 15:43:44 -07:00
parent bee1817284
commit aa37d3307f
2 changed files with 3 additions and 1 deletions

View file

@ -122,6 +122,7 @@ OpenAI Chat: gpt-3.5-turbo (aliases: 3.5, chatgpt)
A string where the API will stop generating further tokens.
logit_bias: dict, str
Modify the likelihood of specified tokens appearing in the completion.
Pass a JSON string like '{"1712":-100, "892":-100, "1489":-100}'
OpenAI Chat: gpt-3.5-turbo-16k (aliases: chatgpt-16k, 3.5-16k)
temperature: float
max_tokens: int

View file

@ -110,7 +110,8 @@ class Chat(Model):
)
logit_bias: Optional[Union[dict, str]] = Field(
description=(
"Modify the likelihood of specified tokens appearing in the completion."
"Modify the likelihood of specified tokens appearing in the completion. "
'Pass a JSON string like \'{"1712":-100, "892":-100, "1489":-100}\''
),
default=None,
)