summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/selenium/TalkAi.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-26 12:49:52 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-26 12:49:52 +0100
commit1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b (patch)
tree845e5d27d9f94c16215da60aaee0ad36f5a35344 /g4f/Provider/selenium/TalkAi.py
parentNew minimum requirements (#1515) (diff)
downloadgpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar.gz
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar.bz2
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar.lz
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar.xz
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar.zst
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.zip
Diffstat (limited to 'g4f/Provider/selenium/TalkAi.py')
-rw-r--r--g4f/Provider/selenium/TalkAi.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/g4f/Provider/selenium/TalkAi.py b/g4f/Provider/selenium/TalkAi.py
index 5aeb48ac..89280598 100644
--- a/g4f/Provider/selenium/TalkAi.py
+++ b/g4f/Provider/selenium/TalkAi.py
@@ -42,7 +42,7 @@ class TalkAi(AbstractProvider):
"content": message["content"]
} for message in messages],
"model": model if model else "gpt-3.5-turbo",
- "max_tokens": 256,
+ "max_tokens": 2048,
"temperature": 1,
"top_p": 1,
"presence_penalty": 0,
@@ -67,16 +67,15 @@ window._reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
while True:
chunk = driver.execute_script("""
chunk = await window._reader.read();
-if (chunk["done"]) {
+if (chunk.done) {
return null;
}
content = "";
-lines = chunk["value"].split("\\n")
-lines.forEach((line, index) => {
+for (line of chunk.value.split("\\n")) {
if (line.startsWith('data: ')) {
content += line.substring('data: '.length);
}
-});
+}
return content;
""")
if chunk: