e1814d9a08
- Renamed ToolCallSyntax type to Dialect and Grammar interface to DialectDefinition across all packages. - Moved grammar directory to dialect and updated all import paths in agent, ai, catalog, and coding-agent packages. - Added renderTranscript and renderThinking methods to DialectDefinition, enabling native dialect-aware conversation serialization. - Consolidated rendering utilities into new dialect/rendering.ts with shared helpers for ChatML, legacy text, and dialect-specific formatting. - Updated conversation serialization in agent and coding-agent to use dialect.renderTranscript() for native turn envelope rendering.
17 lines
730 B
TypeScript
17 lines
730 B
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import { resolveDialect } from "@oh-my-pi/pi-coding-agent/sdk";
|
|
|
|
describe("resolveDialect", () => {
|
|
it("uses GLM in auto mode only for models known not to support native tools", () => {
|
|
expect(resolveDialect("auto", { supportsTools: false })).toBe("glm");
|
|
expect(resolveDialect("auto", { supportsTools: true })).toBeUndefined();
|
|
expect(resolveDialect("auto", {})).toBeUndefined();
|
|
expect(resolveDialect("auto", undefined)).toBeUndefined();
|
|
});
|
|
|
|
it("keeps native unset and passes explicit in-band dialects through", () => {
|
|
expect(resolveDialect("native", { supportsTools: false })).toBeUndefined();
|
|
expect(resolveDialect("qwen3", undefined)).toBe("qwen3");
|
|
});
|
|
});
|