Skip to content

Commit

Permalink
Allow AI interactions to be proxied through Zed's server so you don't…
Browse files Browse the repository at this point in the history
… need an API key (zed-industries#7367)

Co-authored-by: Antonio <[email protected]>

Resurrected this from some assistant work I did in Spring of 2023.
- [x] Resurrect streaming responses
- [x] Use streaming responses to enable AI via Zed's servers by default
(but preserve API key option for now)
- [x] Simplify protobuf
- [x] Proxy to OpenAI on zed.dev
- [x] Proxy to Gemini on zed.dev
- [x] Improve UX for switching between openAI and google models
- We current disallow cycling when setting a custom model, but we need a
better solution to keep OpenAI models available while testing the google
ones
- [x] Show remaining tokens correctly for Google models
- [x] Remove semantic index
- [x] Delete `ai` crate
- [x] Cloud front so we can ban abuse
- [x] Rate-limiting
- [x] Fix panic when using inline assistant
- [x] Double check the upgraded `AssistantSettings` are
backwards-compatible
- [x] Add hosted LLM interaction behind a `language-models` feature
flag.

Release Notes:

- We are temporarily removing the semantic index in order to redesign it
from scratch.

---------

Co-authored-by: Antonio <[email protected]>
Co-authored-by: Antonio Scandurra <[email protected]>
Co-authored-by: Thorsten <[email protected]>
Co-authored-by: Max <[email protected]>
  • Loading branch information
5 people authored and pjlast committed Mar 26, 2024
1 parent 3934ee8 commit 9668b0d
Show file tree
Hide file tree
Showing 87 changed files with 3,628 additions and 8,918 deletions.
234 changes: 36 additions & 198 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[workspace]
members = [
"crates/activity_indicator",
"crates/ai",
"crates/assets",
"crates/assistant",
"crates/audio",
Expand Down Expand Up @@ -35,6 +34,7 @@ members = [
"crates/fuzzy",
"crates/git",
"crates/go_to_line",
"crates/google_ai",
"crates/gpui",
"crates/gpui_macros",
"crates/image_viewer",
Expand All @@ -53,6 +53,7 @@ members = [
"crates/multi_buffer",
"crates/node_runtime",
"crates/notifications",
"crates/open_ai",
"crates/outline",
"crates/picker",
"crates/prettier",
Expand All @@ -70,7 +71,6 @@ members = [
"crates/task",
"crates/tasks_ui",
"crates/search",
"crates/semantic_index",
"crates/settings",
"crates/snippet",
"crates/sqlez",
Expand Down Expand Up @@ -140,6 +140,7 @@ fsevent = { path = "crates/fsevent" }
fuzzy = { path = "crates/fuzzy" }
git = { path = "crates/git" }
go_to_line = { path = "crates/go_to_line" }
google_ai = { path = "crates/google_ai" }
gpui = { path = "crates/gpui" }
gpui_macros = { path = "crates/gpui_macros" }
install_cli = { path = "crates/install_cli" }
Expand All @@ -158,6 +159,7 @@ menu = { path = "crates/menu" }
multi_buffer = { path = "crates/multi_buffer" }
node_runtime = { path = "crates/node_runtime" }
notifications = { path = "crates/notifications" }
open_ai = { path = "crates/open_ai" }
outline = { path = "crates/outline" }
picker = { path = "crates/picker" }
plugin = { path = "crates/plugin" }
Expand All @@ -176,7 +178,6 @@ rpc = { path = "crates/rpc" }
task = { path = "crates/task" }
tasks_ui = { path = "crates/tasks_ui" }
search = { path = "crates/search" }
semantic_index = { path = "crates/semantic_index" }
settings = { path = "crates/settings" }
snippet = { path = "crates/snippet" }
sqlez = { path = "crates/sqlez" }
Expand Down
3 changes: 0 additions & 3 deletions assets/keymaps/default-macos.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"alt-tab": "search::CycleMode",
"cmd-shift-h": "search::ToggleReplace",
"alt-cmd-g": "search::ActivateRegexMode",
"alt-cmd-s": "search::ActivateSemanticMode",
"alt-cmd-x": "search::ActivateTextMode"
}
},
Expand All @@ -276,7 +275,6 @@
"alt-tab": "search::CycleMode",
"cmd-shift-h": "search::ToggleReplace",
"alt-cmd-g": "search::ActivateRegexMode",
"alt-cmd-s": "search::ActivateSemanticMode",
"alt-cmd-x": "search::ActivateTextMode"
}
},
Expand All @@ -302,7 +300,6 @@
"alt-tab": "search::CycleMode",
"alt-cmd-f": "project_search::ToggleFilters",
"alt-cmd-g": "search::ActivateRegexMode",
"alt-cmd-s": "search::ActivateSemanticMode",
"alt-cmd-x": "search::ActivateTextMode"
}
},
Expand Down
32 changes: 9 additions & 23 deletions assets/settings/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@
"default_width": 380
},
"assistant": {
// Version of this setting.
"version": "1",
// Whether to show the assistant panel button in the status bar.
"button": true,
// Where to dock the assistant panel. Can be 'left', 'right' or 'bottom'.
Expand All @@ -245,28 +247,16 @@
"default_width": 640,
// Default height when the assistant is docked to the bottom.
"default_height": 320,
// Deprecated: Please use `provider.api_url` instead.
// The default OpenAI API endpoint to use when starting new conversations.
"openai_api_url": "https://api.openai.com/v1",
// Deprecated: Please use `provider.default_model` instead.
// The default OpenAI model to use when starting new conversations. This
// setting can take three values:
//
// 1. "gpt-3.5-turbo-0613""
// 2. "gpt-4-0613""
// 3. "gpt-4-1106-preview"
"default_open_ai_model": "gpt-4-1106-preview",
// AI provider.
"provider": {
"type": "openai",
// The default OpenAI API endpoint to use when starting new conversations.
"api_url": "https://api.openai.com/v1",
// The default OpenAI model to use when starting new conversations. This
"name": "openai",
// The default model to use when starting new conversations. This
// setting can take three values:
//
// 1. "gpt-3.5-turbo-0613""
// 2. "gpt-4-0613""
// 3. "gpt-4-1106-preview"
"default_model": "gpt-4-1106-preview"
// 1. "gpt-3.5-turbo"
// 2. "gpt-4"
// 3. "gpt-4-turbo-preview"
"default_model": "gpt-4-turbo-preview"
}
},
// Whether the screen sharing icon is shown in the os status bar.
Expand Down Expand Up @@ -505,10 +495,6 @@
// Existing terminals will not pick up this change until they are recreated.
// "max_scroll_history_lines": 10000,
},
// Difference settings for semantic_index
"semantic_index": {
"enabled": true
},
// Settings specific to our elixir integration
"elixir": {
// Change the LSP zed uses for elixir.
Expand Down
41 changes: 0 additions & 41 deletions crates/ai/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion crates/ai/LICENSE-GPL

This file was deleted.

8 changes: 0 additions & 8 deletions crates/ai/src/ai.rs

This file was deleted.

23 changes: 0 additions & 23 deletions crates/ai/src/auth.rs

This file was deleted.

23 changes: 0 additions & 23 deletions crates/ai/src/completion.rs

This file was deleted.

121 changes: 0 additions & 121 deletions crates/ai/src/embedding.rs

This file was deleted.

16 changes: 0 additions & 16 deletions crates/ai/src/models.rs

This file was deleted.

Loading

0 comments on commit 9668b0d

Please sign in to comment.