va-ai-api-bridge 0.1.7

Protocol translation primitives for AI API request and response shapes.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
mod decode;
mod encode;

use serde_json::Value;

use crate::{DecodeState, EncodeState, Result, UniversalEvent, WireEvent};

pub(super) fn decode_chunk(raw: Value, state: &mut DecodeState) -> Result<Vec<UniversalEvent>> {
    decode::decode_chunk(raw, state)
}

pub(super) fn encode(events: &[UniversalEvent], state: &mut EncodeState) -> Result<Vec<WireEvent>> {
    encode::encode(events, state)
}