From 00951eb79114adf74ad1a3f1ce596e9e0fa932bf Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Wed, 10 Apr 2024 08:14:50 +0200 Subject: Add OpenRouter and DeepInfraImage Provider (#1814) --- g4f/providers/helper.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'g4f/providers') 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 -- cgit v1.2.3