lloydzhou il y a 1 an
Parent
commit
9be58f3eb4

+ 1 - 1
app/client/platforms/alibaba.ts

@@ -179,7 +179,7 @@ export class QwenApi implements LLMApi {
         controller.signal.onabort = finish;
 
         fetchEventSource(chatPath, {
-          fetch,
+          fetch: fetch as any,
           ...chatPayload,
           async onopen(res) {
             clearTimeout(requestTimeoutId);

+ 1 - 1
app/client/platforms/baidu.ts

@@ -198,7 +198,7 @@ export class ErnieApi implements LLMApi {
         controller.signal.onabort = finish;
 
         fetchEventSource(chatPath, {
-          fetch,
+          fetch: fetch as any,
           ...chatPayload,
           async onopen(res) {
             clearTimeout(requestTimeoutId);

+ 1 - 1
app/client/platforms/bytedance.ts

@@ -166,7 +166,7 @@ export class DoubaoApi implements LLMApi {
         controller.signal.onabort = finish;
 
         fetchEventSource(chatPath, {
-          fetch,
+          fetch: fetch as any,
           ...chatPayload,
           async onopen(res) {
             clearTimeout(requestTimeoutId);

+ 1 - 1
app/client/platforms/google.ts

@@ -214,7 +214,7 @@ export class GeminiProApi implements LLMApi {
         controller.signal.onabort = finish;
 
         fetchEventSource(chatPath, {
-          fetch,
+          fetch: fetch as any,
           ...chatPayload,
           async onopen(res) {
             clearTimeout(requestTimeoutId);

+ 1 - 1
app/client/platforms/iflytek.ts

@@ -150,7 +150,7 @@ export class SparkApi implements LLMApi {
         controller.signal.onabort = finish;
 
         fetchEventSource(chatPath, {
-          fetch,
+          fetch: fetch as any,
           ...chatPayload,
           async onopen(res) {
             clearTimeout(requestTimeoutId);

+ 1 - 1
app/client/platforms/tencent.ts

@@ -178,7 +178,7 @@ export class HunyuanApi implements LLMApi {
         controller.signal.onabort = finish;
 
         fetchEventSource(chatPath, {
-          fetch,
+          fetch: fetch as any,
           ...chatPayload,
           async onopen(res) {
             clearTimeout(requestTimeoutId);

+ 1 - 1
app/store/sync.ts

@@ -25,7 +25,7 @@ export type SyncStore = GetStoreState<typeof useSyncStore>;
 const DEFAULT_SYNC_STATE = {
   provider: ProviderType.WebDAV,
   useProxy: true,
-  proxyUrl: ApiPath.Cors,
+  proxyUrl: ApiPath.Cors as string,
 
   webdav: {
     endpoint: "",

+ 1 - 1
app/utils/chat.ts

@@ -288,7 +288,7 @@ export function stream(
       REQUEST_TIMEOUT_MS,
     );
     fetchEventSource(chatPath, {
-      fetch: tauriFetch,
+      fetch: tauriFetch as any,
       ...chatPayload,
       async onopen(res) {
         clearTimeout(requestTimeoutId);

+ 1 - 1
app/utils/stream.ts

@@ -63,7 +63,7 @@ export function fetch(url: string, options?: RequestInit): Promise<any> {
       })
       .then((u: Function) => (unlisten = u));
 
-    const headers = {
+    const headers: Record<string, string> = {
       Accept: "application/json, text/plain, */*",
       "Accept-Language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
       "User-Agent": navigator.userAgent,