2023-05-15 08:51:32 +08:00
|
|
|
import json
|
|
|
|
|
|
|
|
model_templates = {
|
|
|
|
# completion default mode
|
|
|
|
'completion_default': {
|
|
|
|
'app': {
|
|
|
|
'mode': 'completion',
|
|
|
|
'enable_site': True,
|
|
|
|
'enable_api': True,
|
|
|
|
'is_demo': False,
|
|
|
|
'api_rpm': 0,
|
|
|
|
'api_rph': 0,
|
|
|
|
'status': 'normal'
|
|
|
|
},
|
|
|
|
'model_config': {
|
2024-02-29 12:43:07 +08:00
|
|
|
'provider': '',
|
|
|
|
'model_id': '',
|
|
|
|
'configs': {},
|
2023-05-15 08:51:32 +08:00
|
|
|
'model': json.dumps({
|
|
|
|
"provider": "openai",
|
2023-09-19 02:05:04 +08:00
|
|
|
"name": "gpt-3.5-turbo-instruct",
|
2023-10-12 23:13:10 +08:00
|
|
|
"mode": "completion",
|
2024-02-29 12:43:07 +08:00
|
|
|
"completion_params": {}
|
2023-09-10 00:12:34 +08:00
|
|
|
}),
|
|
|
|
'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
|
|
|
|
'chat_default': {
|
|
|
|
'app': {
|
|
|
|
'mode': 'chat',
|
|
|
|
'enable_site': True,
|
|
|
|
'enable_api': True,
|
|
|
|
'is_demo': False,
|
|
|
|
'api_rpm': 0,
|
|
|
|
'api_rph': 0,
|
|
|
|
'status': 'normal'
|
|
|
|
},
|
|
|
|
'model_config': {
|
2024-02-29 12:43:07 +08:00
|
|
|
'provider': '',
|
|
|
|
'model_id': '',
|
|
|
|
'configs': {},
|
2023-05-15 08:51:32 +08:00
|
|
|
'model': json.dumps({
|
|
|
|
"provider": "openai",
|
|
|
|
"name": "gpt-3.5-turbo",
|
2023-10-12 23:13:10 +08:00
|
|
|
"mode": "chat",
|
2024-02-29 12:43:07 +08:00
|
|
|
"completion_params": {}
|
2023-05-15 08:51:32 +08:00
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|