diff --git a/extensions/openai/completions.py b/extensions/openai/completions.py index 3bc5170a..5925101a 100644 --- a/extensions/openai/completions.py +++ b/extensions/openai/completions.py @@ -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, diff --git a/extensions/openai/typing.py b/extensions/openai/typing.py index dbfa7167..c3ef0404 100644 --- a/extensions/openai/typing.py +++ b/extensions/openai/typing.py @@ -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