- Added optional Agent and SDK tool-call syntax controls (`toolCallSyntax`, `PI_OWNED_TOOLS`) for owned calls. - Added in-band grammar scanners and renderers for Anthropic, DeepSeek, GLM, Hermes, Kimi, PI, and Qwen3. - Added supportsTools propagation and model schema updates to route unsupported models to fallback syntax. - Replaced stream-markup parsing with syntax-specific in-band scanners and event conversion.
17 lines
786 B
TypeScript
17 lines
786 B
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import { resolveToolCallSyntax } from "@oh-my-pi/pi-coding-agent/sdk";
|
|
|
|
describe("resolveToolCallSyntax", () => {
|
|
it("uses GLM in auto mode only for models known not to support native tools", () => {
|
|
expect(resolveToolCallSyntax("auto", { supportsTools: false })).toBe("glm");
|
|
expect(resolveToolCallSyntax("auto", { supportsTools: true })).toBeUndefined();
|
|
expect(resolveToolCallSyntax("auto", {})).toBeUndefined();
|
|
expect(resolveToolCallSyntax("auto", undefined)).toBeUndefined();
|
|
});
|
|
|
|
it("keeps native unset and passes explicit in-band syntaxes through", () => {
|
|
expect(resolveToolCallSyntax("native", { supportsTools: false })).toBeUndefined();
|
|
expect(resolveToolCallSyntax("qwen3", undefined)).toBe("qwen3");
|
|
});
|
|
});
|