mirror of
https://github.com/katanemo/plano.git
synced 2026-05-08 07:12:42 +02:00
adding support for moonshot and z-ai (#578)
* adding support for moonshot and z-ai * Revert unwanted changes to arch_config.yaml --------- Co-authored-by: Salman Paracha <salmanparacha@MacBook-Pro-288.local>
This commit is contained in:
parent
7df1b8cdb0
commit
045a5e9751
9 changed files with 186 additions and 22 deletions
|
|
@ -17,6 +17,8 @@ pub enum ProviderId {
|
|||
XAI,
|
||||
TogetherAI,
|
||||
Ollama,
|
||||
Moonshotai,
|
||||
Zhipu,
|
||||
}
|
||||
|
||||
impl From<&str> for ProviderId {
|
||||
|
|
@ -34,6 +36,8 @@ impl From<&str> for ProviderId {
|
|||
"xai" => ProviderId::XAI,
|
||||
"together_ai" => ProviderId::TogetherAI,
|
||||
"ollama" => ProviderId::Ollama,
|
||||
"moonshotai" => ProviderId::Moonshotai,
|
||||
"zhipu" => ProviderId::Zhipu,
|
||||
_ => panic!("Unknown provider: {}", value),
|
||||
}
|
||||
}
|
||||
|
|
@ -58,7 +62,9 @@ impl ProviderId {
|
|||
| ProviderId::AzureOpenAI
|
||||
| ProviderId::XAI
|
||||
| ProviderId::TogetherAI
|
||||
| ProviderId::Ollama,
|
||||
| ProviderId::Ollama
|
||||
| ProviderId::Moonshotai
|
||||
| ProviderId::Zhipu,
|
||||
SupportedAPIs::AnthropicMessagesAPI(_)) => SupportedAPIs::OpenAIChatCompletions(OpenAIApi::ChatCompletions),
|
||||
|
||||
(ProviderId::OpenAI
|
||||
|
|
@ -71,7 +77,9 @@ impl ProviderId {
|
|||
| ProviderId::AzureOpenAI
|
||||
| ProviderId::XAI
|
||||
| ProviderId::TogetherAI
|
||||
| ProviderId::Ollama,
|
||||
| ProviderId::Ollama
|
||||
| ProviderId::Moonshotai
|
||||
| ProviderId::Zhipu,
|
||||
SupportedAPIs::OpenAIChatCompletions(_)) => SupportedAPIs::OpenAIChatCompletions(OpenAIApi::ChatCompletions),
|
||||
}
|
||||
}
|
||||
|
|
@ -92,6 +100,8 @@ impl Display for ProviderId {
|
|||
ProviderId::XAI => write!(f, "xai"),
|
||||
ProviderId::TogetherAI => write!(f, "together_ai"),
|
||||
ProviderId::Ollama => write!(f, "ollama"),
|
||||
ProviderId::Moonshotai => write!(f, "moonshotai"),
|
||||
ProviderId::Zhipu => write!(f, "zhipu"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -787,7 +787,7 @@ mod tests {
|
|||
// Test OpenAI event type (should be None)
|
||||
let openai_event = ChatCompletionsStreamResponse {
|
||||
id: "test".to_string(),
|
||||
object: "chat.completion.chunk".to_string(),
|
||||
object: Some("chat.completion.chunk".to_string()),
|
||||
created: 123456789,
|
||||
model: "gpt-4".to_string(),
|
||||
choices: vec![],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue