aws-samples / aws-genai-llm-chatbot

A modular and comprehensive solution to deploy a Multi-LLM and Multi-RAG powered chatbot (Amazon Bedrock, Anthropic, HuggingFace, OpenAI, Meta, AI21, Cohere, Mistral) using AWS CDK on AWS
https://aws-samples.github.io/aws-genai-llm-chatbot/
MIT No Attribution
1.1k stars 332 forks source link

feat: Enable usage token and use Converse API with all Bedrock models #569

Closed charles-marion closed 2 months ago

charles-marion commented 2 months ago

Issue #, if available: Follow up of https://github.com/aws-samples/aws-genai-llm-chatbot/pull/564

Description of changes: Since the bedrock converse api allows a team to "write code once and use it with different models.", this change aims to use the same code for all Bedrock models.

The only differences are some models do not support system prompt or streaming.

The main goal of this change is to add usage token tracking to all Bedrock models.

Changes

Notes

Testing Called the models one by and checked the usage

image

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.