import ExpiryMap from 'expiry-map'; import { Context, Dict, Quester, Schema } from 'koishi'; export interface Conversation { conversationId?: string; messageId?: string; message: string; } declare class ChatGPT { config: ChatGPT.Config; protected http: Quester; protected _accessTokenCache: ExpiryMap; constructor(ctx: Context, config: ChatGPT.Config); getIsAuthenticated(): Promise; ensureAuth(): Promise; /** * Sends a message to ChatGPT, waits for the response to resolve, and returns * the response. * * @param message - The plaintext message to send. * @param opts.conversationId - Optional ID of the previous message in a conversation */ sendMessage(conversation: Conversation): Promise>; refreshAccessToken(): Promise; } declare namespace ChatGPT { interface Config { sessionToken: string; cloudflareToken: string; endpoint: string; markdown?: boolean; headers?: Dict; proxyAgent?: string; } const Config: Schema; } export default ChatGPT;