mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
14 lines
348 B
Python
14 lines
348 B
Python
from datetime import datetime
|
|
|
|
|
|
def stringify_metadata(
|
|
metadata: dict[str, any],
|
|
) -> dict[str, any]:
|
|
for key, value in metadata.items():
|
|
if (
|
|
isinstance(value, datetime)
|
|
or isinstance(value, list)
|
|
or isinstance(value, dict)
|
|
):
|
|
metadata[key] = str(value)
|
|
return metadata
|