collab: Add support for more providers to the LLM service (#15832)

This PR adds support for additional providers to the LLM service:

- OpenAI
- Google
- Custom Zed models (through Hugging Face)

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-08-05 21:16:18 -04:00 committed by GitHub
parent 8e9c2b1125
commit ca9511393b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 331 additions and 98 deletions

View file

@ -2,7 +2,18 @@ use serde::{Deserialize, Serialize};
pub const EXPIRED_LLM_TOKEN_HEADER_NAME: &str = "x-zed-expired-token";
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum LanguageModelProvider {
Anthropic,
OpenAi,
Google,
Zed,
}
#[derive(Serialize, Deserialize)]
pub struct PerformCompletionParams {
pub provider: LanguageModelProvider,
pub model: String,
pub provider_request: Box<serde_json::value::RawValue>,
}