MCPcopy
hub / github.com/apache/caldera / build_model

Method build_model

app/service/learning_svc.py:30–37  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28 return parsers
29
30 async def build_model(self):
31 for ability in await self.get_service('data_svc').locate('abilities'):
32 for executor in ability.executors:
33 if executor.command:
34 variables = frozenset(re.findall(self.re_variable, executor.test))
35 if len(variables) > 1: # relationships require at least 2 variables
36 self.model.add(variables)
37 self.model = set(self.model)
38
39 async def learn(self, facts, link, blob, operation=None):
40 decoded_blob = b64decode(blob).decode('utf-8')

Callers 1

run_tasksFunction · 0.45

Calls 3

setFunction · 0.85
get_serviceMethod · 0.80
locateMethod · 0.45

Tested by

no test coverage detected