MCPcopy Create free account
hub / github.com/THUDM/AgentBench / create

Method create

src/typings/general.py:20–35  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18 return v
19
20 def create(self):
21 # print('>>>>>>>> ', self.module, self.parameters)
22 splits = self.module.split(".")
23 if len(splits) == 0:
24 raise Exception("Invalid module name: {}".format(self.module))
25 if len(splits) == 1:
26 g = globals()
27 if self.module in g:
28 class_type = g[self.module]
29 else:
30 class_type = getattr(builtins, self.module)
31 return class_type(**self.parameters)
32 else:
33 path = ".".join(self.module.split(".")[:-1])
34 mod = __import__(path, fromlist=[self.module.split(".")[-1]])
35 return getattr(mod, self.module.split(".")[-1])(**self.parameters)
36
37
38class Assignment(BaseModel):

Callers 3

__init__Method · 0.80
agent_test.pyFile · 0.80
inferenceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected