mirror of https://github.com/xtekky/gpt4free.git
Fix DeepInfra Provider, Fix Speech Recognition on Phone
This commit is contained in:
parent
009a67239a
commit
c1ca481074
|
@ -35,7 +35,6 @@ class DeepInfra(Openai):
|
|||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
'Accept-Language': 'en-US',
|
||||
'Connection': 'keep-alive',
|
||||
'Content-Type': None,
|
||||
'Origin': 'https://deepinfra.com',
|
||||
'Referer': 'https://deepinfra.com/',
|
||||
'Sec-Fetch-Dest': 'empty',
|
||||
|
@ -43,7 +42,6 @@ class DeepInfra(Openai):
|
|||
'Sec-Fetch-Site': 'same-site',
|
||||
'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',
|
||||
'X-Deepinfra-Source': 'web-embed',
|
||||
'Accept': None,
|
||||
'sec-ch-ua': '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"',
|
||||
'sec-ch-ua-mobile': '?0',
|
||||
'sec-ch-ua-platform': '"macOS"',
|
||||
|
|
|
@ -1273,10 +1273,11 @@ if (SpeechRecognition) {
|
|||
microLabel.classList.add("recognition");
|
||||
startValue = messageInput.value;
|
||||
lastDebounceTranscript = "";
|
||||
timeoutHandle = window.setTimeout(may_stop, 8000);
|
||||
timeoutHandle = window.setTimeout(may_stop, 10000);
|
||||
};
|
||||
recognition.onend = function() {
|
||||
microLabel.classList.remove("recognition");
|
||||
messageInput.focus();
|
||||
};
|
||||
recognition.onresult = function(event) {
|
||||
if (!event.results) {
|
||||
|
@ -1297,13 +1298,12 @@ if (SpeechRecognition) {
|
|||
messageInput.value = `${startValue ? startValue+"\n" : ""}${transcript.trim()}`;
|
||||
if (isFinal) {
|
||||
startValue = messageInput.value;
|
||||
messageInput.focus();
|
||||
}
|
||||
messageInput.style.height = messageInput.scrollHeight + "px";
|
||||
messageInput.scrollTop = messageInput.scrollHeight;
|
||||
}
|
||||
|
||||
timeoutHandle = window.setTimeout(may_stop, transcript ? 8000 : 5000);
|
||||
timeoutHandle = window.setTimeout(may_stop, transcript ? 10000 : 8000);
|
||||
};
|
||||
|
||||
microLabel.addEventListener("click", () => {
|
||||
|
|
Loading…
Reference in New Issue