Iterate skill SSOT routing and eval support
Add skill priority routing and duplicate manifest handling. Split eval golden sets by skill and add moderation rule lookup coverage. Move onboarding runtime helpers out of the main skill class.
This commit is contained in:
1 parent
fb189330da
commit
12e731a428
35 files changed
+1260
-500
No files matched your search
+12
-1
@@ -25,6 +25,17 @@ function isValidRequest(data: unknown): data is AgentRequest {
|
||||
);
|
||||
}
|
||||
|
||||
export function selectSkillForRequest(
|
||||
skills: readonly Skill[],
|
||||
request: AgentRequest,
|
||||
): Skill | null {
|
||||
return (
|
||||
skills
|
||||
.filter((candidate) => candidate.canHandle(request))
|
||||
.sort((left, right) => right.priority - left.priority)[0] ?? null
|
||||
);
|
||||
}
|
||||
|
||||
export class Agent {
|
||||
private readonly skills: Skill[] = [];
|
||||
private readonly logger = getLogger();
|
||||
@@ -96,7 +107,7 @@ export class Agent {
|
||||
"[Agent] Request received",
|
||||
);
|
||||
|
||||
const skill = this.skills.find((candidate) => candidate.canHandle(request));
|
||||
const skill = selectSkillForRequest(this.skills, request);
|
||||
if (!skill) {
|
||||
logger.info("[Agent] No skill found for request");
|
||||
const response: AgentResponse = {
|
||||
|
||||
Reference in new issue
Block a user