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

Content Type not Tracking #40

Open
taylorreinerfacteus opened this issue Aug 18, 2023 · 2 comments
Open

Content Type not Tracking #40

taylorreinerfacteus opened this issue Aug 18, 2023 · 2 comments

Comments

@taylorreinerfacteus
Copy link

Hey Y'all,

When I use the signer on the new Bedrock API, I get an error back about the content type being incorrect. It's expecting "application/json" and it works with this type in Postman, but for some reason it isn't working with the signer.

Below is the code where I'm setting the type in the request's Content, like your example. But with the below code I get back: "message": "The provided Content Type is invalid or not supported for this model", which is the behaviour received in Postman when I change the type from json to something else, like text.

This may be a Bedrock issue, but wondering if this issue has been tracked before.

Thanks!

var signer = new AWS4RequestSigner(_titanAccessKey, _titanSecretKey);
var request = new HttpRequestMessage
{
	Method = HttpMethod.Post,
	RequestUri = new Uri("https://bedrock.us-west-2.amazonaws.com/model/amazon.titan-tg1-large/invoke"),
	Content = new StringContent(promptJson, Encoding.UTF8, "application/json")
};

request = await signer.Sign(request, "bedrock", "us-west-2");

var client = new HttpClient();
var response = await client.SendAsync(request);
var resultString = await response.Content.ReadAsStringAsync();
@tsibelman
Copy link
Owner

Sorry, I no longer actively maintain this project. I recommend switching to alternative packages.

@BlockchainPunks
Copy link

library works - thank you

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

No branches or pull requests

3 participants