mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-19 10:02:04 +08:00
feat(cli): enable explicit prompt cache options for OpenAI models on Kilo Gateway
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
kiloconnect[bot]
parent
2f72a8b72d
commit
1b0f94ec74
@@ -3127,6 +3127,41 @@ describe("ProviderTransform.message - cache control on gateway", () => {
|
||||
})
|
||||
expect(result[1].content[1].providerOptions?.openai?.promptCacheBreakpoint).toBeUndefined()
|
||||
})
|
||||
|
||||
test("kilo gateway with openai gpt-5.6 applies caching options", () => {
|
||||
const model = createModel({
|
||||
providerID: "kilo",
|
||||
api: {
|
||||
id: "openai/gpt-5.6",
|
||||
url: "https://api.kilo.ai/api/gateway",
|
||||
npm: "@kilocode/kilo-gateway",
|
||||
},
|
||||
id: "openai/gpt-5.6",
|
||||
})
|
||||
const msgs = [
|
||||
{
|
||||
role: "system",
|
||||
content: "You are a helpful assistant",
|
||||
},
|
||||
{
|
||||
role: "user",
|
||||
content: "Hello",
|
||||
},
|
||||
] as any[]
|
||||
|
||||
const result = ProviderTransform.message(msgs, model, {}) as any[]
|
||||
|
||||
expect(result[0].providerOptions.openrouter).toEqual({
|
||||
cacheControl: {
|
||||
type: "ephemeral",
|
||||
},
|
||||
})
|
||||
expect(result[1].providerOptions.openrouter).toEqual({
|
||||
cacheControl: {
|
||||
type: "ephemeral",
|
||||
},
|
||||
})
|
||||
})
|
||||
// kilocode_change end
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user