mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Fix invalid json in AI doc SSE stream (#20706)
fix: invalid json in ai doc sse stream
This commit is contained in:
1 parent
00aac39f77
commit
0417b8d96e
7 files changed
+7
-54
No files matched your search
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
declare module 'sse.js' {
|
||||
export type SSEOptions = EventSourceInit & {
|
||||
headers?: Record<string, string>
|
||||
payload?: string
|
||||
method?: string
|
||||
}
|
||||
|
||||
export class SSE extends EventSource {
|
||||
constructor(url: string | URL, sseOptions?: SSEOptions)
|
||||
stream(): void
|
||||
}
|
||||
}
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
declare module 'sse.js' {
|
||||
export type SSEOptions = EventSourceInit & {
|
||||
headers?: Record<string, string>
|
||||
payload?: string
|
||||
method?: string
|
||||
}
|
||||
|
||||
export class SSE extends EventSource {
|
||||
constructor(url: string | URL, sseOptions?: SSEOptions)
|
||||
stream(): void
|
||||
}
|
||||
}
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
declare module 'sse.js' {
|
||||
export type SSEOptions = EventSourceInit & {
|
||||
headers?: Record<string, string>
|
||||
payload?: string
|
||||
method?: string
|
||||
}
|
||||
|
||||
export class SSE extends EventSource {
|
||||
constructor(url: string | URL, sseOptions?: SSEOptions)
|
||||
stream(): void
|
||||
}
|
||||
}
|
||||
Generated
+4
-3
@@ -32964,8 +32964,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/sse.js": {
|
||||
"version": "0.6.1",
|
||||
"license": "Apache-2.0"
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/sse.js/-/sse.js-2.2.0.tgz",
|
||||
"integrity": "sha512-v1ciaikunC99FKS23rS973HYU0DnnvugtX13UggNvrgRUSungaGeLmKlm57t0dI2E1TcCqzc2Pj2njBDXFIpKQ=="
|
||||
},
|
||||
"node_modules/ssr-window": {
|
||||
"version": "3.0.0",
|
||||
@@ -37217,7 +37218,7 @@
|
||||
"react-tooltip": "^4.2.17",
|
||||
"reactflow": "^11.10.1",
|
||||
"remark-gfm": "^3.0.1",
|
||||
"sse.js": "^0.6.1",
|
||||
"sse.js": "^2.2.0",
|
||||
"tailwind-merge": "^1.13.2",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"tailwindcss-animate": "^1.0.6",
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
"react-tooltip": "^4.2.17",
|
||||
"reactflow": "^11.10.1",
|
||||
"remark-gfm": "^3.0.1",
|
||||
"sse.js": "^0.6.1",
|
||||
"sse.js": "^2.2.0",
|
||||
"tailwind-merge": "^1.13.2",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"tailwindcss-animate": "^1.0.6",
|
||||
|
||||
@@ -198,7 +198,7 @@ export function useAiChat({
|
||||
}
|
||||
|
||||
eventSource.addEventListener('error', handleError)
|
||||
eventSource.addEventListener('message', (e) => {
|
||||
eventSource.addEventListener('message', (e: MessageEvent) => {
|
||||
try {
|
||||
setIsLoading?.(false)
|
||||
|
||||
@@ -307,7 +307,7 @@ export function queryAi(messages: Message[], timeout = 0) {
|
||||
let answer = ''
|
||||
|
||||
eventSource.addEventListener('error', handleError)
|
||||
eventSource.addEventListener('message', (e) => {
|
||||
eventSource.addEventListener('message', (e: MessageEvent) => {
|
||||
try {
|
||||
if (e.data === '[DONE]') {
|
||||
if (timeoutId) {
|
||||
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
declare module 'sse.js' {
|
||||
export type SSEOptions = EventSourceInit & {
|
||||
headers?: Record<string, string>
|
||||
payload?: string
|
||||
method?: string
|
||||
}
|
||||
|
||||
export class SSE extends EventSource {
|
||||
constructor(url: string | URL, sseOptions?: SSEOptions)
|
||||
stream(): void
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user