a2a-server-lf 0.2.7

A2A v1 async server framework
Documentation
1
2
3
4
5
6
7
8
9
10
// Copyright AGNTCY Contributors (https://github.com/agntcy)
// SPDX-License-Identifier: Apache-2.0
use a2a::A2AError;
use serde::Serialize;
use serde_json::Value;

pub(crate) fn json_value<T: Serialize>(value: &T) -> Result<Value, A2AError> {
    serde_json::to_value(value)
        .map_err(|e| A2AError::internal(format!("failed to serialize JSON payload: {e}")))
}