refactor(google-tests): share schema tool fixture
This commit is contained in:
parent
ef0812beff
commit
58f6362921
@ -11,6 +11,18 @@ describe("sanitizeToolsForGoogle", () => {
|
||||
execute: async () => ({ ok: true, content: [] }),
|
||||
}) as unknown as AgentTool;
|
||||
|
||||
const createSchemaToolWithFormat = () =>
|
||||
createTool({
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
foo: {
|
||||
type: "string",
|
||||
format: "uuid",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const expectFormatRemoved = (
|
||||
sanitized: AgentTool,
|
||||
key: "additionalProperties" | "patternProperties",
|
||||
@ -25,16 +37,7 @@ describe("sanitizeToolsForGoogle", () => {
|
||||
};
|
||||
|
||||
it("strips unsupported schema keywords for Google providers", () => {
|
||||
const tool = createTool({
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
foo: {
|
||||
type: "string",
|
||||
format: "uuid",
|
||||
},
|
||||
},
|
||||
});
|
||||
const tool = createSchemaToolWithFormat();
|
||||
const [sanitized] = sanitizeToolsForGoogle({
|
||||
tools: [tool],
|
||||
provider: "google-gemini-cli",
|
||||
@ -43,16 +46,7 @@ describe("sanitizeToolsForGoogle", () => {
|
||||
});
|
||||
|
||||
it("returns original tools for non-google providers", () => {
|
||||
const tool = createTool({
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
foo: {
|
||||
type: "string",
|
||||
format: "uuid",
|
||||
},
|
||||
},
|
||||
});
|
||||
const tool = createSchemaToolWithFormat();
|
||||
const sanitized = sanitizeToolsForGoogle({
|
||||
tools: [tool],
|
||||
provider: "openai",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user