summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-06 23:47:42 +0200
committerGitHub <noreply@github.com>2024-04-06 23:47:42 +0200
commit7f16b7bb214cad17f4da2da3601dafd9658639c5 (patch)
tree08e4132500f6d125ad1ecfb91c22aa2ecabb5b4f /g4f
parentUpdate ChatgptFree.py (diff)
downloadgpt4free-7f16b7bb214cad17f4da2da3601dafd9658639c5.tar
gpt4free-7f16b7bb214cad17f4da2da3601dafd9658639c5.tar.gz
gpt4free-7f16b7bb214cad17f4da2da3601dafd9658639c5.tar.bz2
gpt4free-7f16b7bb214cad17f4da2da3601dafd9658639c5.tar.lz
gpt4free-7f16b7bb214cad17f4da2da3601dafd9658639c5.tar.xz
gpt4free-7f16b7bb214cad17f4da2da3601dafd9658639c5.tar.zst
gpt4free-7f16b7bb214cad17f4da2da3601dafd9658639c5.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/DeepInfra.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/g4f/Provider/DeepInfra.py b/g4f/Provider/DeepInfra.py
index f44679ff..6cf52694 100644
--- a/g4f/Provider/DeepInfra.py
+++ b/g4f/Provider/DeepInfra.py
@@ -2,9 +2,9 @@ from __future__ import annotations
import json
import requests
-from ..typing import AsyncResult, Messages
+from ..typing import AsyncResult, Messages
from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
-from ..requests import StreamSession
+from ..requests import StreamSession, raise_for_status
class DeepInfra(AsyncGeneratorProvider, ProviderModelMixin):
url = "https://deepinfra.com"
@@ -67,7 +67,7 @@ class DeepInfra(AsyncGeneratorProvider, ProviderModelMixin):
}
async with session.post('https://api.deepinfra.com/v1/openai/chat/completions',
json=json_data) as response:
- response.raise_for_status()
+ await raise_for_status(response)
first = True
async for line in response.iter_lines():
if not line.startswith(b"data: "):