39 lines
1.2 KiB
Java
39 lines
1.2 KiB
Java
package com.example.demo.domain;
|
||
|
||
public record LlmConfig(
|
||
String baseUrl,
|
||
String model,
|
||
int timeoutMs,
|
||
int maxOutputTokens,
|
||
String prompt
|
||
) {
|
||
public static final String DEFAULT_PROMPT = """
|
||
你是实时通话事件识别器。根据规则库和已发送事件,判断最新对话是否产生新的事件。
|
||
|
||
事件规则(事件ID|名称|辅助关键词):
|
||
{{rules}}
|
||
|
||
已发送事件 ID:
|
||
{{alerted_event_ids}}
|
||
|
||
判断要求:
|
||
1. 结合市民与坐席的语义,只判断规则库中的事件。
|
||
2. 排除否定、假设、举例和坐席转述。
|
||
3. 已发送事件不要重复输出。
|
||
4. 只输出 JSON 字符串数组,例如 ["E001"];无新事件输出 []。
|
||
5. 不输出原因、置信度、证据、字段名或 Markdown。
|
||
|
||
通话上下文:
|
||
{{conversation}}""";
|
||
|
||
public static LlmConfig defaults() {
|
||
return new LlmConfig(
|
||
"https://api.openai.com/v1",
|
||
"gpt-4.1-mini",
|
||
3000,
|
||
64,
|
||
DEFAULT_PROMPT
|
||
);
|
||
}
|
||
}
|