diff --git a/api/constants/model_template.py b/api/constants/model_template.py index 95574b83f7..46dfd2dea7 100644 --- a/api/constants/model_template.py +++ b/api/constants/model_template.py @@ -210,6 +210,44 @@ demo_model_templates = { }), user_input_form=None ) + }, + { + 'name': 'AI Graph Generator', + 'icon': '', + 'icon_background': '', + 'description': 'According to the user\'s stated requirements, mermaid code blocks are generated by AI, and the code blocks are rendered into corresponding SVG vector drawings.', + 'mode': 'chat', + 'model_config': AppModelConfig( + provider='openai', + model_id='gpt-3.5-turbo', + configs={ + 'introduction': 'Warm reminder: Click 👍 for correct reply and 👎 for inaccurate reply, which will help me further improve myself and greatly improve the accuracy of reply to similar questions. Hello, please tell me about your image generation needs: ', + 'prompt_template': "You will play as a mermaid graphics generator, generating code blocks that conform to mermaid format requirements based on user scenario descriptions. \n\n[Note]\n\n- Output mermaid code blocks only, no other explanation. \nLet\'s think step by step.\n", + 'prompt_variables': [], + 'completion_params': { + 'max_token': 300, + 'temperature': 0.8, + 'top_p': 0.9, + 'presence_penalty': 0.1, + 'frequency_penalty': 0.1, + } + }, + opening_statement='Warm reminder: Click 👍 for correct reply and 👎 for inaccurate reply, which will help me further improve myself and greatly improve the accuracy of reply to similar questions. Hello, please tell me about your image generation needs: ', + suggested_questions=None, + pre_prompt="You will play as a mermaid graphics generator, generating code blocks that conform to mermaid format requirements based on user scenario descriptions. \n\n[Note]\n\n- Output mermaid code blocks only, no other explanation. \nLet\'s think step by step.\n", + model=json.dumps({ + "provider": "openai", + "name": "gpt-3.5-turbo", + "completion_params": { + "max_tokens": 300, + "temperature": 0.8, + "top_p": 0.9, + "presence_penalty": 0.1, + "frequency_penalty": 0.1 + } + }), + user_input_form=None + ) } ], @@ -328,6 +366,44 @@ demo_model_templates = { }), user_input_form=None ) + }, + { + 'name': 'AI 图形生成器', + 'icon': '', + 'icon_background': '', + 'description': '根据用户陈述需求利用AI生成mermaid代码块,将代码块渲染成对应SVG矢量图。', + 'mode': 'chat', + 'model_config': AppModelConfig( + provider='openai', + model_id='gpt-3.5-turbo', + configs={ + 'introduction': ' 温馨提醒:对正确的回复点击 👍赞同、不准确的回复点击 👎反对,将有助我进一步自我完善,大幅提高同类型问题回复的准确性。\n你好,请告诉我您的图像生成需求:', + 'prompt_template': "你将扮演mermaid图形生成器,根据用户场景描述生成符合mermaid格式要求的代码块。\n\n[注意事项]\n\n- 仅输出mermaid代码块,不做其他解释。\nLet\'s think step by step.\n", + 'prompt_variables': [], + 'completion_params': { + 'max_token': 1024, + 'temperature': 0.8, + 'top_p': 0.9, + 'presence_penalty': 0.1, + 'frequency_penalty': 0.1, + } + }, + opening_statement=' 温馨提醒:对正确的回复点击 👍赞同、不准确的回复点击 👎反对,将有助我进一步自我完善,大幅提高同类型问题回复的准确性。\n你好,请告诉我您的图像生成需求:', + suggested_questions=None, + pre_prompt="你将扮演mermaid图形生成器,根据用户场景描述生成符合mermaid格式要求的代码块。\n\n[注意事项]\n\n- 仅输出mermaid代码块,不做其他解释。\nLet\'s think step by step.\n", + model=json.dumps({ + "provider": "openai", + "name": "gpt-3.5-turbo", + "completion_params": { + "max_tokens": 1024, + "temperature": 0.8, + "top_p": 0.9, + "presence_penalty": 0.1, + "frequency_penalty": 0.1 + } + }), + user_input_form=None + ) } ], } diff --git a/api/controllers/console/universal_chat/chat.py b/api/controllers/console/universal_chat/chat.py index 0c7401a70a..61ba50325e 100644 --- a/api/controllers/console/universal_chat/chat.py +++ b/api/controllers/console/universal_chat/chat.py @@ -33,7 +33,6 @@ class UniversalChatApi(UniversalChatResource): args = parser.parse_args() app_model_config = app_model.app_model_config - app_model_config # update app model config args['model_config'] = app_model_config.to_dict() diff --git a/web/app/(commonLayout)/apps/NewAppDialog.tsx b/web/app/(commonLayout)/apps/NewAppDialog.tsx index 1ce38f5830..9dacf6d18b 100644 --- a/web/app/(commonLayout)/apps/NewAppDialog.tsx +++ b/web/app/(commonLayout)/apps/NewAppDialog.tsx @@ -139,7 +139,7 @@ const NewAppDialog = ({ show, onSuccess, onClose }: NewAppDialogProps) => { {isWithTemplate ? ( -