XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Update FreeChatgpt.py

c8576592
H Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +2 -1
Modified g4f/Provider/FreeChatgpt.py +2 -1
@@ -5,6 +5,7 @@ from aiohttp import ClientSession, ClientTimeout
5 5
6 6 from ..typing import AsyncResult, Messages
7 7 from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
8 from ..requests.raise_for_status import raise_for_status
8 9
9 10 class FreeChatgpt(AsyncGeneratorProvider, ProviderModelMixin):
10 11 url = "https://free.chatgpt.org.uk"
@@ -45,7 +46,7 @@ class FreeChatgpt(AsyncGeneratorProvider, ProviderModelMixin):
45 46 "top_p": kwargs.get("top_p", 1)
46 47 }
47 48 async with session.post(f'{cls.url}/api/openai/v1/chat/completions', json=data, proxy=proxy) as response:
48 response.raise_for_status()
49 await raise_for_status(response)
49 50 started = False
50 51 async for line in response.content:
51 52 if line.startswith(b"data: [DONE]"):