MCPcopy
hub / github.com/Agenta-AI/agenta / parse_ref_id_to_uuid

Function parse_ref_id_to_uuid

api/oss/src/core/tracing/utils.py:247–268  ·  view source on GitHub ↗
(
    ref_id: str,
)

Source from the content-addressed store, hash-verified

245
246
247def parse_ref_id_to_uuid(
248 ref_id: str,
249):
250 clean_ref_id = None
251
252 # HEX # 0x31d6cfe04b9011ec800142010a8000b0
253 if ref_id.startswith("0x") and len(ref_id) == (2 + 32):
254 ref_id = ref_id[2:]
255
256 # UUID # 31d6cfe0-4b90-11ec-8001-42010a8000b0
257 # HEX # 31d6cfe04b9011ec800142010a8000b0
258 try:
259 clean_ref_id = str(UUID(ref_id))
260 except Exception as e:
261 log.error(
262 "ref_id must be a UUID, got %s [%s]",
263 type(ref_id),
264 ref_id,
265 )
266 raise TypeError() from e
267
268 return clean_ref_id
269
270
271def parse_ref_slug_to_str(

Callers 2

map_span_dto_to_span_dbeFunction · 0.90

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected