Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow AI interactions to be proxied through Zed's server so you don't need an API key #7367

Merged
merged 68 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
00dad28
Add streaming responses to the RPC system
nathansobo Feb 5, 2024
d071339
WIP
as-cii Feb 15, 2024
005f8d7
WIP
as-cii Feb 15, 2024
ab14277
WIP
nathansobo Feb 16, 2024
ec40c9f
WIP
as-cii Feb 16, 2024
d4b1c0b
WIP
as-cii Feb 16, 2024
2897dc3
Get the assistant working again with OpenAI
as-cii Feb 16, 2024
30012f0
Don't make `CompletionProvider` clone and always access it via global
as-cii Feb 16, 2024
0d60c64
Implement provider switching
as-cii Feb 16, 2024
b00eb59
Create a new conversation if empty when completion provider authentic…
as-cii Feb 16, 2024
ed4fc3e
Move the active model from being on each conversation to being on the…
as-cii Feb 16, 2024
4a0cd7d
WIP
as-cii Feb 16, 2024
e7c04ff
WIP
nathansobo Feb 17, 2024
8e98262
In the zed completion provider, request stream from client
nathansobo Feb 17, 2024
37d0467
WIP: Add streaming request handler for llm completions
nathansobo Feb 17, 2024
dedb53d
WIP: Work on streaming from Google APIs
nathansobo Feb 19, 2024
650aa7b
Implement `google_ai::stream_generate_content` to talk to Gemini
as-cii Feb 19, 2024
331f925
Merge branch 'main' into rpc-streams
as-cii Feb 19, 2024
8d4e421
Extract out an `open_ai` crate
as-cii Feb 19, 2024
d0bb769
WIP
as-cii Feb 19, 2024
bcdbc90
Extract OpenAI client to be used on server
nathansobo Feb 19, 2024
68f3cfe
WIP
nathansobo Feb 19, 2024
f8cc5f9
Get OpenAI server provider wired up
nathansobo Feb 19, 2024
8026612
Merge remote-tracking branch 'origin/main' into rpc-streams
nathansobo Feb 19, 2024
f2b101c
Fix bugs in bootstrap script
nathansobo Feb 19, 2024
e8f679e
Get AI completion working with Zed's collab server
nathansobo Feb 19, 2024
92589d6
Support proxying completions to Google AI
nathansobo Feb 20, 2024
6fdafcd
Use a better default
nathansobo Feb 20, 2024
e588481
Fix cycling when using a custom model
as-cii Feb 20, 2024
f981e32
WIP
as-cii Feb 20, 2024
08fa549
Count tokens when using Gemini
as-cii Feb 20, 2024
1b3c30c
Remove semantic index and the `ai` crate
as-cii Feb 20, 2024
0527ec6
WIP
as-cii Feb 20, 2024
9294e4b
WIP
as-cii Feb 20, 2024
2b644e8
Start on a simple rate limiter
nathansobo Feb 20, 2024
a6d1925
Start adding db support to rate limiter
nathansobo Feb 20, 2024
a17b29c
Add persistence for RateLimiter in collab crate
nathansobo Feb 21, 2024
be30e11
Wire up RateLimiter in session
nathansobo Feb 21, 2024
5b0afc2
Wire up rate limiter for language model interactions
nathansobo Feb 21, 2024
9a153f7
Test rate limiter and fix bugs
as-cii Feb 21, 2024
6a2415d
Fix panic in inline assist
as-cii Feb 21, 2024
7b1a71c
Merge remote-tracking branch 'origin/main' into rpc-streams
as-cii Feb 21, 2024
b0df1c3
Save rate limit data to the database periodically
as-cii Feb 21, 2024
a6c48b3
Make assistant setting backwards-compatible.
as-cii Feb 22, 2024
1349d52
Merge remote-tracking branch 'origin/main' into rpc-streams
as-cii Feb 22, 2024
912088e
Merge remote-tracking branch 'origin/main' into rpc-streams
nathansobo Mar 7, 2024
39b97bc
Merge remote-tracking branch 'origin/main' into rpc-streams
nathansobo Mar 8, 2024
4767ecb
Merge remote-tracking branch 'origin/main' into rpc-streams
as-cii Mar 18, 2024
21e450a
Make OpenAI the default provider for the assistant
as-cii Mar 18, 2024
92cb1f8
Put all language model interactions behind a feature flag
as-cii Mar 18, 2024
19d18c3
Fix errors and warnings
as-cii Mar 18, 2024
53108c2
Fix compilation error on the server
as-cii Mar 18, 2024
53ec42c
:memo:
as-cii Mar 18, 2024
5e2902b
Fix clippy error
as-cii Mar 18, 2024
2e1803c
Remove unnecessary ErrorExt implementation
as-cii Mar 18, 2024
176e0bb
Remove unused dependencies
as-cii Mar 18, 2024
14a2398
Fix more clippy errors
as-cii Mar 18, 2024
aa72d6e
Fix outstanding clippy errors
as-cii Mar 18, 2024
968fff8
Fix tests to reflect the default is using OpenAI directly
as-cii Mar 18, 2024
e88d526
WIP
as-cii Mar 18, 2024
ddeae3a
Re-introduce the ability to load/save OpenAI credentials from/to keyc…
as-cii Mar 19, 2024
2e62aaa
Fix clippy errors
as-cii Mar 19, 2024
ffe7254
Don't error when saving zero buckets
as-cii Mar 19, 2024
a7e6ba5
Correctly send errors from server in request_stream
as-cii Mar 19, 2024
7e61ea8
Show error when assistant fails to interact with zed.dev
as-cii Mar 19, 2024
c027fcb
More clippy errors
as-cii Mar 19, 2024
5db4a19
Improve messaging
as-cii Mar 19, 2024
1b3c3e1
Merge remote-tracking branch 'origin/main' into rpc-streams
as-cii Mar 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -34,6 +33,7 @@ members = [
"crates/fuzzy",
"crates/git",
"crates/go_to_line",
"crates/google_ai",
"crates/gpui",
"crates/gpui_macros",
"crates/image_viewer",
Expand All @@ -52,6 +52,7 @@ members = [
"crates/multi_buffer",
"crates/node_runtime",
"crates/notifications",
"crates/open_ai",
"crates/outline",
"crates/picker",
"crates/prettier",
Expand All @@ -69,7 +70,6 @@ members = [
"crates/task",
"crates/tasks_ui",
"crates/search",
"crates/semantic_index",
"crates/settings",
"crates/snippet",
"crates/sqlez",
Expand Down Expand Up @@ -138,6 +138,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 @@ -156,6 +157,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 @@ -174,7 +176,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
Loading