Spaces:
Sleeping
Sleeping
Update multiagents.py
Browse files- multiagents.py +10 -10
multiagents.py
CHANGED
@@ -59,32 +59,32 @@ dotenv.load_dotenv()
|
|
59 |
|
60 |
|
61 |
try:
|
|
|
|
|
|
|
62 |
#InferenceClientModel InferenceClient
|
63 |
My_Agent = InferenceClientModel(
|
64 |
provider="groq",
|
65 |
-
api_key=
|
66 |
model_id = "qwen/qwen3-32b"
|
67 |
)
|
68 |
-
|
69 |
-
api_key.strip()
|
70 |
test_messages = [{"role": "user", "content": "What are the 3 laws of robotics"}]
|
71 |
output_test = My_Agent(test_messages)
|
72 |
print('1', output_test)
|
73 |
|
74 |
except:
|
75 |
-
|
76 |
-
|
|
|
77 |
|
78 |
-
if not
|
79 |
raise ValueError("GROQ_API_KEY environment variable is not set")
|
80 |
-
if api_key:
|
81 |
-
api_key.strip()
|
82 |
-
|
83 |
|
84 |
# Fixed model initialization - use LiteLLMModel instead of InferenceClientModel for Groq
|
85 |
My_Agent = LiteLLMModel(
|
86 |
model_id="groq/qwen3-32b", # Use a valid Groq model ID
|
87 |
-
api_key=
|
88 |
temperature=0.1,
|
89 |
max_tokens=4000,
|
90 |
)
|
|
|
59 |
|
60 |
|
61 |
try:
|
62 |
+
grok_api_key = os.getenv("groq_api")
|
63 |
+
if grok_api_key:
|
64 |
+
grok_api_key.strip()
|
65 |
#InferenceClientModel InferenceClient
|
66 |
My_Agent = InferenceClientModel(
|
67 |
provider="groq",
|
68 |
+
api_key=grok_api_key,
|
69 |
model_id = "qwen/qwen3-32b"
|
70 |
)
|
71 |
+
|
|
|
72 |
test_messages = [{"role": "user", "content": "What are the 3 laws of robotics"}]
|
73 |
output_test = My_Agent(test_messages)
|
74 |
print('1', output_test)
|
75 |
|
76 |
except:
|
77 |
+
grok_api_key = os.getenv("groq_api")
|
78 |
+
if grok_api_key:
|
79 |
+
grok_api_key.strip()
|
80 |
|
81 |
+
if not grok_api_key:
|
82 |
raise ValueError("GROQ_API_KEY environment variable is not set")
|
|
|
|
|
|
|
83 |
|
84 |
# Fixed model initialization - use LiteLLMModel instead of InferenceClientModel for Groq
|
85 |
My_Agent = LiteLLMModel(
|
86 |
model_id="groq/qwen3-32b", # Use a valid Groq model ID
|
87 |
+
api_key=grok_api_key,
|
88 |
temperature=0.1,
|
89 |
max_tokens=4000,
|
90 |
)
|