MCPcopy Create free account
hub / github.com/Tencent/digitalhuman / _task_assign

Method _task_assign

SWF/src/base.py:495–510  ·  view source on GitHub ↗
(self, tasks, survived_agent_names, statistics)

Source from the content-addressed store, hash-verified

493class StepRandomEnv(CacheEnv):
494
495 def _task_assign(self, tasks, survived_agent_names, statistics):
496 env_record, env_table = self.get_records(survived_agent_names)
497 team = env_table['Name']
498 idx = random.randint(0, 100000) % len(team)
499 idx = self.name2idx[team[idx]]
500 if int(os.environ.get('SLEEP', 0)) > 0:
501 time.sleep(int(os.environ['SLEEP']))
502
503 return Response(
504 role='assistant',
505 raw=self.agents[idx].name,
506 content=self.agents[idx].name,
507 end=True,
508 usage=0,
509 cost=0,
510 )
511
512
513@dataclass

Callers

nothing calls this directly

Calls 4

ResponseClass · 0.85
get_recordsMethod · 0.80
sleepMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected