bwilkie commited on
Commit
7e0c4f0
·
verified ·
1 Parent(s): e954425

Update multiagents.py

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