Suppressed userWarnings from litellm pydantic issues

This commit is contained in:
Brandon Hancock
2024-12-31 11:19:48 -05:00
parent 4469461b38
commit b0d545992a
6 changed files with 66 additions and 40 deletions

View File

@@ -1,3 +1,4 @@
import warnings
from typing import Any, Optional, Type
@@ -25,9 +26,10 @@ class InternalInstructor:
if self.agent and not self.llm:
self.llm = self.agent.function_calling_llm or self.agent.llm
# Lazy import
import instructor
from litellm import completion
with warnings.catch_warnings():
warnings.simplefilter("ignore", UserWarning)
import instructor
from litellm import completion
self._client = instructor.from_litellm(
completion,