Spaces:
Sleeping
Sleeping
Update multiagents.py
Browse files- multiagents.py +36 -22
multiagents.py
CHANGED
@@ -58,32 +58,46 @@ dotenv.load_dotenv()
|
|
58 |
# SETUP AND TEST
|
59 |
|
60 |
try:
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
)
|
67 |
-
|
68 |
-
output_test = My_Agent('What are the 3 laws of robotics')
|
69 |
-
print('1', output_test)
|
70 |
|
|
|
|
|
|
|
71 |
except:
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
-
|
76 |
-
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
|
88 |
|
89 |
# My_Agent = client.chat.completions.create(
|
|
|
58 |
# SETUP AND TEST
|
59 |
|
60 |
try:
|
61 |
+
api_key=os.getenv("GROQ_API_KEY")
|
62 |
+
print('1', api_key)
|
63 |
+
except:
|
64 |
+
api_key=os.environ.get("GROQ_API_KEY")
|
65 |
+
print('2', api_key)
|
|
|
|
|
|
|
|
|
66 |
|
67 |
+
try:
|
68 |
+
api_key=os.getenv("groq_api")
|
69 |
+
print('3', api_key)
|
70 |
except:
|
71 |
+
api_key=os.environ.get("groq_api")
|
72 |
+
print('4', api_key)
|
73 |
+
|
74 |
+
# try:
|
75 |
+
# #InferenceClientModel InferenceClient
|
76 |
+
# My_Agent = InferenceClientModel(
|
77 |
+
# provider="groq",
|
78 |
+
# api_key=os.getenv("GROQ_API_KEY"),
|
79 |
+
# model_id = "qwen/qwen3-32b"
|
80 |
+
# )
|
81 |
+
|
82 |
+
# output_test = My_Agent('What are the 3 laws of robotics')
|
83 |
+
# print('1', output_test)
|
84 |
+
|
85 |
+
# except:
|
86 |
+
# # Check if API key is available
|
87 |
+
# groq_api_key = os.environ.get("GROQ_API_KEY")
|
88 |
|
89 |
+
# if not groq_api_key:
|
90 |
+
# raise ValueError("GROQ_API_KEY environment variable is not set")
|
91 |
|
92 |
+
# # Fixed model initialization - use LiteLLMModel instead of InferenceClientModel for Groq
|
93 |
+
# My_Agent = LiteLLMModel(
|
94 |
+
# model_id="groq/qwen3-32b", # Use a valid Groq model ID
|
95 |
+
# api_key=groq_api_key,
|
96 |
+
# temperature=0.1,
|
97 |
+
# max_tokens=4000,
|
98 |
+
# )
|
99 |
+
# output_test = MyAgent('What are the 3 laws of robotics')
|
100 |
+
# print('2', output_test)
|
101 |
|
102 |
|
103 |
# My_Agent = client.chat.completions.create(
|