mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
tweak: include usage by default for openai compatible providers (#2788)
This commit is contained in:
@@ -338,6 +338,9 @@ export namespace Provider {
|
|||||||
const s = await state()
|
const s = await state()
|
||||||
const pkg = model.provider?.npm ?? provider.npm ?? provider.id
|
const pkg = model.provider?.npm ?? provider.npm ?? provider.id
|
||||||
const options = { ...s.providers[provider.id]?.options }
|
const options = { ...s.providers[provider.id]?.options }
|
||||||
|
if (pkg.includes("@ai-sdk/openai-compatible") && options["includeUsage"] === undefined) {
|
||||||
|
options["includeUsage"] = true
|
||||||
|
}
|
||||||
const key = Bun.hash.xxHash32(JSON.stringify({ pkg, options }))
|
const key = Bun.hash.xxHash32(JSON.stringify({ pkg, options }))
|
||||||
const existing = s.sdk.get(key)
|
const existing = s.sdk.get(key)
|
||||||
if (existing) return existing
|
if (existing) return existing
|
||||||
|
|||||||
Reference in New Issue
Block a user