fix: emoji generation

This commit is contained in:
Timothy J. Baek 2024-10-22 11:23:38 -07:00
parent 24e7ae8767
commit 424062d75f
2 changed files with 18 additions and 1 deletions

View File

@ -122,6 +122,7 @@ from open_webui.utils.task import (
moa_response_generation_template,
tags_generation_template,
search_query_generation_template,
emoji_generation_template,
title_generation_template,
tools_function_calling_generation_template,
)
@ -1718,7 +1719,7 @@ Your task is to reflect the speaker's likely facial expression through a fitting
Message: """{{prompt}}"""
'''
content = title_generation_template(
content = emoji_generation_template(
template,
form_data["prompt"],
{

View File

@ -147,6 +147,22 @@ def tags_generation_template(
return template
def emoji_generation_template(
template: str, prompt: str, user: Optional[dict] = None
) -> str:
template = replace_prompt_variable(template, prompt)
template = prompt_template(
template,
**(
{"user_name": user.get("name"), "user_location": user.get("location")}
if user
else {}
),
)
return template
def search_query_generation_template(
template: str, messages: list[dict], user: Optional[dict] = None
) -> str: