办学质量监测教学评价系统
du
2 天以前 58a5855774af8f66bdea6324d0b9a153065e5348
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package org.ruoyi.common.chat.entity.chat;
 
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import org.ruoyi.common.chat.entity.chat.tool.ToolCalls;
 
import java.io.Serializable;
import java.util.List;
 
/**
 *
 * @author https:www.unfbx.com
 * @since 1.1.2
 * 2023-03-02
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@AllArgsConstructor
public class BaseMessage implements Serializable {
 
    /**
     * 目前支持四个中角色参考官网,进行情景输入:
     * https://platform.openai.com/docs/guides/chat/introduction
     */
    private String role;
 
 
    private String name;
 
    /**
     * The tool calls generated by the model, such as function calls.
     * @since 1.1.2
     */
    @JsonProperty("tool_calls")
    private List<ToolCalls> toolCalls;
 
    /**
     * @since 1.1.2
     */
    @JsonProperty("tool_call_id")
    private String toolCallId;
 
    @Deprecated
    @JsonProperty("function_call")
    private FunctionCall functionCall;
 
 
    /**
     * 构造函数
     *
     * @param role         角色
     * @param name         name
     * @param functionCall functionCall
     */
    public BaseMessage(String role, String name, FunctionCall functionCall) {
        this.role = role;
        this.name = name;
        this.functionCall = functionCall;
    }
 
    public BaseMessage() {
    }
 
 
    @Getter
    @AllArgsConstructor
    public enum Role {
 
        SYSTEM("system"),
        USER("user"),
        ASSISTANT("assistant"),
        FUNCTION("function"),
        TOOL("tool"),
        ;
        private final String name;
    }
 
}