mirror of
https://github.com/jackhh66/ChatGPT_Web_accessToken.git
synced 2026-12-03 21:19:32 +00:00
feat: add proxy support and fix streaming mode (#122)
This commit is contained in:
1 parent
cc91e95eed
commit
628187f5c3
7 files changed
+250
-12
No files matched your search
+17
-1
@@ -1,4 +1,4 @@
|
||||
import type { GenericAbortSignal } from 'axios'
|
||||
import type { AxiosProgressEvent, GenericAbortSignal } from 'axios'
|
||||
import { post } from '@/utils/request'
|
||||
|
||||
export function fetchChatAPI<T = any>(
|
||||
@@ -18,3 +18,19 @@ export function fetchChatConfig<T = any>() {
|
||||
url: '/config',
|
||||
})
|
||||
}
|
||||
|
||||
/** 实验性质的函数,用于处理聊天过程中的中间结果 */
|
||||
export function fetchChatAPIProcess<T = any>(
|
||||
params: {
|
||||
prompt: string
|
||||
options?: { conversationId?: string; parentMessageId?: string }
|
||||
signal?: GenericAbortSignal
|
||||
onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void },
|
||||
) {
|
||||
return post<T>({
|
||||
url: '/chat-process',
|
||||
data: { prompt: params.prompt, options: params.options },
|
||||
signal: params.signal,
|
||||
onDownloadProgress: params.onDownloadProgress,
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user