From f941c57688c74d09a49719d8298c47df49f3f602 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 30 Jan 2024 08:31:21 -0800 Subject: [PATCH] (fix) use isinstance to check types --- litellm/llms/bedrock.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/litellm/llms/bedrock.py b/litellm/llms/bedrock.py index 16a0abbed7b..b67061c76b2 100644 --- a/litellm/llms/bedrock.py +++ b/litellm/llms/bedrock.py @@ -702,7 +702,7 @@ def _embedding_func_single( encoding=None, logging_obj=None, ): - if type(input) != str: + if isinstance(input, str) is False: raise BedrockError( message="Bedrock Embedding API input must be type str | List[str]", status_code=400, @@ -800,7 +800,8 @@ def embedding( aws_role_name=aws_role_name, aws_session_name=aws_session_name, ) - if type(input) == str: + if isinstance(input, str): + ## Embedding Call embeddings = [ _embedding_func_single( model, @@ -810,8 +811,8 @@ def embedding( logging_obj=logging_obj, ) ] - elif type(input) == list: - ## Embedding Call + elif isinstance(input, list): + ## Embedding Call - assuming this is a List[str] embeddings = [ _embedding_func_single( model,