mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 22:08:26 +00:00
test: migrate suites to e2e coverage layout
This commit is contained in:
36
src/agents/pi-embedded-runner/google.e2e.test.ts
Normal file
36
src/agents/pi-embedded-runner/google.e2e.test.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import type { AgentTool } from "@mariozechner/pi-agent-core";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { sanitizeToolsForGoogle } from "./google.js";
|
||||
|
||||
describe("sanitizeToolsForGoogle", () => {
|
||||
it("strips unsupported schema keywords for Google providers", () => {
|
||||
const tool = {
|
||||
name: "test",
|
||||
description: "test",
|
||||
parameters: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
foo: {
|
||||
type: "string",
|
||||
format: "uuid",
|
||||
},
|
||||
},
|
||||
},
|
||||
execute: async () => ({ ok: true, content: [] }),
|
||||
} as unknown as AgentTool;
|
||||
|
||||
const [sanitized] = sanitizeToolsForGoogle({
|
||||
tools: [tool],
|
||||
provider: "google-gemini-cli",
|
||||
});
|
||||
|
||||
const params = sanitized.parameters as {
|
||||
additionalProperties?: unknown;
|
||||
properties?: Record<string, { format?: unknown }>;
|
||||
};
|
||||
|
||||
expect(params.additionalProperties).toBeUndefined();
|
||||
expect(params.properties?.foo?.format).toBeUndefined();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user