switchyard-translation 0.4.0

Pure Rust request, response, and stream translation for Switchyard
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

//! Anthropic Messages buffered and streaming codecs.

mod buffered;
mod stream;

pub use buffered::AnthropicMessagesCodec;
pub use stream::AnthropicMessagesStreamCodec;

// Temperature range: 0.0..=1.0 for legacy models supporting this parameter.
// https://platform.claude.com/docs/en/api/messages/create?version=2023-06-01
// API version 2026-10-21 removes temperature; sending it returns HTTP 400.
// https://platform.claude.com/docs/en/api/migration-2026-10-21#sampling-parameters-are-removed
pub(crate) const MAX_TEMPERATURE: f64 = 1.0;
pub(crate) const DEFAULT_TEMPERATURE: f64 = 1.0;