Remove dependents of language_models (#25511)

This PR removes the dependents of the `language_models` crate.

The following types have been moved from `language_models` to
`language_model` to facilitate this:

- `LlmApiToken`
- `RefreshLlmTokenListener`
- `MaxMonthlySpendReachedError`
- `PaymentRequiredError`

With this change only `zed` now depends on `language_models`.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-02-24 17:46:45 -05:00 committed by GitHub
parent bbb8d63de0
commit def342e35c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 117 additions and 124 deletions

View file

@ -9,6 +9,7 @@ mod telemetry;
pub mod fake_provider;
use anyhow::Result;
use client::Client;
use futures::FutureExt;
use futures::{future::BoxFuture, stream::BoxStream, StreamExt, TryStreamExt as _};
use gpui::{AnyElement, AnyView, App, AsyncApp, SharedString, Task, Window};
@ -29,8 +30,9 @@ pub use crate::telemetry::*;
pub const ZED_CLOUD_PROVIDER_ID: &str = "zed.dev";
pub fn init(cx: &mut App) {
pub fn init(client: Arc<Client>, cx: &mut App) {
registry::init(cx);
RefreshLlmTokenListener::register(client.clone(), cx);
}
/// The availability of a [`LanguageModel`].