Better way to handle user_bio default in the API (alternative to bdcf31035f)

This commit is contained in:
oobabooga 2024-03-29 10:54:01 -07:00
parent 9653a9176c
commit c37f792afa
2 changed files with 3 additions and 1 deletions

View File

@ -261,6 +261,7 @@ def chat_completions_common(body: dict, is_legacy: bool = False, stream=False) -
name2 = body['bot_name'] or name2
context = body['context'] or context
greeting = body['greeting'] or greeting
user_bio = body['user_bio'] or ''
# History
user_input, custom_system_message, history = convert_history(messages)
@ -271,6 +272,7 @@ def chat_completions_common(body: dict, is_legacy: bool = False, stream=False) -
'name2': name2,
'context': context,
'greeting': greeting,
'user_bio': user_bio,
'instruction_template_str': instruction_template_str,
'custom_system_message': custom_system_message,
'chat_template_str': chat_template_str,

View File

@ -103,7 +103,7 @@ class ChatCompletionRequestParams(BaseModel):
context: str | None = Field(default=None, description="Overwrites the value set by character field.")
greeting: str | None = Field(default=None, description="Overwrites the value set by character field.")
user_name: str | None = Field(default=None, description="Your name (the user). By default, it's \"You\".", alias="name1")
user_bio: str | None = Field(default='', description="The user description/personality.")
user_bio: str | None = Field(default=None, description="The user description/personality.")
chat_template_str: str | None = Field(default=None, description="Jinja2 template for chat.")
chat_instruct_command: str | None = None