Call Bedrock endpoints from Flutter App

0

Hi,

I want to use AWS Bedrock with Claude and Titan models via its API from a flutter app (iOS for know). Mostly I would use bedrock-runtime endpoint. As far as I understand, none of the proposed SDKs is usable from within flutter. What are my options here?

I've seen this Amplify Tutorial but it hosts a backend using npm bedrock client package. Does this mean I have to host some kind of gateway myself?

已提問 5 個月前檢視次數 424 次
1 個回答
0
已接受的答案

Hi,

I would suggest to directly use InvokeModel API call. - https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html

To create signature for AWS requests you can refer to this documentation - https://docs.aws.amazon.com/IAM/latest/UserGuide/signing-elements.html

There is also a sigv4 tool for dart - https://aws.amazon.com/blogs/opensource/introducing-the-aws-sigv4-signer-for-dart/

已回答 5 個月前
  • Hi,

    thank you so much for your answer! This helped a lot. I have one more question though. I am not sure on how to handle authentication. Copying the keys from the aws console and copying them into env vars is not working well for me because they are only have short term validity. Do you know how the AWSCredentialsProvider.profile() constructor is supposed to work? I have completed all these steps with aws cli and have all the files in ~/.aws. When I run flutter with iOS Simulator I am getting: Unhandled Exception: InvalidCredentialsException: Could not load credentials for profile "dev"

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南