alexandreroman / news-factory

Create AI-generated newsletters with Spring AI
Apache License 2.0
8 stars 5 forks source link

Added support for AWS Bedrock Llama2 and Azure OpenAI #1

Closed odedia closed 7 months ago

odedia commented 7 months ago

This pull request adds support for AWS Bedrock Llama2 and Azure OpenAI.

Azure OpenAI behaves identically to OpenAI prompts, but some organizations already have an Azure account to use instead of opening an OpenAI developer account.

AWS Bedrock with Llama2 is more chatty, but the response is fairly similar to OpenAI.

Attempted to also implement AWS Bedrock with Titan G1, but it was very limited in comparison and could not understand the prompts.

alexandreroman commented 7 months ago

I think we can improve support for different AI providers by leveraging Spring profiles. I'd like to avoid editing pom.xml.

Using Spring profiles, we should be able to introduce Profile-based Configuration classes, holding the right resources (Prompt templates) for every supported / tested AI providers.

I'm about to merge your commits in the branch, but we should improve the implementation that way.

odedia commented 7 months ago

I agree, we can improve it for sure. I’ll try to work on it later.

alexandreroman commented 7 months ago

Tracking progress in issue #2.