summaryrefslogtreecommitdiffstats
path: root/g4f/providers/helper.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-10 08:14:50 +0200
committerGitHub <noreply@github.com>2024-04-10 08:14:50 +0200
commit00951eb79114adf74ad1a3f1ce596e9e0fa932bf (patch)
treefea75e7745d69b09d91b0003e5dbf12b77380223 /g4f/providers/helper.py
parentUpdate Dockerfile (diff)
downloadgpt4free-0.2.9.2.tar
gpt4free-0.2.9.2.tar.gz
gpt4free-0.2.9.2.tar.bz2
gpt4free-0.2.9.2.tar.lz
gpt4free-0.2.9.2.tar.xz
gpt4free-0.2.9.2.tar.zst
gpt4free-0.2.9.2.zip
Diffstat (limited to '')
-rw-r--r--g4f/providers/helper.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/g4f/providers/helper.py b/g4f/providers/helper.py
index 5f3b4fb6..0ec9aac2 100644
--- a/g4f/providers/helper.py
+++ b/g4f/providers/helper.py
@@ -49,4 +49,11 @@ def get_random_hex(length: int = 32) -> str:
return ''.join(
random.choice("abcdef" + string.digits)
for _ in range(length)
- ) \ No newline at end of file
+ )
+
+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