31 lines
660 B
TypeScript
31 lines
660 B
TypeScript
import type { FetchFn, openai } from 'chatgpt'
|
|
|
|
export interface ChatContext {
|
|
conversationId?: string
|
|
parentMessageId?: string
|
|
}
|
|
|
|
export interface ChatGPTAPIOptions {
|
|
apiKey: string
|
|
debug?: boolean
|
|
completionParams?: Partial<openai.CompletionParams>
|
|
}
|
|
|
|
export interface ChatGPTUnofficialProxyAPIOptions {
|
|
accessToken: string
|
|
apiReverseProxyUrl?: string
|
|
model?: string
|
|
debug?: boolean
|
|
headers?: Record<string, string>
|
|
fetch?: FetchFn
|
|
}
|
|
|
|
export interface ModelConfig {
|
|
apiModel?: ApiModel
|
|
reverseProxy?: string
|
|
timeoutMs?: number
|
|
socksProxy?: string
|
|
}
|
|
|
|
export type ApiModel = 'ChatGPTAPI' | 'ChatGPTUnofficialProxyAPI' | undefined
|