diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-04-10 08:14:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-10 08:14:50 +0200 |
commit | 00951eb79114adf74ad1a3f1ce596e9e0fa932bf (patch) | |
tree | fea75e7745d69b09d91b0003e5dbf12b77380223 /g4f/Provider/needs_auth/Openai.py | |
parent | Update Dockerfile (diff) | |
download | gpt4free-00951eb79114adf74ad1a3f1ce596e9e0fa932bf.tar gpt4free-00951eb79114adf74ad1a3f1ce596e9e0fa932bf.tar.gz gpt4free-00951eb79114adf74ad1a3f1ce596e9e0fa932bf.tar.bz2 gpt4free-00951eb79114adf74ad1a3f1ce596e9e0fa932bf.tar.lz gpt4free-00951eb79114adf74ad1a3f1ce596e9e0fa932bf.tar.xz gpt4free-00951eb79114adf74ad1a3f1ce596e9e0fa932bf.tar.zst gpt4free-00951eb79114adf74ad1a3f1ce596e9e0fa932bf.zip |
Diffstat (limited to 'g4f/Provider/needs_auth/Openai.py')
-rw-r--r-- | g4f/Provider/needs_auth/Openai.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/g4f/Provider/needs_auth/Openai.py b/g4f/Provider/needs_auth/Openai.py index 6cd2cf86..ea09e950 100644 --- a/g4f/Provider/needs_auth/Openai.py +++ b/g4f/Provider/needs_auth/Openai.py @@ -2,10 +2,10 @@ from __future__ import annotations import json +from ..helper import filter_none from ..base_provider import AsyncGeneratorProvider, ProviderModelMixin, FinishReason from ...typing import Union, Optional, AsyncResult, Messages -from ...requests.raise_for_status import raise_for_status -from ...requests import StreamSession +from ...requests import StreamSession, raise_for_status from ...errors import MissingAuthError, ResponseError class Openai(AsyncGeneratorProvider, ProviderModelMixin): @@ -98,11 +98,4 @@ class Openai(AsyncGeneratorProvider, ProviderModelMixin): else {} ), **({} if headers is None else headers) - } - -def filter_none(**kwargs) -> dict: - return { - key: value - for key, value in kwargs.items() - if value is not None - }
\ No newline at end of file + }
\ No newline at end of file |