summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/needs_auth/Openai.py
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/Provider/needs_auth/Openai.py')
-rw-r--r--g4f/Provider/needs_auth/Openai.py13
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