Skip to content

Commit

Permalink
assistant: Add Bedrock support (#21092)
Browse files Browse the repository at this point in the history
Closes #16544

Release Notes:

- Added support for AWS Bedrock to the Assistant.

---------

Co-authored-by: Marshall Bowers <[email protected]>
Co-authored-by: Anthony <[email protected]>
Co-authored-by: Anthony Eid <[email protected]>
  • Loading branch information
4 people authored Feb 24, 2025
1 parent 17a483c commit eda2333
Show file tree
Hide file tree
Showing 10 changed files with 1,045 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions assets/icons/ai_bedrock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions crates/assistant_settings/src/assistant_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ fn providers_schema(_: &mut schemars::gen::SchemaGenerator) -> schemars::schema:
schemars::schema::SchemaObject {
enum_values: Some(vec![
"anthropic".into(),
"bedrock".into(),
"google".into(),
"lmstudio".into(),
"ollama".into(),
Expand Down
6 changes: 6 additions & 0 deletions crates/language_models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ path = "src/language_models.rs"
[dependencies]
anthropic = { workspace = true, features = ["schemars"] }
anyhow.workspace = true
aws-config = { workspace = true, features = ["behavior-version-latest"] }
aws-credential-types = { workspace = true, features = ["hardcoded-credentials"] }
aws_http_client.workspace = true
bedrock.workspace = true
client.workspace = true
collections.workspace = true
credentials_provider.workspace = true
Expand All @@ -25,6 +29,7 @@ fs.workspace = true
futures.workspace = true
google_ai = { workspace = true, features = ["schemars"] }
gpui.workspace = true
gpui_tokio.workspace = true
http_client.workspace = true
language_model.workspace = true
lmstudio = { workspace = true, features = ["schemars"] }
Expand All @@ -42,6 +47,7 @@ smol.workspace = true
strum.workspace = true
theme.workspace = true
tiktoken-rs.workspace = true
tokio = { workspace = true, features = ["rt", "rt-multi-thread"] }
ui.workspace = true
util.workspace = true

Expand Down
5 changes: 5 additions & 0 deletions crates/language_models/src/language_models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub mod provider;
mod settings;

use crate::provider::anthropic::AnthropicLanguageModelProvider;
use crate::provider::bedrock::BedrockLanguageModelProvider;
use crate::provider::cloud::CloudLanguageModelProvider;
use crate::provider::copilot_chat::CopilotChatLanguageModelProvider;
use crate::provider::google::GoogleLanguageModelProvider;
Expand Down Expand Up @@ -63,6 +64,10 @@ fn register_language_model_providers(
MistralLanguageModelProvider::new(client.http_client(), cx),
cx,
);
registry.register_provider(
BedrockLanguageModelProvider::new(client.http_client(), cx),
cx,
);
registry.register_provider(CopilotChatLanguageModelProvider::new(cx), cx);

cx.observe_flag::<feature_flags::LanguageModels, _>(move |enabled, cx| {
Expand Down
1 change: 1 addition & 0 deletions crates/language_models/src/provider.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod anthropic;
pub mod bedrock;
pub mod cloud;
pub mod copilot_chat;
pub mod deepseek;
Expand Down
Loading

0 comments on commit eda2333

Please sign in to comment.