API: fix bug after previous commit

This commit is contained in:
oobabooga 2024-01-09 19:08:02 -08:00
parent 4332e24740
commit bb2c4707c4

View File

@ -235,9 +235,9 @@ def chat_completions_common(body: dict, is_legacy: bool = False, stream=False) -
# Chat character # Chat character
character = body['character'] or shared.settings['character'] character = body['character'] or shared.settings['character']
character = "Assistant" if character == "None" else character character = "Assistant" if character == "None" else character
name1 = body['name1'] or shared.settings['name1'] name1 = body['user_name'] or shared.settings['name1']
name1, name2, _, greeting, context = load_character_memoized(character, name1, '') name1, name2, _, greeting, context = load_character_memoized(character, name1, '')
name2 = body['name2'] or name2 name2 = body['bot_name'] or name2
context = body['context'] or context context = body['context'] or context
greeting = body['greeting'] or greeting greeting = body['greeting'] or greeting