This commit is contained in:
Matt Rubens 2025-04-14 13:27:33 -04:00 committed by GitHub
parent 929503a4c8
commit ab7ca17f29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 9 deletions

View file

@ -0,0 +1,5 @@
---
"roo-cline": patch
---
v3.11.16

View file

@ -76,7 +76,7 @@ describe("OpenAiNativeHandler", () => {
beforeEach(() => {
mockOptions = {
apiModelId: "gpt-4o",
apiModelId: "gpt-4.1",
openAiNativeApiKey: "test-api-key",
}
handler = new OpenAiNativeHandler(mockOptions)
@ -91,7 +91,7 @@ describe("OpenAiNativeHandler", () => {
it("should initialize with empty API key", () => {
const handlerWithoutKey = new OpenAiNativeHandler({
apiModelId: "gpt-4o",
apiModelId: "gpt-4.1",
openAiNativeApiKey: "",
})
expect(handlerWithoutKey).toBeInstanceOf(OpenAiNativeHandler)
@ -196,7 +196,7 @@ describe("OpenAiNativeHandler", () => {
beforeEach(() => {
handler = new OpenAiNativeHandler({
...mockOptions,
apiModelId: "gpt-4o",
apiModelId: "gpt-4.1",
})
})
@ -229,7 +229,7 @@ describe("OpenAiNativeHandler", () => {
])
expect(mockCreate).toHaveBeenCalledWith({
model: "gpt-4o",
model: "gpt-4.1",
temperature: 0,
messages: [
{ role: "system", content: systemPrompt },
@ -269,11 +269,11 @@ describe("OpenAiNativeHandler", () => {
})
describe("completePrompt", () => {
it("should complete prompt successfully with gpt-4o model", async () => {
it("should complete prompt successfully with gpt-4.1 model", async () => {
const result = await handler.completePrompt("Test prompt")
expect(result).toBe("Test response")
expect(mockCreate).toHaveBeenCalledWith({
model: "gpt-4o",
model: "gpt-4.1",
messages: [{ role: "user", content: "Test prompt" }],
temperature: 0,
})
@ -357,8 +357,8 @@ describe("OpenAiNativeHandler", () => {
const modelInfo = handler.getModel()
expect(modelInfo.id).toBe(mockOptions.apiModelId)
expect(modelInfo.info).toBeDefined()
expect(modelInfo.info.maxTokens).toBe(16384)
expect(modelInfo.info.contextWindow).toBe(128_000)
expect(modelInfo.info.maxTokens).toBe(32768)
expect(modelInfo.info.contextWindow).toBe(1047576)
})
it("should handle undefined model ID", () => {
@ -366,7 +366,7 @@ describe("OpenAiNativeHandler", () => {
openAiNativeApiKey: "test-api-key",
})
const modelInfo = handlerWithoutModel.getModel()
expect(modelInfo.id).toBe("gpt-4o") // Default model
expect(modelInfo.id).toBe("gpt-4.1") // Default model
expect(modelInfo.info).toBeDefined()
})
})