MCPcopy
hub / github.com/TaskingAI/TaskingAI / build

Method build

backend/app/models/model/model.py:52–74  ·  view source on GitHub ↗
(cls, row: Dict)

Source from the content-addressed store, hash-verified

50
51 @classmethod
52 def build(cls, row: Dict):
53 from app.services.model import get_model_schema
54
55 model_schema_id = row["model_schema_id"]
56 model_schema = get_model_schema(model_schema_id)
57 model_schema_properties = {}
58 if model_schema:
59 model_schema_properties = model_schema.properties or {}
60 properties = model_schema_properties or load_json_attr(row, "properties", {})
61
62 return cls(
63 model_id=row["model_id"],
64 model_schema_id=row["model_schema_id"],
65 provider_id=row["provider_id"],
66 provider_model_id=row["provider_model_id"],
67 name=row["name"],
68 type=row["type"],
69 properties=properties,
70 encrypted_credentials=load_json_attr(row, "encrypted_credentials", {}),
71 display_credentials=load_json_attr(row, "display_credentials", {}),
72 updated_timestamp=row["updated_timestamp"],
73 created_timestamp=row["created_timestamp"],
74 )
75
76 def to_response_dict(self) -> Dict:
77 model_schema = self.model_schema()

Callers 8

list_objectsFunction · 0.45
get_admin_by_usernameFunction · 0.45
register_adminFunction · 0.45
listMethod · 0.45
_get_entityMethod · 0.45
sync_model_schema_dataFunction · 0.45
sync_plugin_dataFunction · 0.45

Calls 2

get_model_schemaFunction · 0.90
load_json_attrFunction · 0.90

Tested by

no test coverage detected