where are the prompts used for tasks at?
- User
where are the prompts used for tasks at?
Assistant
The prompts used for tasks are located in the
open_webui/routers/tasks.pyfile. This file defines the API endpoints for various tasks such as title generation, tag generation, query generation, autocompletion, emoji generation, and MOA (Multi-Object Analysis) response generation.Specifically, the prompts themselves are defined as follows:
- Title Generation: The prompt template is retrieved from
request.app.state.config.TITLE_GENERATION_PROMPT_TEMPLATEif it's set, otherwise it defaults toDEFAULT_TITLE_GENERATION_PROMPT_TEMPLATE. Thetitle_generation_templatefunction fromopen_webui.utils.taskis used to format the prompt with relevant data. - Tag Generation: Similarly, the prompt template is retrieved from
request.app.state.config.TAGS_GENERATION_PROMPT_TEMPLATEor defaults toDEFAULT_TAGS_GENERATION_PROMPT_TEMPLATE. Thetags_generation_templatefunction is used to format the prompt. - Query Generation: The prompt template is retrieved from
request.app.state.config.QUERY_GENERATION_PROMPT_TEMPLATEor defaults toDEFAULT_QUERY_GENERATION_PROMPT_TEMPLATE. Thequery_generation_templatefunction is used to format the prompt. - Autocompletion: The prompt template is retrieved from
request.app.state.config.AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATEor defaults toDEFAULT_AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATE. Theautocomplete_generation_templatefunction is used to format the prompt. - Emoji Generation: The prompt template is hardcoded to
DEFAULT_EMOJI_GENERATION_PROMPT_TEMPLATE. Theemoji_generation_templatefunction is used to format the prompt. - MOA Response Generation: The prompt template is hardcoded to
DEFAULT_MOA_GENERATION_PROMPT_TEMPLATE. Themoa_response_generation_templatefunction is used to format the prompt.
The actual prompt templates (e.g.,
DEFAULT_TITLE_GENERATION_PROMPT_TEMPLATE) themselves are defined inopen_webui/config.py- Title Generation: The prompt template is retrieved from
- User
where are the prompt templates at then?
Assistant
You are right to ask for clarification. While
open_webui/routers/tasks.pyuses the prompt templates, it doesn't define them directly.The prompt templates themselves are defined in
open_webui/config.pyas mentioned in the previous response. However, I do not have the content ofopen_webui/config.pyfile and cannot provide you with the exact content of that file.Here's a summary of where to find the prompt templates:
open_webui/config.py: This is where the default prompt templates such asDEFAULT_TITLE_GENERATION_PROMPT_TEMPLATE,DEFAULT_TAGS_GENERATION_PROMPT_TEMPLATE,DEFAULT_QUERY_GENERATION_PROMPT_TEMPLATE,DEFAULT_AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATE,DEFAULT_EMOJI_GENERATION_PROMPT_TEMPLATE, andDEFAULT_MOA_GENERATION_PROMPT_TEMPLATEare located.open_webui/routers/tasks.py: This file uses the templates defined inopen_webui/config.pyand also allows for the templates to be configured through API calls, overriding the defaults from the config file.
So, to find the actual text of the prompt templates, you would need to look inside the
open_webui/config.pyfile.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.