Skip to main content

switchyard_llm_client/
raw.rs

1// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4//! The raw wire result of a call.
5//!
6//! The encoders that produce it — buffered JSON and the streamed wire-event
7//! encoder — live in `switchyard-translation` alongside the rest of the neutral-IR
8//! codecs; this module only holds the result type they feed.
9
10use serde_json::Value;
11use switchyard_translation::RawEventStream;
12
13/// The wire result of
14/// [`call_rewrite_model_raw`](crate::TranslatingLlmClient::call_rewrite_model_raw):
15/// a buffered JSON body, or a live stream of wire events — both already in the
16/// requested wire format.
17pub enum RawResponse {
18    /// A complete JSON response body.
19    Buffered(Value),
20    /// A live stream of wire-format event objects, ready for SSE framing.
21    Stream(RawEventStream),
22}