Skip to content

Commit a3a2623

Browse files
capitanfeederedelauna
authored andcommitted
Remove stale convertToolsForOpenAI tests (stripping removed)
1 parent 7897331 commit a3a2623

1 file changed

Lines changed: 1 addition & 124 deletions

File tree

src/api/providers/__tests__/mimo.spec.ts

Lines changed: 1 addition & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -103,127 +103,6 @@ describe("MimoHandler", () => {
103103
})
104104
})
105105

106-
describe("convertToolsForOpenAI", () => {
107-
it("should return undefined for undefined tools", () => {
108-
const result = (handler as any).convertToolsForOpenAI(undefined)
109-
expect(result).toBeUndefined()
110-
})
111-
112-
it("should strip strict: true from function tools", () => {
113-
const tools = [
114-
{
115-
type: "function",
116-
function: {
117-
name: "read_file",
118-
description: "Read a file",
119-
parameters: {
120-
type: "object",
121-
properties: { path: { type: "string" } },
122-
required: ["path"],
123-
},
124-
strict: true,
125-
},
126-
},
127-
]
128-
const result = (handler as any).convertToolsForOpenAI(tools)
129-
expect(result[0].function.strict).toBeUndefined()
130-
})
131-
132-
it("should strip additionalProperties: false from schemas", () => {
133-
const tools = [
134-
{
135-
type: "function",
136-
function: {
137-
name: "read_file",
138-
description: "Read a file",
139-
parameters: {
140-
type: "object",
141-
additionalProperties: false,
142-
properties: { path: { type: "string" } },
143-
},
144-
},
145-
},
146-
]
147-
const result = (handler as any).convertToolsForOpenAI(tools)
148-
expect(result[0].function.parameters.additionalProperties).toBeUndefined()
149-
})
150-
151-
it("should recursively strip additionalProperties from nested objects", () => {
152-
const tools = [
153-
{
154-
type: "function",
155-
function: {
156-
name: "test",
157-
parameters: {
158-
type: "object",
159-
additionalProperties: false,
160-
properties: {
161-
nested: {
162-
type: "object",
163-
additionalProperties: false,
164-
properties: {
165-
deep: { type: "string" },
166-
},
167-
},
168-
},
169-
},
170-
},
171-
},
172-
]
173-
const result = (handler as any).convertToolsForOpenAI(tools)
174-
expect(result[0].function.parameters.additionalProperties).toBeUndefined()
175-
expect(result[0].function.parameters.properties.nested.additionalProperties).toBeUndefined()
176-
})
177-
178-
it("should strip additionalProperties from array items", () => {
179-
const tools = [
180-
{
181-
type: "function",
182-
function: {
183-
name: "test",
184-
parameters: {
185-
type: "object",
186-
properties: {
187-
tags: {
188-
type: "array",
189-
items: {
190-
type: "object",
191-
additionalProperties: false,
192-
properties: { name: { type: "string" } },
193-
},
194-
},
195-
},
196-
},
197-
},
198-
},
199-
]
200-
const result = (handler as any).convertToolsForOpenAI(tools)
201-
expect(result[0].function.parameters.properties.tags.items.additionalProperties).toBeUndefined()
202-
})
203-
204-
it("should preserve non-function tools unchanged", () => {
205-
const tools = [{ type: "web_search", web_search: {} }]
206-
const result = (handler as any).convertToolsForOpenAI(tools)
207-
expect(result[0]).toEqual({ type: "web_search", web_search: {} })
208-
})
209-
210-
it("should preserve tool name and description", () => {
211-
const tools = [
212-
{
213-
type: "function",
214-
function: {
215-
name: "my_tool",
216-
description: "My tool description",
217-
parameters: { type: "object", properties: {} },
218-
},
219-
},
220-
]
221-
const result = (handler as any).convertToolsForOpenAI(tools)
222-
expect(result[0].function.name).toBe("my_tool")
223-
expect(result[0].function.description).toBe("My tool description")
224-
})
225-
})
226-
227106
describe("convertMessagesForMiMo (via convertToR1Format)", () => {
228107
const convert = (messages: Anthropic.Messages.MessageParam[]) =>
229108
convertToR1Format(messages, {
@@ -541,9 +420,7 @@ describe("MimoHandler", () => {
541420
type: "object",
542421
properties: { path: { type: "string" } },
543422
required: ["path"],
544-
additionalProperties: false,
545423
},
546-
strict: true,
547424
},
548425
},
549426
]
@@ -555,7 +432,7 @@ describe("MimoHandler", () => {
555432

556433
const params = mockCreate.mock.calls[0][0]
557434
expect(params.tools).toHaveLength(1)
558-
expect(params.tools[0].function.parameters.additionalProperties).toBeUndefined()
435+
expect(params.tools[0].function.name).toBe("read_file")
559436
})
560437

561438
it("should yield text chunks from stream", async () => {

0 commit comments

Comments
 (0)