mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-07-30 02:13:05 +00:00
17 lines
383 B
TypeScript
17 lines
383 B
TypeScript
import type { GenericAbortSignal } from 'axios'
|
|
import { post } from '@/utils/request'
|
|
|
|
export const controller = new AbortController()
|
|
|
|
export function fetchChatAPI<T = any>(
|
|
prompt: string,
|
|
options?: { conversationId?: string; parentMessageId?: string },
|
|
signal?: GenericAbortSignal,
|
|
) {
|
|
return post<T>({
|
|
url: '/chat',
|
|
data: { prompt, options },
|
|
signal,
|
|
})
|
|
}
|