Files
luxe/crates/luxe-providers/src/wire_json.rs
Evan Whittaker 09a7de2520 Initial public release
Luxe 0.1.0: a coding agent harness for the terminal. See README.md to get started and CHANGELOG.md for releases.
2026-10-17 12:08:30 -05:00

17 lines
472 B
Rust

//! Wire JSON — the small shapes every adapter spells the same way.
/// `data:image/png;base64,…` — how the OpenAI schemas carry image bytes inside a JSON string.
pub(crate) fn data_url(mime: &str, data: &str) -> String {
format!("data:{mime};base64,{data}")
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn a_data_url_names_the_mime_and_the_encoding() {
assert_eq!(data_url("image/png", "QUJD"), "data:image/png;base64,QUJD");
}
}