


























@@ -8,7 +8,6 @@ import {
88normalizeOpenAIStrictToolParameters,
99normalizeStrictOpenAIJsonSchema,
1010resolveOpenAIProjectedToolsStrictToolFlag,
11-resolveOpenAIStrictToolFlagForProjection,
1211} from "./openai-tool-schema.js";
13121413describe("OpenAI strict tool schema normalization", () => {
@@ -33,12 +32,6 @@ describe("OpenAI strict tool schema normalization", () => {
3332additionalProperties: false,
3433});
3534expect(isStrictOpenAIJsonSchemaCompatible(schema)).toBe(true);
36-expect(
37-resolveOpenAIStrictToolFlagForProjection(
38-projectOpenAITools([{ name: "empty", parameters: schema }]),
39-true,
40-),
41-).toBe(true);
4235}
4336});
4437@@ -63,7 +56,7 @@ describe("OpenAI strict tool schema normalization", () => {
6356expect(normalized.properties?.metadata).not.toHaveProperty("additionalProperties");
6457expect(isStrictOpenAIJsonSchemaCompatible(schema)).toBe(false);
6558expect(
66-resolveOpenAIStrictToolFlagForProjection(
59+resolveOpenAIProjectedToolsStrictToolFlag(
6760projectOpenAITools([{ name: "write", parameters: schema }]),
6861true,
6962),
@@ -125,7 +118,6 @@ describe("OpenAI strict tool schema normalization", () => {
125118violations: ["broken.parameters is not JSON-serializable"],
126119},
127120]);
128-expect(resolveOpenAIStrictToolFlagForProjection(projection, true)).toBe(false);
129121});
130122131123it("keeps strict mode for emitted tools when unreadable tools are dropped", () => {
@@ -150,7 +142,6 @@ describe("OpenAI strict tool schema normalization", () => {
150142},
151143]);
152144153-expect(resolveOpenAIStrictToolFlagForProjection(projection, true)).toBe(false);
154145expect(resolveOpenAIProjectedToolsStrictToolFlag(projection, true)).toBe(true);
155146});
156147@@ -175,7 +166,7 @@ describe("OpenAI strict tool schema normalization", () => {
175166const tool = projection.tools[0];
176167expect(tool).toBeDefined();
177168178-expect(resolveOpenAIStrictToolFlagForProjection(projection, true)).toBe(true);
169+expect(resolveOpenAIProjectedToolsStrictToolFlag(projection, true)).toBe(true);
179170const normalized = normalizeOpenAIStrictToolParameters(tool?.parameters, true);
180171expect(normalizeOpenAIStrictToolParameters(tool?.parameters, true)).toBe(normalized);
181172expect(serializationCount).toBe(1);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。