Files
live-call-asr-monitor/src/main/java/com/example/demo/domain/LlmConfig.java

39 lines
1.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
);
}
}