feat: 修改聊天角色枚举类型

This commit is contained in:
2025-05-05 01:55:01 +08:00
parent 041a908180
commit 785134bd68
2 changed files with 33 additions and 10 deletions

View File

@@ -1,22 +1,23 @@
package com.metis.enums;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum ChatRoleType {
SYSTEM("system"),
USER("user"),
AI("ai"),
TOOL_EXECUTION_RESULT("toolExecutionResult");
SYSTEM("system", "系统角色"),
USER("user", "用户角色"),
AI("ai", "ai返回"),
TOOL_EXECUTION_RESULT("toolExecutionResult", "工具(函数调用)返回");
@JsonValue
private final String value;
private final String desc;
ChatRoleType(String value) {
this.value = value;
}
}

View File

@@ -39,9 +39,19 @@
"value": "值"
// 值不能为空
},
"allowedFileUploadMethods": ["localFile","remoteUrl"], // 允许上传方式
"allowedFileTypes": [""], // 允许文件类型 自定义
"allowedFileExtensions": [""] // 允许文件扩展名 可以自定义
"allowedFileUploadMethods": [
"localFile",
"remoteUrl"
],
// 允许上传方式
"allowedFileTypes": [
""
],
// 允许文件类型 自定义
"allowedFileExtensions": [
""
]
// 允许文件扩展名 可以自定义
},
{
"variable": "background",
@@ -89,6 +99,10 @@
"promptTemplate": [
{
// 角色
// SYSTEM("system", "系统角色"),
// USER("user", "用户角色"),
// AI("ai", "ai返回"),
// TOOL_EXECUTION_RESULT("toolExecutionResult", "工具(函数调用)返回");
"role": "system",
"text": "你的背景是${context}",
"id": "1"
@@ -99,12 +113,17 @@
"id": "2"
}
],
// 模型参数
"model": {
// 模型id, 需要在模型管理中创建, 调用接口返回
"modelId": 1,
// 模型名称, 接口中获取
"modelName": "Qwen/Qwen2.5-Coder-32B-Instruct",
// 模型参数. 与dify保持一致, 默认值也使用dify
"completionParams": {
"temperature": 0.7,
"topP": 0.9,
"topK": 1.1,
"maxTokens": 1024,
"seed": 1234,
"presencePenalty": 0,
@@ -144,9 +163,12 @@
"icon": "",
"toolbarPosition": "right",
"config": {
// 结束节点的返回变量
"variables": [
{
// 返回变量字段名称
"variable": "query",
// 返回变量字段值, 动态模板获取
"variableKey": "node_5.query"
},
{