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

Method update

backend/app/operators/model/model.py:159–205  ·  view source on GitHub ↗
(self, update_dict: Dict, **kwargs)

Source from the content-addressed store, hash-verified

157 return model
158
159 async def update(self, update_dict: Dict, **kwargs) -> ModelEntity:
160 model_id = kwargs["model_id"]
161 model: Model = await super().get(model_id=model_id)
162
163 new_update_dict = {}
164 if update_dict.get("name") is not None:
165 new_update_dict["name"] = update_dict.get("name")
166
167 model_schema_id = update_dict.get("model_schema_id")
168 provider_model_id = update_dict.get("provider_model_id")
169 model_type = update_dict.get("type")
170 credentials = update_dict.get("credentials")
171 properties = update_dict.get("properties")
172
173 if model_schema_id or provider_model_id or model_type or credentials or properties:
174 # verify model credentials
175 (
176 new_model_schema_id,
177 new_provider_id,
178 new_provider_model_id,
179 new_model_type,
180 new_encrypted_credentials,
181 new_display_credentials,
182 new_properties,
183 ) = await verify_model_credentials(
184 model_schema_id=model_schema_id or model.model_schema_id,
185 provider_model_id=provider_model_id or model.provider_model_id,
186 properties=properties or model.properties,
187 model_type=model_type or model.type,
188 credentials=credentials,
189 encrypted_credentials=model.encrypted_credentials if not credentials else None,
190 )
191
192 new_update_dict["model_schema_id"] = new_model_schema_id
193 new_update_dict["provider_id"] = new_provider_id
194 new_update_dict["provider_model_id"] = new_provider_model_id
195 new_update_dict["type"] = new_model_type
196 new_update_dict["properties"] = new_properties
197 if credentials:
198 new_update_dict["encrypted_credentials"] = new_encrypted_credentials
199 new_update_dict["display_credentials"] = new_display_credentials
200
201 model = await super().update(
202 model_id=model_id,
203 update_dict=new_update_dict,
204 )
205 return model
206
207
208model_ops = ModelOperator(

Callers 15

checksumFunction · 0.45
api_updateFunction · 0.45
api_updateFunction · 0.45
api_updateFunction · 0.45
api_updateFunction · 0.45
api_updateFunction · 0.45
api_updateFunction · 0.45
api_updateFunction · 0.45
api_updateFunction · 0.45
api_updateFunction · 0.45
api_list_record_chunksFunction · 0.45

Calls 2

verify_model_credentialsFunction · 0.85
getMethod · 0.45