Skip to content

Bedrock API: Add option to configure API endpoint (#1018) #1063

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

szarpul
Copy link

@szarpul szarpul commented Jul 17, 2024

#1018
Add URL parameter to the constructor to set the endpointOverride in SdkClientBuilder.
The URL can be null as the endpointOverride is also null by default.

@bruno-oliveira
Copy link
Contributor

Any timeline for this to be merged?

@szarpul
Copy link
Author

szarpul commented Aug 4, 2024

This change still hasn't been approved for merge.
@tzolov @markpollack what do you think about adding such an endpoint option?

@mcadariu
Copy link

mcadariu commented Aug 9, 2024

Hi @tzolov @markpollack it would be awesome if you guys could have a look at this.
Thanks!

@bruno-oliveira
Copy link
Contributor

bruno-oliveira commented Aug 14, 2024

@tzolov @markpollack Any luck with this so far? It's a useful MR for a lot of users I'd reckon, given the concerns regarding data privacy and protection.

@@ -109,6 +110,21 @@ public AnthropicChatBedrockApi(String modelId, AwsCredentialsProvider credential
super(modelId, credentialsProvider, region, objectMapper, timeout);
}

/**
* Create a new AnthropicChatBedrockApi instance using the provided credentials provider, region and object mapper.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can also specify here that we require a new parameter, the endpoint override.

@@ -113,6 +114,21 @@ public Anthropic3ChatBedrockApi(String modelId, AwsCredentialsProvider credentia
super(modelId, credentialsProvider, region, objectMapper, timeout);
}

/**
* Create a new AnthropicChatBedrockApi instance using the provided credentials provider, region and object mapper.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@@ -108,6 +109,21 @@ public CohereChatBedrockApi(String modelId, AwsCredentialsProvider credentialsPr
super(modelId, credentialsProvider, region, objectMapper, timeout);
}

/**
* Create a new CohereChatBedrockApi instance using the provided credentials provider, region and object mapper.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@@ -109,6 +110,22 @@ public CohereEmbeddingBedrockApi(String modelId, AwsCredentialsProvider credenti
super(modelId, credentialsProvider, region, objectMapper, timeout);
}

/**
* Create a new CohereEmbeddingBedrockApi instance using the provided credentials provider, region and object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

* @param region The AWS region to use.
* @param objectMapper The object mapper to use for JSON serialization and deserialization.
* @param timeout The timeout to use.
* @param endpointOverride The endpoint to use.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The endpoint override to use."

@@ -106,6 +107,21 @@ public LlamaChatBedrockApi(String modelId, AwsCredentialsProvider credentialsPro
super(modelId, credentialsProvider, region, objectMapper, timeout);
}

/**
* Create a new LlamaChatBedrockApi instance using the provided credentials provider, region and object mapper.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same small changes here and also all places similarly set below.

@bruno-oliveira
Copy link
Contributor

@szarpul Thank you for implementing this! I left some small comments, mostly about the "code documentation" aspect of the MR, that, otherwise, looks great to me and something that would be really, really useful for a lot of people to benefit from!
@tzolov @markpollack if you could take a look at this one once again, and, pheraps see if it could be included in Milestone 3, that would be super amazing!

If necessary, I can take these changes upon myself in terms of addressing the review comments and seeing if we can get this one past the finish line too!

@markpollack markpollack added this to the 1.0.0-M7 milestone Mar 25, 2025
@markpollack
Copy link
Member

The chat models for bedrock API have been removed in Spring AI M6 since Amazon is encouraging people to switch to the new API and this reduced a great deal of maintenance burdon for us not having to support multiple vendor SDK/APIs.

https://spring.io/blog/2025/02/14/spring-ai-1-0-0-m6-released#removed-deprecated-amazon-bedrock-chat-models

We did keep the embedding models, so that is something that is still relevant.

@tzolov
Copy link
Contributor

tzolov commented Apr 9, 2025

Hey @bruno-oliveira is there something in this PR that can be reused? the embedding models perhaps?

@tzolov tzolov modified the milestones: 1.0.0-M7, 1.0.0-RC1 Apr 9, 2025
@bruno-oliveira
Copy link
Contributor

bruno-oliveira commented Apr 9, 2025 via email

@markpollack markpollack modified the milestones: 1.0.0-RC1-triage, 1.0.x May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants