Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Merge remote-tracking branch 'origin/main' into ai-refactoring

Antonio Scandurra27c90f12f608
diff --cc Cargo.lock
index e74068b2d2a,d669be5d9d2..c232afa0817
--- a/Cargo.lock
+++ b/Cargo.lock
@@@ -1196,6 -1192,41 +1198,41 @@@ version = "1.0.0
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+ [[package]]
+ name = "channel"
+ version = "0.1.0"
+ dependencies = [
+ "anyhow",
+ "client",
+ "collections",
+ "db",
+ "futures 0.3.28",
+ "gpui",
+ "image",
+ "language",
+ "lazy_static",
+ "log",
+ "parking_lot 0.11.2",
+ "postage",
+ "rand 0.8.5",
+ "rpc",
+ "schemars",
+ "serde",
+ "serde_derive",
+ "settings",
+ "smol",
+ "staff_mode",
+ "sum_tree",
+ "tempfile",
+ "text",
+ "thiserror",
- "time 0.3.24",
++ "time 0.3.27",
+ "tiny_http",
+ "url",
+ "util",
+ "uuid 1.4.1",
+ ]
+
[[package]]
name = "chrono"
version = "0.4.26"
diff --cc crates/ai/src/ai.rs
index 0b56fedb110,d2be651bd56..2c2d7e774e1
--- a/crates/ai/src/ai.rs
+++ b/crates/ai/src/ai.rs
@@@ -1,9 -1,9 +1,10 @@@
pub mod assistant;
mod assistant_settings;
+mod streaming_diff;
-use anyhow::Result;
+use anyhow::{anyhow, Result};
pub use assistant::AssistantPanel;
+ use assistant_settings::OpenAIModel;
use chrono::{DateTime, Local};
use collections::HashMap;
use fs::Fs;
diff --cc crates/ai/src/assistant.rs
index b8458bb9ac8,81299bbdc26..cfe3da22b58
--- a/crates/ai/src/assistant.rs
+++ b/crates/ai/src/assistant.rs
@@@ -1,9 -1,7 +1,9 @@@
use crate::{
- assistant_settings::{AssistantDockPosition, AssistantSettings},
+ assistant_settings::{AssistantDockPosition, AssistantSettings, OpenAIModel},
- MessageId, MessageMetadata, MessageStatus, OpenAIRequest, OpenAIResponseStreamEvent,
- RequestMessage, Role, SavedConversation, SavedConversationMetadata, SavedMessage,
+ stream_completion,
+ streaming_diff::{Hunk, StreamingDiff},
+ MessageId, MessageMetadata, MessageStatus, OpenAIRequest, RequestMessage, Role,
+ SavedConversation, SavedConversationMetadata, SavedMessage, OPENAI_API_URL,
};
use anyhow::{anyhow, Result};
use chrono::{DateTime, Local};