def _create_citation_payload(self, short_id, payload):
        """Create citation payload for a short ID"""
        # This will be overridden in RAG subclasses
        # check if as_dict is on payload
        if hasattr(payload, "as_dict"):
            payload = payload.as_dict()
        if hasattr(payload, "dict"):
            payload = payload.dict
        if hasattr(payload, "to_dict"):
            payload = payload.to_dict()

        return {
            "id": f"{short_id}",
            "object": "citation",
            "payload": dump_obj(payload),  # Will be populated in RAG agents
        }
Create citation payload for a short ID
py/core/agent/base.py