test: update google-shared expectations

This commit is contained in:
Peter Steinberger
2026-01-04 14:57:46 +00:00
parent 7ff318d3f2
commit 557aa74ee8

View File

@@ -27,7 +27,7 @@ const makeModel = (id: string): Model<"google-generative-ai"> =>
}) as Model<"google-generative-ai">; }) as Model<"google-generative-ai">;
describe("google-shared convertTools", () => { describe("google-shared convertTools", () => {
it("adds type:object when properties/required exist but type is missing", () => { it("preserves properties/required when type is missing", () => {
const tools = [ const tools = [
{ {
name: "noType", name: "noType",
@@ -46,7 +46,7 @@ describe("google-shared convertTools", () => {
converted?.[0]?.functionDeclarations?.[0]?.parameters, converted?.[0]?.functionDeclarations?.[0]?.parameters,
); );
expect(params.type).toBe("object"); expect(params.type).toBeUndefined();
expect(params.properties).toBeDefined(); expect(params.properties).toBeDefined();
expect(params.required).toEqual(["action"]); expect(params.required).toEqual(["action"]);
}); });
@@ -147,7 +147,7 @@ describe("google-shared convertTools", () => {
}); });
describe("google-shared convertMessages", () => { describe("google-shared convertMessages", () => {
it("skips thinking blocks for Gemini to avoid mimicry", () => { it("keeps thinking blocks with signatures for Gemini", () => {
const model = makeModel("gemini-1.5-pro"); const model = makeModel("gemini-1.5-pro");
const context = { const context = {
messages: [ messages: [
@@ -184,7 +184,13 @@ describe("google-shared convertMessages", () => {
} as unknown as Context; } as unknown as Context;
const contents = convertMessages(model, context); const contents = convertMessages(model, context);
expect(contents).toHaveLength(0); expect(contents).toHaveLength(1);
const parts = contents?.[0]?.parts ?? [];
expect(parts).toHaveLength(1);
expect(parts[0]).toMatchObject({
thought: true,
thoughtSignature: "sig",
});
}); });
it("keeps thought signatures for Claude models", () => { it("keeps thought signatures for Claude models", () => {