dify/api/constants/model_template.py

87 lines
2.0 KiB
Python
Raw Normal View History

2023-05-15 08:51:32 +08:00
import json
from models.model import AppMode
default_app_templates = {
# workflow default mode
AppMode.WORKFLOW: {
'app': {
'mode': AppMode.WORKFLOW.value,
'enable_site': True,
'enable_api': True
}
},
2023-05-15 08:51:32 +08:00
# completion default mode
AppMode.COMPLETION: {
2023-05-15 08:51:32 +08:00
'app': {
'mode': AppMode.COMPLETION.value,
2023-05-15 08:51:32 +08:00
'enable_site': True,
'enable_api': True
2023-05-15 08:51:32 +08:00
},
'model_config': {
'model': {
2023-05-15 08:51:32 +08:00
"provider": "openai",
"name": "gpt-4o",
"mode": "chat",
"completion_params": {}
},
'user_input_form': json.dumps([
{
"paragraph": {
"label": "Query",
"variable": "query",
"required": True,
"default": ""
}
}
]),
'pre_prompt': '{{query}}'
},
2023-05-15 08:51:32 +08:00
},
# chat default mode
AppMode.CHAT: {
2023-05-15 08:51:32 +08:00
'app': {
'mode': AppMode.CHAT.value,
2023-05-15 08:51:32 +08:00
'enable_site': True,
'enable_api': True
2023-05-15 08:51:32 +08:00
},
'model_config': {
'model': {
2023-05-15 08:51:32 +08:00
"provider": "openai",
"name": "gpt-4o",
"mode": "chat",
"completion_params": {}
}
2023-05-15 08:51:32 +08:00
}
},
# advanced-chat default mode
AppMode.ADVANCED_CHAT: {
'app': {
'mode': AppMode.ADVANCED_CHAT.value,
'enable_site': True,
'enable_api': True
}
},
2023-05-15 08:51:32 +08:00
# agent-chat default mode
AppMode.AGENT_CHAT: {
'app': {
'mode': AppMode.AGENT_CHAT.value,
'enable_site': True,
'enable_api': True
},
'model_config': {
'model': {
"provider": "openai",
"name": "gpt-4o",
"mode": "chat",
"completion_params": {}
}
}
}
}