Compare commits

...

8 Commits

Author SHA1 Message Date
Marshall Bowers
d1880c6e0b assistant: Add implementation for /delta argument completion (#19693)
This PR fixes a panic that could occur when trying to complete arguments
for the `/delta` slash command.

We were using `unimplemented!()` instead of providing a default no-op
implementation like we do for other slash commands that do not support
completing arguments.

Closes https://github.com/zed-industries/zed/issues/19686.

Release Notes:

- Fixed a panic that could occur when trying to complete arguments with
the `/delta` command.
2024-10-24 13:42:16 -04:00
Peter Tripp
b2396ebacd zed 0.158.2 2024-10-24 13:15:11 -04:00
Peter Tripp
d83584b550 Switch to Anthropic -latest tags (#19615)
- Closes: https://github.com/zed-industries/zed/issues/19609

Switches us to using `-latest` tags with Anthropic models instead of
pinning to a specific date version.
See: [Anthropic Model
Docs](https://docs.anthropic.com/en/docs/about-claude/models)

This is a no-op for:
- Claude 3 Opus (`claude-3-opus-20240229`)
- Claude 3 Sonnet (`claude-3-sonnet-20240229`)
- Claude 3 Haiku (`claude-3-haiku-20240307`)

For Claude 3.5 Sonnet this will update us from
`claude-3-5-sonnet-20240620` to `claude-3-5-sonnet-20241022`. We will
also pickup any subsequent model updates automatically when Anthropic
updates the `latest` tag.

This matches the behavior for OpenAI where use `gpt-4o` as the
model_name and not `gpt-4o-2024-08-06`.
2024-10-24 10:53:06 -04:00
Joseph T. Lyons
6367469c27 v0.158.x stable 2024-10-23 13:12:16 -04:00
gcp-cherry-pick-bot[bot]
80799d2424 semantic_index: Disable embeddings index for non-staff (cherry-pick #19618) (#19626)
Cherry-picked semantic_index: Disable embeddings index for non-staff
(#19618)

This PR disables the embeddings index for non-staff users.

Release Notes:

- N/A

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-23 13:03:01 -04:00
Peter Tripp
363530ea84 zed 0.158.1 2024-10-16 14:47:11 -04:00
gcp-cherry-pick-bot[bot]
7ce18afabf assistant: Direct user to account page to subscribe for more LLM usage (cherry-pick #19300) (#19301)
Cherry-picked assistant: Direct user to account page to subscribe for
more LLM usage (#19300)

This PR updates the location where we send the user to subscribe for
more LLM usage to the account page.

Release Notes:

- Updated the URL to the account page when subscribing to LLM usage.

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-16 14:26:52 -04:00
Joseph T. Lyons
f9beb25fb0 v0.158.x preview 2024-10-16 12:47:43 -04:00
10 changed files with 35 additions and 18 deletions

2
Cargo.lock generated
View File

@@ -14577,7 +14577,7 @@ dependencies = [
[[package]]
name = "zed"
version = "0.158.0"
version = "0.158.2"
dependencies = [
"activity_indicator",
"anyhow",

View File

@@ -29,13 +29,13 @@ pub struct AnthropicModelCacheConfiguration {
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, EnumIter)]
pub enum Model {
#[default]
#[serde(rename = "claude-3-5-sonnet", alias = "claude-3-5-sonnet-20240620")]
#[serde(rename = "claude-3-5-sonnet", alias = "claude-3-5-sonnet-latest")]
Claude3_5Sonnet,
#[serde(rename = "claude-3-opus", alias = "claude-3-opus-20240229")]
#[serde(rename = "claude-3-opus", alias = "claude-3-opus-latest")]
Claude3Opus,
#[serde(rename = "claude-3-sonnet", alias = "claude-3-sonnet-20240229")]
#[serde(rename = "claude-3-sonnet", alias = "claude-3-sonnet-latest")]
Claude3Sonnet,
#[serde(rename = "claude-3-haiku", alias = "claude-3-haiku-20240307")]
#[serde(rename = "claude-3-haiku", alias = "claude-3-haiku-latest")]
Claude3Haiku,
#[serde(rename = "custom")]
Custom {
@@ -69,10 +69,10 @@ impl Model {
pub fn id(&self) -> &str {
match self {
Model::Claude3_5Sonnet => "claude-3-5-sonnet-20240620",
Model::Claude3Opus => "claude-3-opus-20240229",
Model::Claude3Sonnet => "claude-3-sonnet-20240229",
Model::Claude3Haiku => "claude-3-haiku-20240307",
Model::Claude3_5Sonnet => "claude-3-5-sonnet-latest",
Model::Claude3Opus => "claude-3-opus-latest",
Model::Claude3Sonnet => "claude-3-sonnet-latest",
Model::Claude3Haiku => "claude-3-haiku-latest",
Self::Custom { name, .. } => name,
}
}

View File

@@ -4347,7 +4347,7 @@ impl ContextEditor {
fn render_payment_required_error(&self, cx: &mut ViewContext<Self>) -> AnyElement {
const ERROR_MESSAGE: &str = "Free tier exceeded. Subscribe and add payment to continue using Zed LLMs. You'll be billed at cost for tokens used.";
const SUBSCRIBE_URL: &str = "https://zed.dev/api/billing/initiate_checkout";
const ACCOUNT_URL: &str = "https://zed.dev/account";
v_flex()
.gap_0p5()
@@ -4372,7 +4372,7 @@ impl ContextEditor {
.child(Button::new("subscribe", "Subscribe").on_click(cx.listener(
|this, _, cx| {
this.last_error = None;
cx.open_url(SUBSCRIBE_URL);
cx.open_url(ACCOUNT_URL);
cx.notify();
},
)))

View File

@@ -1,5 +1,5 @@
use crate::slash_command::file_command::{FileCommandMetadata, FileSlashCommand};
use anyhow::Result;
use anyhow::{anyhow, Result};
use assistant_slash_command::{
ArgumentCompletion, SlashCommand, SlashCommandOutput, SlashCommandOutputSection,
};
@@ -37,7 +37,7 @@ impl SlashCommand for DeltaSlashCommand {
_workspace: Option<WeakView<Workspace>>,
_cx: &mut WindowContext,
) -> Task<Result<Vec<ArgumentCompletion>>> {
unimplemented!()
Task::ready(Err(anyhow!("this command does not require argument")))
}
fn run(

View File

@@ -40,7 +40,7 @@ pub struct AnthropicSettings {
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct AvailableModel {
/// The model's name in the Anthropic API. e.g. claude-3-5-sonnet-20240620
/// The model's name in the Anthropic API. e.g. claude-3-5-sonnet-latest, claude-3-opus-20240229, etc
pub name: String,
/// The model's name in Zed's UI, such as in the model selector dropdown menu in the assistant panel.
pub display_name: Option<String>,

View File

@@ -5,6 +5,7 @@ use crate::{
};
use anyhow::{anyhow, Context as _, Result};
use collections::Bound;
use feature_flags::FeatureFlagAppExt;
use fs::Fs;
use futures::stream::StreamExt;
use futures_batch::ChunksTimeoutStreamExt;
@@ -15,6 +16,7 @@ use log;
use project::{Entry, UpdatedEntriesSet, Worktree};
use serde::{Deserialize, Serialize};
use smol::channel;
use smol::future::FutureExt;
use std::{
cmp::Ordering,
future::Future,
@@ -65,6 +67,10 @@ impl EmbeddingIndex {
&self,
cx: &AppContext,
) -> impl Future<Output = Result<()>> {
if !cx.is_staff() {
return async move { Ok(()) }.boxed();
}
let worktree = self.worktree.read(cx).snapshot();
let worktree_abs_path = worktree.abs_path().clone();
let scan = self.scan_entries(worktree, cx);
@@ -75,6 +81,7 @@ impl EmbeddingIndex {
futures::try_join!(scan.task, chunk.task, embed.task, persist)?;
Ok(())
}
.boxed()
}
pub fn index_updated_entries(
@@ -82,6 +89,10 @@ impl EmbeddingIndex {
updated_entries: UpdatedEntriesSet,
cx: &AppContext,
) -> impl Future<Output = Result<()>> {
if !cx.is_staff() {
return async move { Ok(()) }.boxed();
}
let worktree = self.worktree.read(cx).snapshot();
let worktree_abs_path = worktree.abs_path().clone();
let scan = self.scan_updated_entries(worktree, updated_entries.clone(), cx);
@@ -92,6 +103,7 @@ impl EmbeddingIndex {
futures::try_join!(scan.task, chunk.task, embed.task, persist)?;
Ok(())
}
.boxed()
}
fn scan_entries(&self, worktree: Snapshot, cx: &AppContext) -> ScanEntries {

View File

@@ -336,6 +336,11 @@ mod tests {
init_test(cx);
cx.update(|cx| {
// This functionality is staff-flagged.
cx.update_flags(true, vec![]);
});
let temp_dir = tempfile::tempdir().unwrap();
let mut semantic_index = SemanticDb::new(

View File

@@ -2,7 +2,7 @@
description = "The fast, collaborative code editor."
edition = "2021"
name = "zed"
version = "0.158.0"
version = "0.158.2"
publish = false
license = "GPL-3.0-or-later"
authors = ["Zed Team <hi@zed.dev>"]

View File

@@ -1 +1 @@
dev
stable

View File

@@ -49,8 +49,8 @@ You can add custom models to the Anthropic provider by adding the following to y
"anthropic": {
"available_models": [
{
"name": "some-model",
"display_name": "some-model",
"name": "claude-3-5-sonnet-20240620",
"display_name": "Sonnet 2024-June",
"max_tokens": 128000,
"max_output_tokens": 2560,
"cache_configuration": {