Skip to content

Commit

Permalink
renove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
tcapelle committed Oct 17, 2024
1 parent 5cc14e3 commit 644d327
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions weave/flow/scorers/llm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,4 @@ def embed(
return [embedding.embedding for embedding in response.data]
else:
raise ValueError(f"Unsupported client type: {type(client).__name__.lower()}")


# Helper function for dynamic imports
def import_client(provider: str) -> Optional[_LLM_CLIENTS]: # type: ignore
try:
if provider == "openai":
from openai import OpenAI

return OpenAI
elif provider == "anthropic":
import anthropic

return anthropic.Anthropic
elif provider == "mistral":
from mistralai import Mistral

return Mistral
elif provider == "gemini":
from google.generativeai import GenerativeModel

return GenerativeModel
except ImportError:
return None

0 comments on commit 644d327

Please sign in to comment.