use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Protocol {
#[serde(rename = "openai_chat_completions")]
OpenAiChatCompletions,
#[serde(rename = "anthropic_messages")]
AnthropicMessages,
#[serde(rename = "openai_responses")]
OpenAiResponses,
}
impl Protocol {
pub fn as_str(self) -> &'static str {
match self {
Self::OpenAiChatCompletions => "openai_chat_completions",
Self::AnthropicMessages => "anthropic_messages",
Self::OpenAiResponses => "openai_responses",
}
}
}
impl std::fmt::Display for Protocol {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}