bwilkie commited on
Commit
56b7f2d
·
verified ·
1 Parent(s): 4e299e5

Update multiagents.py

Browse files
Files changed (1) hide show
  1. multiagents.py +28 -8
multiagents.py CHANGED
@@ -55,14 +55,34 @@ dotenv.load_dotenv()
55
  # max_tokens=4000,
56
  # )
57
 
58
-
59
- #InferenceClientModel InferenceClient
60
- My_Agent = InferenceClientModel(
61
- provider="groq",
62
- api_key=os.getenv("GROQ_API_KEY"), # Your Replicate API key
63
- model_id = "qwen/qwen3-32b"
64
- )
65
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
 
68
  # My_Agent = client.chat.completions.create(
 
55
  # max_tokens=4000,
56
  # )
57
 
58
+ # SETUP AND TEST
59
+
60
+ try:
61
+ #InferenceClientModel InferenceClient
62
+ My_Agent = InferenceClientModel(
63
+ provider="groq",
64
+ api_key=os.getenv("GROQ_API_KEY"),
65
+ model_id = "qwen/qwen3-32b"
66
+ )
67
+
68
+ output_test = MyAgent('What are the 3 laws of robotics')
69
+ print('1', output_test)
70
+
71
+ except:
72
+ # Check if API key is available
73
+ groq_api_key = os.getenv("GROQ_API_KEY")
74
+ if not groq_api_key:
75
+ raise ValueError("GROQ_API_KEY environment variable is not set")
76
+
77
+ # Fixed model initialization - use LiteLLMModel instead of InferenceClientModel for Groq
78
+ My_Agent = LiteLLMModel(
79
+ model_id="groq/qwen3-32b", # Use a valid Groq model ID
80
+ api_key=groq_api_key,
81
+ temperature=0.1,
82
+ max_tokens=4000,
83
+ )
84
+ output_test = MyAgent('What are the 3 laws of robotics')
85
+ print('2', output_test)
86
 
87
 
88
  # My_Agent = client.chat.completions.create(