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

XFEstudio/gpt4free

Update DeepInfra.py

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

代码差异

1 个文件 +3 -3
Modified g4f/Provider/DeepInfra.py +3 -3
@@ -2,9 +2,9 @@ from __future__ import annotations
2 2
3 3 import json
4 4 import requests
5 from ..typing import AsyncResult, Messages
5 from ..typing import AsyncResult, Messages
6 6 from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
7 from ..requests import StreamSession
7 from ..requests import StreamSession, raise_for_status
8 8
9 9 class DeepInfra(AsyncGeneratorProvider, ProviderModelMixin):
10 10 url = "https://deepinfra.com"
@@ -67,7 +67,7 @@ class DeepInfra(AsyncGeneratorProvider, ProviderModelMixin):
67 67 }
68 68 async with session.post('https://api.deepinfra.com/v1/openai/chat/completions',
69 69 json=json_data) as response:
70 response.raise_for_status()
70 await raise_for_status(response)
71 71 first = True
72 72 async for line in response.iter_lines():
73 73 if not line.startswith(b"data: "):