feat: add openai/gpt-oss-120b model to Chutes provider

- Added openai/gpt-oss-120b to ChutesModelId type definition
- Added model configuration with 128k context window and 32k max tokens
- Added test coverage for the new model
- Fixes #6973
This commit is contained in:
Roo Code 2025-08-12 06:51:22 +00:00
parent 5f3c67fa91
commit a578952d01
2 changed files with 32 additions and 0 deletions

View file

@ -29,6 +29,7 @@ export type ChutesModelId =
| "zai-org/GLM-4.5-Air"
| "zai-org/GLM-4.5-FP8"
| "moonshotai/Kimi-K2-Instruct-75k"
| "openai/gpt-oss-120b"
export const chutesDefaultModelId: ChutesModelId = "deepseek-ai/DeepSeek-R1-0528"
@ -278,4 +279,13 @@ export const chutesModels = {
outputPrice: 0.5926,
description: "Moonshot AI Kimi K2 Instruct model with 75k context window.",
},
"openai/gpt-oss-120b": {
maxTokens: 32768,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
description: "OpenAI GPT OSS 120B model - latest open source coding model.",
},
} as const satisfies Record<string, ModelInfo>

View file

@ -275,6 +275,28 @@ describe("ChutesHandler", () => {
)
})
it("should return openai/gpt-oss-120b model with correct configuration", () => {
const testModelId: ChutesModelId = "openai/gpt-oss-120b"
const handlerWithModel = new ChutesHandler({
apiModelId: testModelId,
chutesApiKey: "test-chutes-api-key",
})
const model = handlerWithModel.getModel()
expect(model.id).toBe(testModelId)
expect(model.info).toEqual(
expect.objectContaining({
maxTokens: 32768,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
description: "OpenAI GPT OSS 120B model - latest open source coding model.",
temperature: 0.5, // Default temperature for non-DeepSeek models
}),
)
})
it("completePrompt method should return text from Chutes API", async () => {
const expectedResponse = "This is a test response from Chutes"
mockCreate.mockResolvedValueOnce({ choices: [{ message: { content: expectedResponse } }] })