Download packages/node-sdk/src/model-provider.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/node-sdk/src/model-provider.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/node-sdk/src/model-provider.ts
-
curl -L -o model-provider.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/node-sdk/src/model-provider.ts
1.23 kB
| import type { BearerTokenProvider } from '@moonshot-ai/kimi-code-oauth'; | |
| import type { | |
| ModelCapability, | |
| ProviderConfig as KosongProviderConfig, | |
| ProviderRequestAuth, | |
| } from '@moonshot-ai/kosong'; | |
| import type { ModelAlias, OAuthRef, ProviderType } from '#/config/index'; | |
| import type { Logger } from '#/logging/index'; | |
| export type { BearerTokenProvider }; | |
| export type OAuthTokenProviderResolver = ( | |
| providerName: string, | |
| oauthRef?: OAuthRef, | |
| ) => BearerTokenProvider | undefined; | |
| export interface ResolvedRuntimeProvider { | |
| readonly providerName: string; | |
| readonly provider: KosongProviderConfig; | |
| readonly modelCapabilities: ModelCapability; | |
| readonly alwaysThinking?: boolean; | |
| readonly supportEfforts?: readonly string[]; | |
| readonly defaultEffort?: string; | |
| readonly maxOutputSize?: number; | |
| readonly type: ProviderType; | |
| readonly protocol: ModelAlias['protocol']; | |
| } | |
| type AuthorizedRequest = <T>( | |
| request: (auth: ProviderRequestAuth) => Promise<T>, | |
| ) => Promise<T>; | |
| export interface ModelProvider { | |
| readonly defaultModel?: string; | |
| resolveProviderConfig(model: string): ResolvedRuntimeProvider; | |
| resolveAuth?(model: string, options?: { readonly log?: Logger }): AuthorizedRequest | undefined; | |
| } | |