XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Fix DeepInfra Provider, Fix Speech Recognition on Phone

c1ca4810
Heiner Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

2 个文件 +3 -5
Modified g4f/Provider/DeepInfra.py +0 -2
@@ -35,7 +35,6 @@ class DeepInfra(Openai):
35 35 'Accept-Encoding': 'gzip, deflate, br',
36 36 'Accept-Language': 'en-US',
37 37 'Connection': 'keep-alive',
38 'Content-Type': None,
39 38 'Origin': 'https://deepinfra.com',
40 39 'Referer': 'https://deepinfra.com/',
41 40 'Sec-Fetch-Dest': 'empty',
@@ -43,7 +42,6 @@ class DeepInfra(Openai):
43 42 'Sec-Fetch-Site': 'same-site',
44 43 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36',
45 44 'X-Deepinfra-Source': 'web-embed',
46 'Accept': None,
47 45 'sec-ch-ua': '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"',
48 46 'sec-ch-ua-mobile': '?0',
49 47 'sec-ch-ua-platform': '"macOS"',
Modified g4f/gui/client/static/js/chat.v1.js +3 -3
@@ -1273,10 +1273,11 @@ if (SpeechRecognition) {
1273 1273 microLabel.classList.add("recognition");
1274 1274 startValue = messageInput.value;
1275 1275 lastDebounceTranscript = "";
1276 timeoutHandle = window.setTimeout(may_stop, 8000);
1276 timeoutHandle = window.setTimeout(may_stop, 10000);
1277 1277 };
1278 1278 recognition.onend = function() {
1279 1279 microLabel.classList.remove("recognition");
1280 messageInput.focus();
1280 1281 };
1281 1282 recognition.onresult = function(event) {
1282 1283 if (!event.results) {
@@ -1297,13 +1298,12 @@ if (SpeechRecognition) {
1297 1298 messageInput.value = `${startValue ? startValue+"\n" : ""}${transcript.trim()}`;
1298 1299 if (isFinal) {
1299 1300 startValue = messageInput.value;
1300 messageInput.focus();
1301 1301 }
1302 1302 messageInput.style.height = messageInput.scrollHeight + "px";
1303 1303 messageInput.scrollTop = messageInput.scrollHeight;
1304 1304 }
1305 1305
1306 timeoutHandle = window.setTimeout(may_stop, transcript ? 8000 : 5000);
1306 timeoutHandle = window.setTimeout(may_stop, transcript ? 10000 : 8000);
1307 1307 };
1308 1308
1309 1309 microLabel.addEventListener("click", () => {