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

Bedrock endpoints #1023

Merged
merged 1 commit into from
Jan 11, 2024
Merged

Bedrock endpoints #1023

merged 1 commit into from
Jan 11, 2024

Conversation

devstopfix
Copy link
Contributor

Hello! I am working with the Bedrock AWS service and would like to add this module to your project. I need the addition of the relevant endpoints (provided in this PR). For now I include all the supported regions with the exception of fips which I need to investigate - I see it requires different signing and I have not tested it :- https://docs.aws.amazon.com/general/latest/gr/bedrock.html#bedrock_region

I have implemented list, get and invoke models including streaming. I have not yet implemented agents or custom models - I want to start with the basics.

I will publish the repo in the new year. Here is an example:

prompt = ~s[
Please write me a polite excited memo in the style of a GitHub pull request.
The project name is ExAws. The feature is adding AI capabilities."
]

input = ExAws.Bedrock.Titan.TextModel.build(prompt, max_token_count: 450, temperature: 0.8)
request = ExAws.Bedrock.invoke_model("amazon.titan-text-lite-v1", input)
%{"results" => [%{"outputText" => output} | _]} = ExAws.request!(request, service_override: :bedrock)
output

generates:

Hey team!
I am thrilled to announce the addition of AI capabilities to the project ExAws. This will be a game-changer for our users and will take the project to the next level.
I want to give a special thanks to the team members who helped make this possible. Your hard work and dedication are greatly appreciated.
Looking forward to seeing the impact of this feature. Let's keep up the great work and make ExAws the best it can be!
Cheers,

Without fips
@deiwin
Copy link

deiwin commented Jan 9, 2024

@bernardd, would you be able to take a look, please? This straight forward change would unblock anyone (including my team) who is trying to use this library for AWS Bedrock.

@bernardd
Copy link
Contributor

Thanks @devstopfix!

@bernardd bernardd merged commit 4f0f8b6 into ex-aws:main Jan 11, 2024
13 checks passed
@bernardd
Copy link
Contributor

If and when you want to get the bedrock service repo added to the ex_aws organisation, please let me know :)

@devstopfix
Copy link
Contributor Author

If and when you want to get the bedrock service repo added to the ex_aws organisation, please let me know :)

Thank you @bernardd! I am going through my code now - making sure it is fully tested and of same style and quality of ex_aws_s3 etc - will get back to you next week

@devstopfix devstopfix deleted the bedrock-endpoint branch January 11, 2024 06:23
anukaver-glia added a commit to salemove/ex_aws that referenced this pull request Nov 11, 2024
Map the Bedrock Agent and Bedrock Agent Runtime endpoints. This allows
to start using the services with the `ex_aws` library.

The PR is identical to the one which introduced endpoints for Bedrock
and Bedrock Runtime: ex-aws#1023.

The list of supported endpoints relies on
https://docs.aws.amazon.com/general/latest/gr/bedrock.html#bedrock_region.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants