基于 AI SDK v6 实现 openai/openai-responses/anthropic 三类 provider 的 http/stream 模式调用 支持 output/finishReason/usage/stream 等完整 expect 断言链路 新增 9 个源文件和 5 个测试文件共 78 个测试 更新 README/DEVELOPMENT/probes.example.yaml 和 probe-config.schema.json
33 lines
986 B
TypeScript
33 lines
986 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
|
|
import { checkerRegistry } from "../../../../../src/server/checker/runner";
|
|
|
|
describe("LLM registry integration", () => {
|
|
test("registry 包含 llm 类型", () => {
|
|
expect(checkerRegistry.supportedTypes).toContain("llm");
|
|
});
|
|
|
|
test("llm checker 可获取", () => {
|
|
const checker = checkerRegistry.tryGet("llm");
|
|
expect(checker).toBeDefined();
|
|
expect(checker!.type).toBe("llm");
|
|
expect(checker!.configKey).toBe("llm");
|
|
});
|
|
|
|
test("llm checker schemas 有效", () => {
|
|
const checker = checkerRegistry.get("llm");
|
|
expect(checker.schemas.config).toBeDefined();
|
|
expect(checker.schemas.defaults).toBeDefined();
|
|
expect(checker.schemas.expect).toBeDefined();
|
|
});
|
|
|
|
test("llm checker validate 方法可用", () => {
|
|
const checker = checkerRegistry.get("llm");
|
|
const issues = checker.validate({
|
|
defaults: {},
|
|
targets: [],
|
|
});
|
|
expect(issues).toHaveLength(0);
|
|
});
|
|
});
|