This commit is contained in:
Adil Hafeez 2025-06-05 20:17:07 -07:00
parent a5bdd9c04f
commit b1233da268
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
5 changed files with 7 additions and 2 deletions

View file

@ -6,6 +6,7 @@ use std::fmt::Display;
pub mod providers;
pub enum Provider {
Arch,
Mistral,
Deepseek,
Groq,
@ -18,6 +19,7 @@ pub enum Provider {
impl From<&str> for Provider {
fn from(value: &str) -> Self {
match value.to_lowercase().as_str() {
"arch" => Provider::Arch,
"mistral" => Provider::Mistral,
"deepseek" => Provider::Deepseek,
"groq" => Provider::Groq,
@ -33,6 +35,7 @@ impl From<&str> for Provider {
impl Display for Provider {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Provider::Arch => write!(f, "Arch"),
Provider::Mistral => write!(f, "Mistral"),
Provider::Deepseek => write!(f, "Deepseek"),
Provider::Groq => write!(f, "Groq"),

View file

@ -139,6 +139,7 @@ impl ChatCompletionsRequest {
pub fn to_bytes(&self, provider: Provider) -> Result<Vec<u8>> {
match provider {
Provider::OpenAI
| Provider::Arch
| Provider::Deepseek
| Provider::Mistral
| Provider::Groq