-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Open
Open
Copy link
Labels
Feature:SigEventsSignificant events feature, related to streams and rules/alerts (RnA)Significant events feature, related to streams and rules/alerts (RnA)Team:SigEventsProject team working on Significant EventsProject team working on Significant Events
Description
Check whether inference.output usage in feature duplication evals can be converted to the common evaluator format that @kbn/evals follow.
Proposal
Below are some examples of how we could achieve this.
Semantic uniqueness evaluator
- Create a prompt definition
const SemanticUniquenessPrompt = createPrompt({
name: 'semantic_uniqueness_analysis',
input: z.object({
stream_name: z.string(),
totals: z.string(),
unique_features_by_id: z.string(),
}),
})
.version({
system: { mustache: { template: '...(your system prompt)...' } },
template: { mustache: { template: '...(user template)...' } },
tools: {
analyze: {
description: 'Return semantic uniqueness analysis',
schema: SEMANTIC_UNIQUENESS_OUTPUT_SCHEMA,
},
},
} as const)
.get();
- Use
executeUntilValidin the evaluator
const response = await executeUntilValid({
prompt: SemanticUniquenessPrompt,
inferenceClient,
input: { stream_name, totals, unique_features_by_id },
finalToolChoice: { function: 'analyze' },
maxRetries: 3,
toolCallbacks: {
analyze: async (toolCall) => ({ response: toolCall.function.arguments }),
},
});
const { k, explanation, duplicate_clusters } = response.toolCalls[0].function.arguments;
These are only suggestions, therefore feel free to update to best fit the required approach.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Feature:SigEventsSignificant events feature, related to streams and rules/alerts (RnA)Significant events feature, related to streams and rules/alerts (RnA)Team:SigEventsProject team working on Significant EventsProject team working on Significant Events