mirror of
				https://github.com/Yidadaa/ChatGPT-Next-Web.git
				synced 2025-11-04 16:57:27 +08:00 
			
		
		
		
	Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web
This commit is contained in:
		@@ -25,11 +25,9 @@ export class GeminiProApi implements LLMApi {
 | 
				
			|||||||
      baseUrl = accessStore.googleUrl;
 | 
					      baseUrl = accessStore.googleUrl;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const isApp = !!getClientConfig()?.isApp;
 | 
				
			||||||
    if (baseUrl.length === 0) {
 | 
					    if (baseUrl.length === 0) {
 | 
				
			||||||
      const isApp = !!getClientConfig()?.isApp;
 | 
					      baseUrl = isApp ? DEFAULT_API_HOST + `/api/proxy/google` : ApiPath.Google;
 | 
				
			||||||
      baseUrl = isApp
 | 
					 | 
				
			||||||
        ? DEFAULT_API_HOST + `/api/proxy/google?key=${accessStore.googleApiKey}`
 | 
					 | 
				
			||||||
        : ApiPath.Google;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (baseUrl.endsWith("/")) {
 | 
					    if (baseUrl.endsWith("/")) {
 | 
				
			||||||
      baseUrl = baseUrl.slice(0, baseUrl.length - 1);
 | 
					      baseUrl = baseUrl.slice(0, baseUrl.length - 1);
 | 
				
			||||||
@@ -43,6 +41,10 @@ export class GeminiProApi implements LLMApi {
 | 
				
			|||||||
    let chatPath = [baseUrl, path].join("/");
 | 
					    let chatPath = [baseUrl, path].join("/");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    chatPath += chatPath.includes("?") ? "&alt=sse" : "?alt=sse";
 | 
					    chatPath += chatPath.includes("?") ? "&alt=sse" : "?alt=sse";
 | 
				
			||||||
 | 
					    // if chatPath.startsWith('http') then add key in query string
 | 
				
			||||||
 | 
					    if (chatPath.startsWith("http") && accessStore.googleApiKey) {
 | 
				
			||||||
 | 
					      chatPath += `&key=${accessStore.googleApiKey}`;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    return chatPath;
 | 
					    return chatPath;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  extractMessage(res: any) {
 | 
					  extractMessage(res: any) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user