summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/ChatifyAI.py
diff options
context:
space:
mode:
authorkqlio67 <kqlio67@users.noreply.github.com>2024-10-15 20:07:41 +0200
committerkqlio67 <kqlio67@users.noreply.github.com>2024-10-15 20:07:41 +0200
commitaef705021f6e78d9d312bdb624af3728544ee0da (patch)
tree5309e30dacd0b4b9bfe5d6c3d68a129f3b3eb6b1 /g4f/Provider/ChatifyAI.py
parentUpdated(README.md) (diff)
downloadgpt4free-aef705021f6e78d9d312bdb624af3728544ee0da.tar
gpt4free-aef705021f6e78d9d312bdb624af3728544ee0da.tar.gz
gpt4free-aef705021f6e78d9d312bdb624af3728544ee0da.tar.bz2
gpt4free-aef705021f6e78d9d312bdb624af3728544ee0da.tar.lz
gpt4free-aef705021f6e78d9d312bdb624af3728544ee0da.tar.xz
gpt4free-aef705021f6e78d9d312bdb624af3728544ee0da.tar.zst
gpt4free-aef705021f6e78d9d312bdb624af3728544ee0da.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/ChatifyAI.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/g4f/Provider/ChatifyAI.py b/g4f/Provider/ChatifyAI.py
index a999afac..7e43b065 100644
--- a/g4f/Provider/ChatifyAI.py
+++ b/g4f/Provider/ChatifyAI.py
@@ -65,19 +65,15 @@ class ChatifyAI(AsyncGeneratorProvider, ProviderModelMixin):
response.raise_for_status()
response_text = await response.text()
- # Фільтруємо та форматуємо відповідь
filtered_response = cls.filter_response(response_text)
yield filtered_response
@staticmethod
def filter_response(response_text: str) -> str:
- # Розділяємо рядок на частини
parts = response_text.split('"')
- # Вибираємо лише текстові частини (кожна друга частина)
text_parts = parts[1::2]
- # Об'єднуємо текстові частини
clean_text = ''.join(text_parts)
return clean_text