mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 17:29:01 +00:00
return exception for logging
This commit is contained in:
parent
d565cff099
commit
0bb28cf20a
1 changed files with 3 additions and 2 deletions
|
@ -26,8 +26,9 @@ def serialize_value(value: Any) -> Any:
|
||||||
try:
|
try:
|
||||||
return value.model_dump_json()
|
return value.model_dump_json()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# We cannot serialize the binary bytes data, so we return serialization exception for logging
|
# We cannot serialize the binary bytes data,
|
||||||
return str(e)
|
# So we return the model dump as a string for logging
|
||||||
|
return str(value.model_dump())
|
||||||
elif isinstance(value, (list, tuple, set)):
|
elif isinstance(value, (list, tuple, set)):
|
||||||
return [serialize_value(item) for item in value]
|
return [serialize_value(item) for item in value]
|
||||||
elif isinstance(value, dict):
|
elif isinstance(value, dict):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue