test-harness/dist¶
Classes¶
CognideskTestHarness¶
Constructors¶
Constructor¶
Parameters¶
| Parameter | Type |
|---|---|
options |
TestHarnessOptions |
Returns¶
Methods¶
runScenario()¶
Parameters¶
| Parameter | Type |
|---|---|
scenario |
HarnessScenario |
Returns¶
Promise\<ScenarioResult>
Interfaces¶
AssertionResult¶
Properties¶
assertionId¶
passed¶
reasoning¶
CriterionJudgement¶
Properties¶
criterionId¶
passed¶
reasoning¶
score¶
EvaluationCriterion¶
Properties¶
description¶
id¶
threshold?¶
weight?¶
HarnessAgentClient¶
Methods¶
createConversation()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
CreateRuntimeConversationInput |
Returns¶
Promise\<{
id: string;
}>
sendMessage()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
{ conversationId: string; signal?: AbortSignal; text: string; turn?: unknown; } |
input.conversationId |
string |
input.signal? |
AbortSignal |
input.text |
string |
input.turn? |
unknown |
Returns¶
Promise\<Pick\<HandleUserMessageResult, "text" | "events" | "activeJourneyId">>
submitWidget()?¶
Parameters¶
| Parameter | Type |
|---|---|
input |
{ conversationId: string; output: unknown; promptId: string; signal?: AbortSignal; widgetKind: string; } |
input.conversationId |
string |
input.output |
unknown |
input.promptId |
string |
input.signal? |
AbortSignal |
input.widgetKind |
string |
Returns¶
Promise\<{
event: RuntimeEvent;
events?: RuntimeEvent[];
}>
HarnessScenario¶
Properties¶
agentId¶
assertions?¶
channel?¶
context?¶
criteria?¶
description?¶
id¶
judge?¶
instructions?¶
threshold?¶
maxTurns?¶
name?¶
timeoutMs?¶
user¶
ScenarioAssertionInput¶
Properties¶
activeJourneyIds¶
conversationId¶
events¶
scenario¶
transcript¶
ScenarioResult¶
Properties¶
assertions¶
conversationId¶
error?¶
events¶
judgements¶
passed¶
scenarioId¶
score¶
status¶
transcript¶
SimulatedUserDefinition¶
Properties¶
background?¶
goal¶
identity¶
scriptedTurns?¶
stopWhen?¶
TestHarnessOptions¶
Properties¶
client¶
judgeModel?¶
privacy?¶
optional privacy?: {
redactEvents?: | RuntimeEvent[]
| Promise<RuntimeEvent[]>;
redactTranscript?: | TranscriptTurn[]
| Promise<TranscriptTurn[]>;
};
redactEvents()?¶
Parameters¶
| Parameter | Type |
|---|---|
input |
{ events: RuntimeEvent[]; scenario: HarnessScenario; } |
input.events |
RuntimeEvent[] |
input.scenario |
HarnessScenario |
Returns¶
| RuntimeEvent[]
| Promise\<RuntimeEvent[]>
redactTranscript()?¶
Parameters¶
| Parameter | Type |
|---|---|
input |
{ scenario: HarnessScenario; transcript: TranscriptTurn[]; } |
input.scenario |
HarnessScenario |
input.transcript |
TranscriptTurn[] |
Returns¶
| TranscriptTurn[]
| Promise\<TranscriptTurn[]>
simulatedUserModel?¶
timeoutMs?¶
TranscriptTurn¶
Properties¶
content¶
role¶
Type Aliases¶
ScenarioAssertion¶
type ScenarioAssertion =
| {
caseSensitive?: boolean;
id: string;
text: string;
type: "assistantContains";
}
| {
id: string;
journeyId: string;
type: "journeyActivated";
}
| {
eventType: RuntimeEvent["type"];
id: string;
type: "eventEmitted";
}
| {
eventType: RuntimeEvent["type"];
expected: Record<string, unknown>;
id: string;
type: "eventPayloadMatches";
}
| {
code?: string;
id: string;
toolName?: string;
type: "policyBlocked";
}
| {
id: string;
toolName: string;
type: "toolCalled";
}
| {
id: string;
toolName: string;
type: "toolNotCalled";
}
| {
id: string;
maxWords: number;
type: "assistantMaxWords";
}
| {
id: string;
maxCharacters: number;
type: "assistantMaxCharacters";
}
| {
description?: string;
evaluate: (input) => MaybePromise<
| boolean
| {
passed: boolean;
reasoning?: string;
}>;
id: string;
type: "custom";
};
ScriptedUserTurn¶
type ScriptedUserTurn =
| string
| {
text: string;
type: "message";
}
| {
output: unknown;
promptId?: string;
type: "widget";
widgetKind?: string;
};
Functions¶
createTestHarness()¶
Parameters¶
| Parameter | Type |
|---|---|
options |
TestHarnessOptions |
Returns¶
runtimeHarnessClient()¶
Parameters¶
| Parameter | Type |
|---|---|
runtime |
CognideskRuntime |
Returns¶
References¶
CategoryOperationDeclaration¶
Re-exports CategoryOperationDeclaration
CategoryOperationLevel¶
Re-exports CategoryOperationLevel
deriveProviderCategoryCoverage¶
Re-exports deriveProviderCategoryCoverage
IntegrationCategoryProfile¶
Re-exports IntegrationCategoryProfile
ProviderCategoryCoverage¶
Re-exports ProviderCategoryCoverage
ProviderCategoryCoverageLevel¶
Re-exports ProviderCategoryCoverageLevel
ProviderConformanceCheckResult¶
Re-exports ProviderConformanceCheckResult
ProviderConformanceInput¶
Re-exports ProviderConformanceInput
ProviderConformanceResult¶
Re-exports ProviderConformanceResult
ProviderConformanceStatus¶
Re-exports ProviderConformanceStatus
ProviderLiveCheck¶
Re-exports ProviderLiveCheck
ProviderLiveCheckContext¶
Re-exports ProviderLiveCheckContext
runProviderConformance¶
Re-exports runProviderConformance