From 2edda67b4c0292829970b8dcbe9107931b618806 Mon Sep 17 00:00:00 2001 From: phact Date: Tue, 2 Apr 2024 00:30:04 -0400 Subject: [PATCH] only cast str because of https://github.com/BerriAI/litellm/pull/2790 --- impl/services/inference_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impl/services/inference_utils.py b/impl/services/inference_utils.py index fd4aa73..c209202 100644 --- a/impl/services/inference_utils.py +++ b/impl/services/inference_utils.py @@ -95,7 +95,7 @@ async def get_async_chat_completion_response( type_hints = get_type_hints(acompletion) for key, value in litellm_kwargs.items(): - if value is not None and key in type_hints: + if value is not None and key in type_hints and isinstance(value, str): type_hint = type_hints[key] # handle optional if hasattr(type_hint, "__origin__") and type_hint.__origin__ == Union: