mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
Fix type annotations for all functions in litellm_patch.py
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -9,7 +9,7 @@ Version: 1.0.0
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Dict, List, Union
|
from typing import Any, Dict, List, Union, Optional, Tuple
|
||||||
|
|
||||||
# Set up logging
|
# Set up logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -23,14 +23,19 @@ class PatchApplicationError(Exception):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def apply_patches():
|
def apply_patches() -> bool:
|
||||||
"""Apply all patches to fix known issues with dependencies."""
|
"""
|
||||||
|
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()
|
success = patch_litellm_ollama_pt()
|
||||||
logger.info(f"LiteLLM ollama_pt patch applied: {success}")
|
logger.info(f"LiteLLM ollama_pt patch applied: {success}")
|
||||||
return success
|
return success
|
||||||
|
|
||||||
|
|
||||||
def patch_litellm_ollama_pt():
|
def patch_litellm_ollama_pt() -> bool:
|
||||||
"""
|
"""
|
||||||
Patch the ollama_pt function in litellm to fix IndexError.
|
Patch the ollama_pt function in litellm to fix IndexError.
|
||||||
|
|
||||||
@@ -167,7 +172,7 @@ def patch_litellm_ollama_pt():
|
|||||||
|
|
||||||
|
|
||||||
# For backwards compatibility
|
# For backwards compatibility
|
||||||
def patch_litellm():
|
def patch_litellm() -> bool:
|
||||||
"""
|
"""
|
||||||
Legacy function for backwards compatibility.
|
Legacy function for backwards compatibility.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user