zeta: Use DTOs from zed_llm_client crate (#24229)

This PR updates the `zeta` crate to use the predictive edit DTOs defined
in the `zed_llm_client` crate.

This way we aren't duplicating their definitions (and risk them going
out of sync).

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-02-04 16:39:15 -05:00 committed by GitHub
parent d6a2a0b04a
commit b02baea9d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 16 additions and 20 deletions

View file

@ -38,7 +38,6 @@ log.workspace = true
menu.workspace = true
postage.workspace = true
regex.workspace = true
rpc.workspace = true
serde.workspace = true
serde_json.workspace = true
settings.workspace = true
@ -52,6 +51,7 @@ uuid.workspace = true
workspace.workspace = true
worktree.workspace = true
zed_actions.workspace = true
zed_llm_client.workspace = true
[dev-dependencies]
collections = { workspace = true, features = ["test-support"] }

View file

@ -29,7 +29,6 @@ use language::{
};
use language_models::LlmApiToken;
use postage::watch;
use rpc::{PredictEditsParams, PredictEditsResponse, EXPIRED_LLM_TOKEN_HEADER_NAME};
use settings::WorktreeId;
use std::{
borrow::Cow,
@ -47,6 +46,7 @@ use telemetry_events::InlineCompletionRating;
use util::ResultExt;
use uuid::Uuid;
use worktree::Worktree;
use zed_llm_client::{PredictEditsBody, PredictEditsResponse, EXPIRED_LLM_TOKEN_HEADER_NAME};
const CURSOR_MARKER: &'static str = "<|user_cursor_is_here|>";
const START_OF_FILE_MARKER: &'static str = "<|start_of_file|>";
@ -369,7 +369,7 @@ impl Zeta {
perform_predict_edits: F,
) -> Task<Result<Option<InlineCompletion>>>
where
F: FnOnce(Arc<Client>, LlmApiToken, bool, PredictEditsParams) -> R + 'static,
F: FnOnce(Arc<Client>, LlmApiToken, bool, PredictEditsBody) -> R + 'static,
R: Future<Output = Result<PredictEditsResponse>> + Send + 'static,
{
let snapshot = self.report_changes_for_buffer(&buffer, cx);
@ -425,7 +425,7 @@ impl Zeta {
log::debug!("Events:\n{}\nExcerpt:\n{}", input_events, input_excerpt);
let body = PredictEditsParams {
let body = PredictEditsBody {
input_events: input_events.clone(),
input_excerpt: input_excerpt.clone(),
outline: Some(input_outline.clone()),
@ -625,7 +625,7 @@ and then another
client: Arc<Client>,
llm_token: LlmApiToken,
_is_staff: bool,
body: PredictEditsParams,
body: PredictEditsBody,
) -> impl Future<Output = Result<PredictEditsResponse>> {
async move {
let http_client = client.http_client();