agentops
agentops copied to clipboard
Add safe JSON serializa for Agents SDK inputs and outputs
📥 Pull Request
📘 Description
- Introduced a helper function
safe_json_serializeto safely serialize objects to JSON strings. - Updated span attribute assignments in
AgentsDetailedExporterandAgentsInstrumentorto use this new function forinput,output, andfinal_outputattributes, ensuring proper handling of various object types. - Removed truncation for
agent.instructionsto allow full string representation.
🧪 Testing Checked traces and spans via internal tools
we already have an AgentOpsJSONEncoder used in safe_serialize
https://github.com/AgentOps-AI/agentops/tree/main/agentops/helpers/serialization.py#L75
Outdated