AgentScope is an open-source project. To involve a broader community, we recommend asking your questions in English.
Describe the bug
---> 30 result = Executer_agent(task_msg)
File ~/software/conda/envs/agentscope/lib/python3.9/site-packages/agentscope/agents/agent.py:295, in AgentBase.call(self, *args, kwargs)
292 def call(self, *args: Any, *kwargs: Any) -> dict:
293 """Calling the reply function, and broadcast the generated
294 response to all audiences if needed."""
--> 295 res = self.reply(args, kwargs)
297 # broadcast to audiences if needed
298 if self._audience is not None:
File ~/software/conda/envs/agentscope/lib/python3.9/site-packages/agentscope/agents/react_agent.py:168, in ReActAgent.reply(self, x)
166 # Generate and parse the response
167 try:
--> 168 res = self.model(
169 prompt,
170 parse_func=self.parser.parse,
171 max_retries=1,
172 )
174 # Record the response in memory
175 self.memory.add(
176 Msg(
177 self.name,
(...)
180 ),
181 )
File ~/software/conda/envs/agentscope/lib/python3.9/site-packages/agentscope/models/model.py:122, in _response_parse_decorator..checking_wrapper(self, *args, *kwargs)
119 # Otherwise, try to parse the response
120 for itr in range(1, max_retries + 1):
121 # Call the model
--> 122 response = model_call(self, args, **kwargs)
124 # Parse the response if needed
125 try:
AgentScope is an open-source project. To involve a broader community, we recommend asking your questions in English.
Describe the bug ---> 30 result = Executer_agent(task_msg) File ~/software/conda/envs/agentscope/lib/python3.9/site-packages/agentscope/agents/agent.py:295, in AgentBase.call(self, *args, kwargs) 292 def call(self, *args: Any, *kwargs: Any) -> dict: 293 """Calling the reply function, and broadcast the generated 294 response to all audiences if needed.""" --> 295 res = self.reply(args, kwargs) 297 # broadcast to audiences if needed 298 if self._audience is not None:
File ~/software/conda/envs/agentscope/lib/python3.9/site-packages/agentscope/agents/react_agent.py:168, in ReActAgent.reply(self, x) 166 # Generate and parse the response 167 try: --> 168 res = self.model( 169 prompt, 170 parse_func=self.parser.parse, 171 max_retries=1, 172 ) 174 # Record the response in memory 175 self.memory.add( 176 Msg( 177 self.name, (...) 180 ), 181 )
File ~/software/conda/envs/agentscope/lib/python3.9/site-packages/agentscope/models/model.py:122, in _response_parse_decorator..checking_wrapper(self, *args, *kwargs)
119 # Otherwise, try to parse the response
120 for itr in range(1, max_retries + 1):
121 # Call the model
--> 122 response = model_call(self, args, **kwargs)
124 # Parse the response if needed
125 try:
File ~/software/conda/envs/agentscope/lib/python3.9/site-packages/agentscope/models/openai_model.py:210, in OpenAIChatWrapper.call(self, messages, kwargs) 200 self._save_model_invocation( 201 arguments={ 202 "model": self.model_name, (...) 206 response=response.model_dump(), 207 ) 209 # step5: update monitor accordingly --> 210 self.update_monitor(call_counter=1, response.usage.model_dump()) 212 # step6: return response 213 return ModelResponse( 214 text=response.choices[0].message.content, 215 raw=response.model_dump(), 216 )
File ~/software/conda/envs/agentscope/lib/python3.9/site-packages/agentscope/models/model.py:300, in ModelWrapperBase.update_monitor(self, **kwargs) 297 prefix = None 299 try: --> 300 self.monitor.update( 301 kwargs, 302 prefix=prefix, 303 ) 304 except QuotaExceededError as e: 305 logger.error(e.message)
File ~/software/conda/envs/agentscope/lib/python3.9/site-packages/agentscope/utils/monitor.py:572, in SqliteMonitor.update(self, values, prefix) 570 with sqlite_transaction(self.db_path) as cursor: 571 for metric_name, value in values.items(): --> 572 self._add( 573 cursor, 574 get_full_name( 575 name=metric_name, 576 prefix=prefix, 577 ), 578 value, 579 )
File ~/software/conda/envs/agentscope/lib/python3.9/site-packages/agentscope/utils/monitor.py:430, in SqliteMonitor._add(self, cursor, metric_name, value) 423 def _add( 424 self, 425 cursor: sqlite3.Cursor, 426 metric_name: str, 427 value: float, 428 ) -> None: 429 try: --> 430 cursor.execute( 431 f""" 432 UPDATE {self.table_name} 433 SET value = value + ? 434 WHERE name = ? 435 """, 436 (value, metric_name), 437 ) 438 except sqlite3.IntegrityError as e: 439 raise QuotaExceededError(metric_name) from e