Add support for anthropic (#1819)
This commit is contained in:
@@ -7,16 +7,7 @@ from typing import Dict, List, Optional
|
||||
try:
|
||||
from groq import Groq
|
||||
except ImportError:
|
||||
user_input = input("The 'groq' library is required. Install it now? [y/N]: ")
|
||||
if user_input.lower() == 'y':
|
||||
try:
|
||||
subprocess.check_call([sys.executable, "-m", "pip", "install", "groq"])
|
||||
from groq import Groq
|
||||
except subprocess.CalledProcessError:
|
||||
print("Failed to install 'groq'. Please install it manually using 'pip install groq'.")
|
||||
sys.exit(1)
|
||||
else:
|
||||
raise ImportError("The required 'groq' library is not installed.")
|
||||
raise ImportError("The 'groq' library is required. Please install it using 'pip install groq'.")
|
||||
|
||||
from mem0.llms.base import LLMBase
|
||||
from mem0.configs.llms.base import BaseLlmConfig
|
||||
@@ -28,7 +19,6 @@ class GroqLLM(LLMBase):
|
||||
|
||||
if not self.config.model:
|
||||
self.config.model = "llama3-70b-8192"
|
||||
self.client = Groq()
|
||||
|
||||
api_key = self.config.api_key or os.getenv("GROQ_API_KEY")
|
||||
self.client = Groq(api_key=api_key)
|
||||
|
||||
Reference in New Issue
Block a user