Add eval runner and tool orchestration
This commit is contained in:
1 parent
4294f3c92e
commit
5579db54da
66 files changed
+6162
-242
No files matched your search
@@ -8,6 +8,7 @@ import {
|
||||
policyLayer,
|
||||
stateLayer,
|
||||
} from "./layers.js";
|
||||
import { buildToolPolicy } from "./tool-policy.js";
|
||||
|
||||
export class PromptBuilder {
|
||||
private constructor(
|
||||
@@ -35,7 +36,12 @@ export class PromptBuilder {
|
||||
|
||||
const systemPrompt = [
|
||||
personaLayer(),
|
||||
policyLayer(this.derived.intent),
|
||||
policyLayer(this.derived.intent, {
|
||||
toolPolicy:
|
||||
this.derived.responseMode === "llm-with-tools"
|
||||
? buildToolPolicy(this.derived.intent.kind, this.derived.phase.kind)
|
||||
: undefined,
|
||||
}),
|
||||
stateLayer(this.session, this.derived),
|
||||
examplesLayer(this.derived.intent),
|
||||
contextLayer(promptContext),
|
||||
|
||||
@@ -7,6 +7,12 @@ import type {
|
||||
OnboardingSession,
|
||||
PromptContext,
|
||||
} from "../types.js";
|
||||
import {
|
||||
HEART_RULE_TEXT,
|
||||
MIN_AGE,
|
||||
NICKNAME_FORMAT_EXAMPLE,
|
||||
TIER_CODES_TEXT,
|
||||
} from "../constants.js";
|
||||
import { EXAMPLES_BY_INTENT } from "./examples.js";
|
||||
|
||||
function formatKstTimestamp(value: string | undefined): string {
|
||||
@@ -94,11 +100,11 @@ export function personaLayer(): string {
|
||||
처음 온 멤버가 편안하게 등록을 마칠 수 있도록 자연스럽고 정확하게 안내해줘.
|
||||
|
||||
[커뮤니티 규칙]
|
||||
- 가입 가능 연령은 27세 이상이야.
|
||||
- 가입 가능 연령은 ${MIN_AGE}세 이상이야.
|
||||
- 새내기 등록은 닉네임 변경과 방 하트 인증 두 가지를 모두 완료하면 돼.
|
||||
- 닉네임 형식은 이름/출생 연도 두 자리/성별/티어야. 예: 홍길동/95/남/G
|
||||
- 성별은 남 또는 여, 티어 코드는 GM, I, B, S, G, P, E, D, M, C, U 중 하나야.
|
||||
- 방 하트 인증은 채팅방 프로필에서 하트를 빨간색으로 바꾼 뒤 편집 없는 원본 스크린샷을 보내는 절차야.
|
||||
- 닉네임 형식은 이름/출생 연도 두 자리/성별/티어야. 예: ${NICKNAME_FORMAT_EXAMPLE}
|
||||
- 성별은 남 또는 여, 티어 코드는 ${TIER_CODES_TEXT} 중 하나야.
|
||||
- 방 하트 인증은 ${HEART_RULE_TEXT}
|
||||
- 디스코드 안내는 닉네임 변경과 하트 인증이 모두 완료된 뒤에만 해줘.`;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import type { Intent, OnboardingPhase } from "../state/onboarding-state.js";
|
||||
|
||||
export function buildToolPolicy(
|
||||
intent: Intent["kind"],
|
||||
phase: OnboardingPhase["kind"],
|
||||
): string {
|
||||
if (intent === "nickname-question" && phase === "nickname-rejected") {
|
||||
return "- 닉네임 후보나 현재 닉네임을 설명할 때는 validate-nickname 도구를 먼저 사용한 뒤, 틀린 부분만 짚어.";
|
||||
}
|
||||
|
||||
if (intent === "status-question") {
|
||||
return "- 진행 상태 질문은 check-onboarding-progress 도구를 우선 사용하고, 상태만 짧게 답해.";
|
||||
}
|
||||
|
||||
if (intent === "age-question" || intent === "discord-question") {
|
||||
return "- 규칙 확인이 필요하면 lookup-community-rule 도구를 사용해 정확한 규칙만 답해.";
|
||||
}
|
||||
|
||||
if (intent === "help-where") {
|
||||
return "- 위치 안내가 모호할 때만 get-room-context 도구를 고려하고, 기본적으로는 절차 위치만 답해.";
|
||||
}
|
||||
|
||||
if (phase === "deadline-near") {
|
||||
return "- 마감이 가까운 상태에서는 남은 절차만 우선순위로 짧게 답해.";
|
||||
}
|
||||
|
||||
return "- 도구가 꼭 필요하지 않다면 호출하지 말고, 지금 질문에 대한 답만 간결하게 해.";
|
||||
}
|
||||
Reference in new issue
Block a user