feat: 修改聊天角色枚举类型
This commit is contained in:
@@ -1,22 +1,23 @@
|
|||||||
package com.metis.enums;
|
package com.metis.enums;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
public enum ChatRoleType {
|
public enum ChatRoleType {
|
||||||
SYSTEM("system"),
|
SYSTEM("system", "系统角色"),
|
||||||
USER("user"),
|
USER("user", "用户角色"),
|
||||||
AI("ai"),
|
AI("ai", "ai返回"),
|
||||||
TOOL_EXECUTION_RESULT("toolExecutionResult");
|
TOOL_EXECUTION_RESULT("toolExecutionResult", "工具(函数调用)返回");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@JsonValue
|
@JsonValue
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
|
||||||
ChatRoleType(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,9 +39,19 @@
|
|||||||
"value": "值"
|
"value": "值"
|
||||||
// 值不能为空
|
// 值不能为空
|
||||||
},
|
},
|
||||||
"allowedFileUploadMethods": ["localFile","remoteUrl"], // 允许上传方式
|
"allowedFileUploadMethods": [
|
||||||
"allowedFileTypes": [""], // 允许文件类型 自定义
|
"localFile",
|
||||||
"allowedFileExtensions": [""] // 允许文件扩展名 可以自定义
|
"remoteUrl"
|
||||||
|
],
|
||||||
|
// 允许上传方式
|
||||||
|
"allowedFileTypes": [
|
||||||
|
""
|
||||||
|
],
|
||||||
|
// 允许文件类型 自定义
|
||||||
|
"allowedFileExtensions": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
// 允许文件扩展名 可以自定义
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"variable": "background",
|
"variable": "background",
|
||||||
@@ -89,6 +99,10 @@
|
|||||||
"promptTemplate": [
|
"promptTemplate": [
|
||||||
{
|
{
|
||||||
// 角色
|
// 角色
|
||||||
|
// SYSTEM("system", "系统角色"),
|
||||||
|
// USER("user", "用户角色"),
|
||||||
|
// AI("ai", "ai返回"),
|
||||||
|
// TOOL_EXECUTION_RESULT("toolExecutionResult", "工具(函数调用)返回");
|
||||||
"role": "system",
|
"role": "system",
|
||||||
"text": "你的背景是${context}",
|
"text": "你的背景是${context}",
|
||||||
"id": "1"
|
"id": "1"
|
||||||
@@ -99,12 +113,17 @@
|
|||||||
"id": "2"
|
"id": "2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
// 模型参数
|
||||||
"model": {
|
"model": {
|
||||||
|
// 模型id, 需要在模型管理中创建, 调用接口返回
|
||||||
"modelId": 1,
|
"modelId": 1,
|
||||||
|
// 模型名称, 接口中获取
|
||||||
"modelName": "Qwen/Qwen2.5-Coder-32B-Instruct",
|
"modelName": "Qwen/Qwen2.5-Coder-32B-Instruct",
|
||||||
|
// 模型参数. 与dify保持一致, 默认值也使用dify
|
||||||
"completionParams": {
|
"completionParams": {
|
||||||
"temperature": 0.7,
|
"temperature": 0.7,
|
||||||
"topP": 0.9,
|
"topP": 0.9,
|
||||||
|
"topK": 1.1,
|
||||||
"maxTokens": 1024,
|
"maxTokens": 1024,
|
||||||
"seed": 1234,
|
"seed": 1234,
|
||||||
"presencePenalty": 0,
|
"presencePenalty": 0,
|
||||||
@@ -144,9 +163,12 @@
|
|||||||
"icon": "",
|
"icon": "",
|
||||||
"toolbarPosition": "right",
|
"toolbarPosition": "right",
|
||||||
"config": {
|
"config": {
|
||||||
|
// 结束节点的返回变量
|
||||||
"variables": [
|
"variables": [
|
||||||
{
|
{
|
||||||
|
// 返回变量字段名称
|
||||||
"variable": "query",
|
"variable": "query",
|
||||||
|
// 返回变量字段值, 动态模板获取
|
||||||
"variableKey": "node_5.query"
|
"variableKey": "node_5.query"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user