mod common;
mod decode;
mod encode;
mod runtime;
pub use decode::{
decode_anthropic_request, decode_anthropic_response, decode_anthropic_stream,
decode_anthropic_stream_events,
};
pub use encode::{encode_anthropic_request, encode_anthropic_response};
pub use runtime::{AnthropicCodec, AnthropicCodecLib};
use sim_kernel::{CodecId, Symbol};
pub(super) const ANTHROPIC_CODEC_ID: CodecId = CodecId(0);
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct AnthropicCodecOptions {
pub model: String,
pub max_tokens: u64,
pub stream: bool,
pub tools: bool,
}
impl AnthropicCodecOptions {
pub fn new(model: impl Into<String>, max_tokens: u64, stream: bool, tools: bool) -> Self {
Self {
model: model.into(),
max_tokens,
stream,
tools,
}
}
}
pub type AnthropicRequestOptions = AnthropicCodecOptions;
pub fn anthropic_codec_symbol() -> Symbol {
Symbol::qualified("codec", "anthropic")
}