fix: correct Provider type in chat.params plugin hook (#5003)

pull/5011/head
Ben Vargas 2025-12-02 21:50:21 -07:00 committed by GitHub
parent f2fd0f8f00
commit 6c25e64658
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -16,6 +16,12 @@ import { type ToolDefinition } from "./tool"
export * from "./tool"
export type ProviderContext = {
source: "env" | "config" | "custom" | "api"
info: Provider
options: Record<string, any>
}
export type PluginInput = {
client: ReturnType<typeof createOpencodeClient>
project: Project
@ -153,7 +159,7 @@ export interface Hooks {
* Modify parameters sent to LLM
*/
"chat.params"?: (
input: { sessionID: string; agent: string; model: Model; provider: Provider; message: UserMessage },
input: { sessionID: string; agent: string; model: Model; provider: ProviderContext; message: UserMessage },
output: { temperature: number; topP: number; options: Record<string, any> },
) => Promise<void>
"permission.ask"?: (input: Permission, output: { status: "ask" | "deny" | "allow" }) => Promise<void>