Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 0 additions & 47 deletions src/api/providers/__tests__/cerebras.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,51 +452,4 @@ describe("CerebrasHandler", () => {
expect(toolCallChunks.length).toBe(0)
})
})

describe("mapToolChoice", () => {
it("should handle string tool choices", () => {
class TestCerebrasHandler extends CerebrasHandler {
public testMapToolChoice(toolChoice: any) {
return this.mapToolChoice(toolChoice)
}
}

const testHandler = new TestCerebrasHandler(mockOptions)

expect(testHandler.testMapToolChoice("auto")).toBe("auto")
expect(testHandler.testMapToolChoice("none")).toBe("none")
expect(testHandler.testMapToolChoice("required")).toBe("required")
expect(testHandler.testMapToolChoice("unknown")).toBe("auto")
})

it("should handle object tool choice with function name", () => {
class TestCerebrasHandler extends CerebrasHandler {
public testMapToolChoice(toolChoice: any) {
return this.mapToolChoice(toolChoice)
}
}

const testHandler = new TestCerebrasHandler(mockOptions)

const result = testHandler.testMapToolChoice({
type: "function",
function: { name: "my_tool" },
})

expect(result).toEqual({ type: "tool", toolName: "my_tool" })
})

it("should return undefined for null or undefined", () => {
class TestCerebrasHandler extends CerebrasHandler {
public testMapToolChoice(toolChoice: any) {
return this.mapToolChoice(toolChoice)
}
}

const testHandler = new TestCerebrasHandler(mockOptions)

expect(testHandler.testMapToolChoice(null)).toBeUndefined()
expect(testHandler.testMapToolChoice(undefined)).toBeUndefined()
})
})
})
47 changes: 0 additions & 47 deletions src/api/providers/__tests__/deepseek.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -733,51 +733,4 @@ describe("DeepSeekHandler", () => {
expect(result).toBe(8192)
})
})

describe("mapToolChoice", () => {
it("should handle string tool choices", () => {
class TestDeepSeekHandler extends DeepSeekHandler {
public testMapToolChoice(toolChoice: any) {
return this.mapToolChoice(toolChoice)
}
}

const testHandler = new TestDeepSeekHandler(mockOptions)

expect(testHandler.testMapToolChoice("auto")).toBe("auto")
expect(testHandler.testMapToolChoice("none")).toBe("none")
expect(testHandler.testMapToolChoice("required")).toBe("required")
expect(testHandler.testMapToolChoice("unknown")).toBe("auto")
})

it("should handle object tool choice with function name", () => {
class TestDeepSeekHandler extends DeepSeekHandler {
public testMapToolChoice(toolChoice: any) {
return this.mapToolChoice(toolChoice)
}
}

const testHandler = new TestDeepSeekHandler(mockOptions)

const result = testHandler.testMapToolChoice({
type: "function",
function: { name: "my_tool" },
})

expect(result).toEqual({ type: "tool", toolName: "my_tool" })
})

it("should return undefined for null or undefined", () => {
class TestDeepSeekHandler extends DeepSeekHandler {
public testMapToolChoice(toolChoice: any) {
return this.mapToolChoice(toolChoice)
}
}

const testHandler = new TestDeepSeekHandler(mockOptions)

expect(testHandler.testMapToolChoice(null)).toBeUndefined()
expect(testHandler.testMapToolChoice(undefined)).toBeUndefined()
})
})
})
Loading
Loading