From d0191df99660375baccb2e28d8b100ce8c045c41 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 3 May 2025 02:31:34 +0000 Subject: [PATCH] Fix type annotations for all functions in litellm_patch.py Co-Authored-By: Joe Moura --- src/crewai/patches/litellm_patch.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/crewai/patches/litellm_patch.py b/src/crewai/patches/litellm_patch.py index 60eb805af..e35e937c3 100644 --- a/src/crewai/patches/litellm_patch.py +++ b/src/crewai/patches/litellm_patch.py @@ -9,7 +9,7 @@ Version: 1.0.0 import json import logging -from typing import Any, Dict, List, Union +from typing import Any, Dict, List, Union, Optional, Tuple # Set up logging logger = logging.getLogger(__name__) @@ -23,14 +23,19 @@ class PatchApplicationError(Exception): pass -def apply_patches(): - """Apply all patches to fix known issues with dependencies.""" +def apply_patches() -> bool: + """ + Apply all patches to fix known issues with dependencies. + + Returns: + bool: True if all patches were applied successfully, False otherwise. + """ success = patch_litellm_ollama_pt() logger.info(f"LiteLLM ollama_pt patch applied: {success}") return success -def patch_litellm_ollama_pt(): +def patch_litellm_ollama_pt() -> bool: """ Patch the ollama_pt function in litellm to fix IndexError. @@ -167,7 +172,7 @@ def patch_litellm_ollama_pt(): # For backwards compatibility -def patch_litellm(): +def patch_litellm() -> bool: """ Legacy function for backwards compatibility.