summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/selenium/TalkAi.py
diff options
context:
space:
mode:
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: