Skip to main content

wrap_as_operations_envelope

Function wrap_as_operations_envelope 

Source
pub fn wrap_as_operations_envelope(
    operations: &[AgentMessage],
) -> Result<String>
Expand description

Wraps operations in the envelope, as a JSON string ready for transport.

use ag_ui_a2ui::message::AgentMessage;
use ag_ui_a2ui::toolkit::envelope::wrap_as_operations_envelope;

let json = wrap_as_operations_envelope(&[AgentMessage::delete_surface("s1")]).unwrap();
assert!(json.starts_with(r#"{"a2ui_operations":["#));

ยงErrors

Returns Error::Json if an operation cannot be serialized.