From f29c6e5661b6b6a7e7d16b3a3fef34df1db0a480 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 9 May 2025 17:08:03 -0400 Subject: [PATCH] Update `zed_llm_client` to v0.8.1 (#30433) This PR updates the `zed_llm_client` crate to v0.8.1. The name of `Plan::Free` changed to `Plan::ZedFree` in this version. Release Notes: - N/A --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- crates/agent/src/debug.rs | 2 +- crates/agent/src/message_editor.rs | 4 ++-- crates/agent/src/ui/preview/usage_callouts.rs | 8 ++++---- crates/collab/src/api/billing.rs | 2 +- crates/collab/src/db/tables/billing_subscription.rs | 2 +- crates/collab/src/llm/token.rs | 4 ++-- crates/collab/src/rpc.rs | 2 +- crates/language_models/src/provider/cloud.rs | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 996ac6b999cf3d3fc222715fbc98ddb91215d45f..60db87032fd17462f03a70dc50c866a63aaffdcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18742,9 +18742,9 @@ dependencies = [ [[package]] name = "zed_llm_client" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23b2fd00776b0c55072f389654910ceb501eb0083d7f78905ab0e5cc86949ec" +checksum = "16d993fc42f9ec43ab76fa46c6eb579a66e116bb08cd2bc9a67f3afcaa05d39d" dependencies = [ "anyhow", "serde", diff --git a/Cargo.toml b/Cargo.toml index 11a3442779bef5229d0703cf79f48b9416acd16e..d9fd6ae2a7dc3889feda2139c7a74449d612e88f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -608,7 +608,7 @@ wasmtime-wasi = "29" which = "6.0.0" wit-component = "0.221" workspace-hack = "0.1.0" -zed_llm_client = "0.8.0" +zed_llm_client = "0.8.1" zstd = "0.11" [workspace.dependencies.async-stripe] diff --git a/crates/agent/src/debug.rs b/crates/agent/src/debug.rs index c6519b54537bed8e1f1961878cf4300691806653..7bd52e5a96561bc293477a18c86fabf84c81ca00 100644 --- a/crates/agent/src/debug.rs +++ b/crates/agent/src/debug.rs @@ -75,7 +75,7 @@ impl Default for DebugAccountState { Self { enabled: false, trial_expired: false, - plan: Plan::Free, + plan: Plan::ZedFree, custom_prompt_usage: RequestUsage { limit: UsageLimit::Unlimited, amount: 0, diff --git a/crates/agent/src/message_editor.rs b/crates/agent/src/message_editor.rs index fa75d5beaf7a18896e4da476a4f5a9627a641d5a..adaaa8e39aa8b01ad6ed8ab8d216c8df7885a303 100644 --- a/crates/agent/src/message_editor.rs +++ b/crates/agent/src/message_editor.rs @@ -1085,11 +1085,11 @@ impl MessageEditor { let plan = user_store .current_plan() .map(|plan| match plan { - Plan::Free => zed_llm_client::Plan::Free, + Plan::Free => zed_llm_client::Plan::ZedFree, Plan::ZedPro => zed_llm_client::Plan::ZedPro, Plan::ZedProTrial => zed_llm_client::Plan::ZedProTrial, }) - .unwrap_or(zed_llm_client::Plan::Free); + .unwrap_or(zed_llm_client::Plan::ZedFree); let usage = self.thread.read(cx).last_usage().or_else(|| { maybe!({ let amount = user_store.model_request_usage_amount()?; diff --git a/crates/agent/src/ui/preview/usage_callouts.rs b/crates/agent/src/ui/preview/usage_callouts.rs index e08bf34d7b9bb990084e7352ab40f4f525019db6..8d15829db09986bd917723ba92db1b50aba1e1f4 100644 --- a/crates/agent/src/ui/preview/usage_callouts.rs +++ b/crates/agent/src/ui/preview/usage_callouts.rs @@ -39,7 +39,7 @@ impl RenderOnce for UsageCallout { let (title, message, button_text, url) = if is_limit_reached { match self.plan { - Plan::Free => ( + Plan::ZedFree => ( "Out of free prompts", "Upgrade to continue, wait for the next reset, or switch to API key." .to_string(), @@ -61,7 +61,7 @@ impl RenderOnce for UsageCallout { } } else { match self.plan { - Plan::Free => ( + Plan::ZedFree => ( "Reaching free plan limit soon", format!( "{remaining} remaining - Upgrade to increase limit, or switch providers", @@ -120,7 +120,7 @@ impl Component for UsageCallout { single_example( "Approaching limit (90%)", UsageCallout::new( - Plan::Free, + Plan::ZedFree, RequestUsage { limit: UsageLimit::Limited(50), amount: 45, // 90% of limit @@ -131,7 +131,7 @@ impl Component for UsageCallout { single_example( "Limit reached (100%)", UsageCallout::new( - Plan::Free, + Plan::ZedFree, RequestUsage { limit: UsageLimit::Limited(50), amount: 50, // 100% of limit diff --git a/crates/collab/src/api/billing.rs b/crates/collab/src/api/billing.rs index c3773b47645e609c05638fb3cf7bb2ec079fa78a..01ace385de9bde8d4655485e7303d053c35b007b 100644 --- a/crates/collab/src/api/billing.rs +++ b/crates/collab/src/api/billing.rs @@ -1274,7 +1274,7 @@ async fn get_current_usage( subscription .kind .map(Into::into) - .unwrap_or(zed_llm_client::Plan::Free) + .unwrap_or(zed_llm_client::Plan::ZedFree) }); let model_requests_limit = match plan.model_requests_limit() { diff --git a/crates/collab/src/db/tables/billing_subscription.rs b/crates/collab/src/db/tables/billing_subscription.rs index eeeb6fde4b098fff9139412abaa2885624a9c0fd..7548a36fe25ed0de1f6a07ecd1f034ba9ac5c1c0 100644 --- a/crates/collab/src/db/tables/billing_subscription.rs +++ b/crates/collab/src/db/tables/billing_subscription.rs @@ -99,7 +99,7 @@ impl From for zed_llm_client::Plan { match value { SubscriptionKind::ZedPro => Self::ZedPro, SubscriptionKind::ZedProTrial => Self::ZedProTrial, - SubscriptionKind::ZedFree => Self::Free, + SubscriptionKind::ZedFree => Self::ZedFree, } } } diff --git a/crates/collab/src/llm/token.rs b/crates/collab/src/llm/token.rs index 5d9ab452ea22208d349d8d0eeb8909b3327bb40d..7c0b3c5efdd55c28b19e5a9ca25ebd74916dba1d 100644 --- a/crates/collab/src/llm/token.rs +++ b/crates/collab/src/llm/token.rs @@ -57,8 +57,8 @@ impl LlmTokenClaims { subscription .as_ref() .and_then(|subscription| subscription.kind) - .map_or(Plan::Free, |kind| match kind { - SubscriptionKind::ZedFree => Plan::Free, + .map_or(Plan::ZedFree, |kind| match kind { + SubscriptionKind::ZedFree => Plan::ZedFree, SubscriptionKind::ZedPro => Plan::ZedPro, SubscriptionKind::ZedProTrial => Plan::ZedProTrial, }) diff --git a/crates/collab/src/rpc.rs b/crates/collab/src/rpc.rs index e11abf45875eea4241e5432b1c5960cf90eeedfc..0b4b353f92d2588d157362981d2d5bb962eb29ce 100644 --- a/crates/collab/src/rpc.rs +++ b/crates/collab/src/rpc.rs @@ -2740,7 +2740,7 @@ async fn update_user_plan(user_id: UserId, session: &Session) -> Result<()> { }), usage: usage.map(|usage| { let plan = match plan { - proto::Plan::Free => zed_llm_client::Plan::Free, + proto::Plan::Free => zed_llm_client::Plan::ZedFree, proto::Plan::ZedPro => zed_llm_client::Plan::ZedPro, proto::Plan::ZedProTrial => zed_llm_client::Plan::ZedProTrial, }; diff --git a/crates/language_models/src/provider/cloud.rs b/crates/language_models/src/provider/cloud.rs index 447ef8da88c68dc54ec9e1677b993f6d1f496354..d4a200f8c529783d407c318ef07e34cd44c7a12b 100644 --- a/crates/language_models/src/provider/cloud.rs +++ b/crates/language_models/src/provider/cloud.rs @@ -611,7 +611,7 @@ impl CloudLanguageModel { .and_then(|plan| zed_llm_client::Plan::from_str(plan).ok()) { let plan = match plan { - zed_llm_client::Plan::Free => Plan::Free, + zed_llm_client::Plan::ZedFree => Plan::Free, zed_llm_client::Plan::ZedPro => Plan::ZedPro, zed_llm_client::Plan::ZedProTrial => Plan::ZedProTrial, };