feat(plugin): pass request context to provider fetch
This commit is contained in:
parent
c0bc020ad6
commit
0623069210
3 changed files with 98 additions and 20 deletions
|
|
@ -79,6 +79,30 @@ export type PluginModule = {
|
|||
tui?: never
|
||||
}
|
||||
|
||||
export type ExperimentalFetchContext = {
|
||||
sessionID: string
|
||||
parentSessionID?: string
|
||||
agent: {
|
||||
name: string
|
||||
mode: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
model: ModelV2
|
||||
provider: ProviderV2
|
||||
message: UserMessage
|
||||
messages: unknown[]
|
||||
system: string[]
|
||||
headers: Record<string, string>
|
||||
tools: string[]
|
||||
small?: boolean
|
||||
}
|
||||
|
||||
export type ExperimentalFetch = (
|
||||
input: RequestInfo | URL,
|
||||
init?: RequestInit,
|
||||
context?: ExperimentalFetchContext,
|
||||
) => Promise<Response>
|
||||
|
||||
type Rule = {
|
||||
key: string
|
||||
op: "eq" | "neq"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue