
This PR renames some bindings from `data_collection_permission` back to `can_collect_data`, as the latter name is clearer on account of being a modal verb. Release Notes: - N/A
50 lines
1.3 KiB
Rust
50 lines
1.3 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
use strum::{Display, EnumIter, EnumString};
|
|
|
|
pub const EXPIRED_LLM_TOKEN_HEADER_NAME: &str = "x-zed-expired-token";
|
|
|
|
pub const MAX_LLM_MONTHLY_SPEND_REACHED_HEADER_NAME: &str = "x-zed-llm-max-monthly-spend-reached";
|
|
|
|
#[derive(
|
|
Debug, PartialEq, Eq, Hash, Clone, Copy, Serialize, Deserialize, EnumString, EnumIter, Display,
|
|
)]
|
|
#[serde(rename_all = "snake_case")]
|
|
#[strum(serialize_all = "snake_case")]
|
|
pub enum LanguageModelProvider {
|
|
Anthropic,
|
|
OpenAi,
|
|
Google,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct LanguageModel {
|
|
pub provider: LanguageModelProvider,
|
|
pub name: String,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct ListModelsResponse {
|
|
pub models: Vec<LanguageModel>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct PerformCompletionParams {
|
|
pub provider: LanguageModelProvider,
|
|
pub model: String,
|
|
pub provider_request: Box<serde_json::value::RawValue>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct PredictEditsParams {
|
|
pub outline: Option<String>,
|
|
pub input_events: String,
|
|
pub input_excerpt: String,
|
|
/// Whether the user provided consent for sampling this interaction.
|
|
#[serde(default)]
|
|
pub can_collect_data: bool,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct PredictEditsResponse {
|
|
pub output_excerpt: String,
|
|
}
|