automatically derive openrouter modelinfo based on modelId when calling getModel() (#7568)
This commit is contained in:
1 parent
7f2d28716f
commit
bd1d6159fc
3 files changed
+61
-7
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { setTimeout as setTimeoutPromise } from "node:timers/promises"
|
||||
import { StateManager } from "@core/storage/StateManager"
|
||||
import { ModelInfo, openRouterDefaultModelId, openRouterDefaultModelInfo } from "@shared/api"
|
||||
import { shouldSkipReasoningForModel } from "@utils/model-utils"
|
||||
import axios from "axios"
|
||||
@@ -214,9 +215,11 @@ export class OpenRouterHandler implements ApiHandler {
|
||||
}
|
||||
|
||||
getModel(): { id: string; info: ModelInfo } {
|
||||
const modelId = this.options.openRouterModelId || openRouterDefaultModelId
|
||||
const cachedModelInfo = StateManager.get().getModelInfo("openRouter", modelId)
|
||||
return {
|
||||
id: this.options.openRouterModelId || openRouterDefaultModelId,
|
||||
info: this.options.openRouterModelInfo || openRouterDefaultModelInfo,
|
||||
id: modelId,
|
||||
info: cachedModelInfo || openRouterDefaultModelInfo,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user