Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit b5ae557

Browse files
authored
feat(api): migrate Fireworks provider to AI SDK (#11118)
1 parent 0cd257a commit b5ae557

13 files changed

Lines changed: 1313 additions & 830 deletions

File tree

pnpm-lock.yaml

Lines changed: 29 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -452,51 +452,4 @@ describe("CerebrasHandler", () => {
452452
expect(toolCallChunks.length).toBe(0)
453453
})
454454
})
455-
456-
describe("mapToolChoice", () => {
457-
it("should handle string tool choices", () => {
458-
class TestCerebrasHandler extends CerebrasHandler {
459-
public testMapToolChoice(toolChoice: any) {
460-
return this.mapToolChoice(toolChoice)
461-
}
462-
}
463-
464-
const testHandler = new TestCerebrasHandler(mockOptions)
465-
466-
expect(testHandler.testMapToolChoice("auto")).toBe("auto")
467-
expect(testHandler.testMapToolChoice("none")).toBe("none")
468-
expect(testHandler.testMapToolChoice("required")).toBe("required")
469-
expect(testHandler.testMapToolChoice("unknown")).toBe("auto")
470-
})
471-
472-
it("should handle object tool choice with function name", () => {
473-
class TestCerebrasHandler extends CerebrasHandler {
474-
public testMapToolChoice(toolChoice: any) {
475-
return this.mapToolChoice(toolChoice)
476-
}
477-
}
478-
479-
const testHandler = new TestCerebrasHandler(mockOptions)
480-
481-
const result = testHandler.testMapToolChoice({
482-
type: "function",
483-
function: { name: "my_tool" },
484-
})
485-
486-
expect(result).toEqual({ type: "tool", toolName: "my_tool" })
487-
})
488-
489-
it("should return undefined for null or undefined", () => {
490-
class TestCerebrasHandler extends CerebrasHandler {
491-
public testMapToolChoice(toolChoice: any) {
492-
return this.mapToolChoice(toolChoice)
493-
}
494-
}
495-
496-
const testHandler = new TestCerebrasHandler(mockOptions)
497-
498-
expect(testHandler.testMapToolChoice(null)).toBeUndefined()
499-
expect(testHandler.testMapToolChoice(undefined)).toBeUndefined()
500-
})
501-
})
502455
})

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

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -733,51 +733,4 @@ describe("DeepSeekHandler", () => {
733733
expect(result).toBe(8192)
734734
})
735735
})
736-
737-
describe("mapToolChoice", () => {
738-
it("should handle string tool choices", () => {
739-
class TestDeepSeekHandler extends DeepSeekHandler {
740-
public testMapToolChoice(toolChoice: any) {
741-
return this.mapToolChoice(toolChoice)
742-
}
743-
}
744-
745-
const testHandler = new TestDeepSeekHandler(mockOptions)
746-
747-
expect(testHandler.testMapToolChoice("auto")).toBe("auto")
748-
expect(testHandler.testMapToolChoice("none")).toBe("none")
749-
expect(testHandler.testMapToolChoice("required")).toBe("required")
750-
expect(testHandler.testMapToolChoice("unknown")).toBe("auto")
751-
})
752-
753-
it("should handle object tool choice with function name", () => {
754-
class TestDeepSeekHandler extends DeepSeekHandler {
755-
public testMapToolChoice(toolChoice: any) {
756-
return this.mapToolChoice(toolChoice)
757-
}
758-
}
759-
760-
const testHandler = new TestDeepSeekHandler(mockOptions)
761-
762-
const result = testHandler.testMapToolChoice({
763-
type: "function",
764-
function: { name: "my_tool" },
765-
})
766-
767-
expect(result).toEqual({ type: "tool", toolName: "my_tool" })
768-
})
769-
770-
it("should return undefined for null or undefined", () => {
771-
class TestDeepSeekHandler extends DeepSeekHandler {
772-
public testMapToolChoice(toolChoice: any) {
773-
return this.mapToolChoice(toolChoice)
774-
}
775-
}
776-
777-
const testHandler = new TestDeepSeekHandler(mockOptions)
778-
779-
expect(testHandler.testMapToolChoice(null)).toBeUndefined()
780-
expect(testHandler.testMapToolChoice(undefined)).toBeUndefined()
781-
})
782-
})
783736
})

0 commit comments

Comments
 (0)