MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / create

Method create

backend/app/operators/model/model.py:123–157  ·  view source on GitHub ↗
(
        self,
        create_dict: Dict,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

121
122class ModelOperator(PostgresModelOperator):
123 async def create(
124 self,
125 create_dict: Dict,
126 **kwargs,
127 ) -> ModelEntity:
128 # verify model credentials
129 (
130 model_schema_id,
131 provider_id,
132 provider_model_id,
133 model_type,
134 encrypted_credentials,
135 display_credentials,
136 properties,
137 ) = await verify_model_credentials(
138 model_schema_id=create_dict["model_schema_id"],
139 provider_model_id=create_dict.get("provider_model_id"),
140 properties=create_dict.get("properties"),
141 model_type=create_dict.get("type"),
142 credentials=create_dict["credentials"],
143 )
144
145 model = await super().create(
146 create_dict={
147 "model_schema_id": model_schema_id,
148 "provider_id": provider_id,
149 "provider_model_id": provider_model_id,
150 "name": create_dict["name"],
151 "type": model_type,
152 "encrypted_credentials": encrypted_credentials,
153 "display_credentials": display_credentials,
154 "properties": properties,
155 },
156 )
157 return model
158
159 async def update(self, update_dict: Dict, **kwargs) -> ModelEntity:
160 model_id = kwargs["model_id"]

Callers 12

request.tsFile · 0.45
api_createFunction · 0.45
api_createFunction · 0.45
api_createFunction · 0.45
api_createFunction · 0.45
api_createFunction · 0.45
api_createFunction · 0.45
api_createFunction · 0.45
api_createFunction · 0.45
api_createFunction · 0.45
create_messageFunction · 0.45

Calls 2

verify_model_credentialsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected