MCPcopy Create free account
hub / github.com/HKUDS/OpenSpace / create_record

Method create_record

openspace/cloud/client.py:233–250  ·  view source on GitHub ↗

POST /records — create skill record with 409 conflict handling. Returns ``(response_data, status_code)``.

(self, payload: Dict[str, Any])

Source from the content-addressed store, hash-verified

231 return artifact_id, file_count
232
233 def create_record(self, payload: Dict[str, Any]) -> tuple[Dict[str, Any], int]:
234 """POST /records — create skill record with 409 conflict handling.
235
236 Returns ``(response_data, status_code)``.
237 """
238 body = json.dumps(payload).encode("utf-8")
239 try:
240 status, resp_data = self._request(
241 "POST",
242 "/records",
243 body=body,
244 extra_headers={"Content-Type": "application/json"},
245 )
246 return json.loads(resp_data.decode("utf-8")), status
247 except CloudError as e:
248 if e.status_code == 409:
249 return self._handle_409(e.body, payload)
250 raise
251
252 def _handle_409(
253 self, body_text: str, payload: Dict[str, Any],

Callers 1

upload_skillMethod · 0.95

Calls 2

_requestMethod · 0.95
_handle_409Method · 0.95

Tested by

no test coverage detected