summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Ylokh.py
diff options
context:
space:
mode:
authorTekky <98614666+xtekky@users.noreply.github.com>2023-09-19 00:54:28 +0200
committerGitHub <noreply@github.com>2023-09-19 00:54:28 +0200
commita54291cb7c9dbaf3d092e62f49e0186ee1be0aee (patch)
treef901c6b0cada1b04021d1fd62f8bf45029786949 /g4f/Provider/Ylokh.py
parentMerge branch 'main' of https://github.com/xtekky/gpt4free (diff)
parentCheck supports_stream in best_providers list (diff)
downloadgpt4free-a54291cb7c9dbaf3d092e62f49e0186ee1be0aee.tar
gpt4free-a54291cb7c9dbaf3d092e62f49e0186ee1be0aee.tar.gz
gpt4free-a54291cb7c9dbaf3d092e62f49e0186ee1be0aee.tar.bz2
gpt4free-a54291cb7c9dbaf3d092e62f49e0186ee1be0aee.tar.lz
gpt4free-a54291cb7c9dbaf3d092e62f49e0186ee1be0aee.tar.xz
gpt4free-a54291cb7c9dbaf3d092e62f49e0186ee1be0aee.tar.zst
gpt4free-a54291cb7c9dbaf3d092e62f49e0186ee1be0aee.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/Ylokh.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/g4f/Provider/Ylokh.py b/g4f/Provider/Ylokh.py
index 1986b6d3..c7b92089 100644
--- a/g4f/Provider/Ylokh.py
+++ b/g4f/Provider/Ylokh.py
@@ -51,7 +51,9 @@ class Ylokh(AsyncGeneratorProvider):
if stream:
async for line in response.content:
line = line.decode()
- if line.startswith("data: ") and not line.startswith("data: [DONE]"):
+ if line.startswith("data: "):
+ if line.startswith("data: [DONE]"):
+ break
line = json.loads(line[6:-1])
content = line["choices"][0]["delta"].get("content")
if content:
@@ -71,6 +73,7 @@ class Ylokh(AsyncGeneratorProvider):
("stream", "bool"),
("proxy", "str"),
("temperature", "float"),
+ ("top_p", "float"),
]
param = ", ".join([": ".join(p) for p in params])
return f"g4f.provider.{cls.__name__} supports: ({param})" \ No newline at end of file