From 6ac4cf906a84569b127cc446aee7069ddaee85ce Mon Sep 17 00:00:00 2001 From: Leonid Kuligin Date: Tue, 13 Feb 2024 21:18:43 +0100 Subject: [PATCH] fix linting --- libs/genai/langchain_google_genai/chat_models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/genai/langchain_google_genai/chat_models.py b/libs/genai/langchain_google_genai/chat_models.py index 37cc5f342..269ae8f03 100644 --- a/libs/genai/langchain_google_genai/chat_models.py +++ b/libs/genai/langchain_google_genai/chat_models.py @@ -341,7 +341,9 @@ def _parse_chat_history( return messages -def _parts_to_content(parts: List[genai.types.PartType]) -> Union[List[dict], str]: +def _parts_to_content( + parts: List[genai.types.PartType], +) -> Union[str, List[Union[str, dict]]]: """Converts a list of Gemini API Part objects into a list of LangChain messages.""" if len(parts) == 1 and parts[0].text is not None and not parts[0].inline_data: # Simple text response. The typical response