diff --git a/README.md b/README.md index 61e77160b..af6b095fe 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,6 @@ Not only text but also images are available with [Anthropic's Claude 3](https:// ![](./docs/imgs/demo.gif) -> [!Note] -> Currently the image will be compressed into 800px jpeg due to DynamoDB [item size limitation](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ServiceQuotas.html#limits-items). [Issue](https://github.com/aws-samples/bedrock-claude-chat/issues/131) - ### Bot Personalization Add your own instruction and give external knowledge as URL or files (a.k.a [RAG](./docs/RAG.md)). The bot can be shared among application users. @@ -96,7 +93,8 @@ It's an architecture built on AWS managed services, eliminating the need for inf ## Features and Roadmap -### Basic chat features +
+Basic chat features - [x] Authentication (Sign-up, Sign-in) - [x] Creation, storage, and deletion of conversations @@ -108,25 +106,35 @@ It's an architecture built on AWS managed services, eliminating the need for inf - [x] IP address restriction - [x] Edit message & re-send - [x] I18n -- [x] Model switch (Claude Instant / Claude) +- [x] Model switch +
-### Customized bot features +
+Customized bot features - [x] Customized bot creation - [x] Customized bot sharing - [x] Publish as stand-alone API +
-### RAG features +
+RAG features - [x] Web (html) - [x] Text data (txt, csv, markdown and etc) - [x] PDF - [x] Microsoft office files (pptx, docx, xlsx) - [x] Youtube transcript +- [ ] Import from S3 bucket +- [ ] Import external existing Kendra / OpenSearch / KnowledgeBase +
-### Admin features +
+Admin features - [x] Tracking usage fees per bot +- [x] List all published bot +
## Deploy using CDK diff --git a/cdk/lib/constructs/usage-analysis.ts b/cdk/lib/constructs/usage-analysis.ts index 3ba91f66b..8d2989318 100644 --- a/cdk/lib/constructs/usage-analysis.ts +++ b/cdk/lib/constructs/usage-analysis.ts @@ -17,8 +17,6 @@ export interface UsageAnalysisProps { } export class UsageAnalysis extends Construct { - // public readonly databaseName: string; - // public readonly ddbExportTableName: string; public readonly database: glue.IDatabase; public readonly ddbExportTable: glue.ITable; public readonly ddbBucket: s3.IBucket; @@ -253,8 +251,6 @@ export class UsageAnalysis extends Construct { value: `s3://${queryResultBucket.bucketName}`, }); - // this.databaseName = GLUE_DATABASE_NAME; - // this.ddbExportTableName = DDB_EXPORT_TABLE_NAME; this.database = database; this.ddbBucket = ddbBucket; this.ddbExportTable = ddbExportTable; diff --git a/docs/ADMINISTRATOR.md b/docs/ADMINISTRATOR.md index 3d0d7ae7c..026673c69 100644 --- a/docs/ADMINISTRATOR.md +++ b/docs/ADMINISTRATOR.md @@ -8,3 +8,11 @@ Currently provides a basic overview of chatbot and user usage, focusing on aggre TODO Screenshot + +## Notes + +- As stated in the [architecture](../README.md#architecture), the admin features will refer to the S3 bucket exported from DynamoDB. Please note that since the export is performed once every hour, the latest conversations may not be reflected immediately. + +- In public bot usages, bots that have not been used at all during the specified period will not be listed. + +- In user usages, users who have not used the system at all during the specified period will not be listed. diff --git a/docs/PUBLISH_API.md b/docs/PUBLISH_API.md index 634c0c027..6022f0f03 100644 --- a/docs/PUBLISH_API.md +++ b/docs/PUBLISH_API.md @@ -2,7 +2,7 @@ ## Overview -This sample includes a feature for publishing APIs. It is designed to be integrated into actual production environments without the need for a frontend, as the existing services do not require a chat interface for integration. The user experience (UX) desired to be provided to the end-user is not in the form of a chat. While a chat UI is convenient for preliminary validation, the actual implementation is more suited for backend reuse. After simple validation through chat is completed, it is often more convenient to have a clearly specified API provided as a standalone feature. Therefore, this sample comes equipped with the capability to publish customized bots. By entering settings for quotas, throttling, origins, etc., an endpoint is published along with an API key. +This sample includes a feature for publishing APIs. While a chat interface can be convenient for preliminary validation, the actual implementation depends on the specific use case and user experience (UX) desired for the end-user. In some scenarios, a chat UI may be the preferred choice, while in others, stand-alone API might be more suitable. After initial validation, this sample provides the capability to publish customized bots according to the project's needs. By entering settings for quotas, throttling, origins, etc., an endpoint can be published along with an API key, offering flexibility for diverse integration options. ## Security @@ -10,10 +10,23 @@ Using only an API key is not recommended as described in: [AWS API Gateway Devel ## How to publish customized bot API -TODO +### Prerequisites -- Add user to cognito group -- Screenshots +For governance reasons, only limited users are able to publish bots. Before publishing, the user must be a member of group called `PublishAllowed`, which can be set up via the management console or aws cli. + +![](./imgs/group_membership_publish_allowed.png) + +### API Publish Settings + +After logging in as a `PublishedAllowed` user and create a bot, choose `API PublishSettings`. Note that only a shared bot can be published. +![](./imgs/bot_api_publish_screenshot.png) + +On the following screen, we can configure several parameters regarding throttling. For the detail, please also see: [Throttle API requests for better throughput](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html). +![](./imgs/bot_api_publish_screenshot2.png) + +After deployment, following screen will appear where you can get the endpoint url and a api key. We can also add and delete api keys. + +![](./imgs/bot_api_publish_screenshot3.png) ## Architecture @@ -30,5 +43,3 @@ Client needs to set `x-api-key` on the request header. ## API specification See [here](https://aws-samples.github.io/bedrock-claude-chat). - -TODO diff --git a/docs/README_ja.md b/docs/README_ja.md index 23ba1d5ac..c3bcdff3c 100644 --- a/docs/README_ja.md +++ b/docs/README_ja.md @@ -15,9 +15,6 @@ [Claude 3](https://www.anthropic.com/news/claude-3-family)によるテキストと画像の両方を利用したチャットが可能です。現在`Haiku`および`Sonnet`をサポートしています。 ![](./imgs/demo_ja.gif) -> [!Note] -> 現在画像は DynamoDB [アイテムサイズ制限](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ServiceQuotas.html#limits-items) のため 800px jpeg へ変換されます。[Issue](https://github.com/aws-samples/bedrock-claude-chat/issues/131) - ### ボットのカスタマイズ 外部のナレッジおよび具体的なインストラクションを組み合わせ、ボットをカスタマイズすることが可能です(外部のナレッジを利用した方法は[RAG](./RAG_ja.md)として知られています)。なお、作成したボットはアプリケーションのユーザー間で共有することができます。 @@ -76,36 +73,48 @@ AWS のマネージドサービスで構成した、インフラストラクチ ## 機能・ロードマップ -### 基本 - -- [x] 認証 (サインアップ・サインイン) -- [x] 会話の新規作成・保存・削除 -- [x] チャットボットの返信内容のコピー -- [x] 会話の件名自動提案 -- [x] コードのシンタックスハイライト -- [x] マークダウンのレンダリング -- [x] ストリーミングレスポンス -- [x] IP アドレス制限 -- [x] メッセージの編集と再送 -- [x] I18n -- [x] モデルの切り替え (Claude Instant / Claude) +
+基本的なチャット機能 + +- [x] 認証 (サインアップ、サインイン) +- [x] 会話の作成、保存、削除 +- [x] チャットボットの返答のコピー +- [x] 会話のための自動的なトピックの提案 +- [x] コードの構文強調表示 +- [x] Markdown の表示 +- [x] ストリーミング応答 +- [x] IP アドレスの制限 +- [x] メッセージの編集と再送信 +- [x] 国際化 +- [x] モデルの切り替え +
-### カスタマイズボット +
+カスタマイズされたボットの機能 -- [x] カスタマイズボットの作成 -- [x] カスタマイズボットのシェア +- [x] カスタマイズされたボットの作成 +- [x] カスタマイズされたボットの共有 +- [x] 独立した API として公開 +
-### RAG +
+RAG機能 - [x] Web (html) -- [x] テキストデータ (txt, csv, markdown and etc) +- [x] テキストデータ (txt、csv、markdown など) - [x] PDF -- [x] Microsoft オフィス (pptx, docx, xlsx) -- [x] Youtube 字幕 +- [x] Microsoft Office ファイル (pptx、docx、xlsx) +- [x] YouTube の字幕 +- [ ] S3 バケットからのインポート +- [ ] 既存の Kendra / OpenSearch / KnowledgeBase からのインポート +
-### 管理者用機能 +
+管理者機能 -- [ ] ユーザーの利用状況分析 +- [x] ボットごとの使用料の追跡 +- [x] 公開されたボットの一覧表示 +
## Deploy using CDK diff --git a/docs/imgs/bot_api_publish_screenshot.png b/docs/imgs/bot_api_publish_screenshot.png new file mode 100644 index 000000000..9d74248db Binary files /dev/null and b/docs/imgs/bot_api_publish_screenshot.png differ diff --git a/docs/imgs/bot_api_publish_screenshot2.png b/docs/imgs/bot_api_publish_screenshot2.png new file mode 100644 index 000000000..b081167ea Binary files /dev/null and b/docs/imgs/bot_api_publish_screenshot2.png differ diff --git a/docs/imgs/bot_api_publish_screenshot3.png b/docs/imgs/bot_api_publish_screenshot3.png new file mode 100644 index 000000000..0ad96974c Binary files /dev/null and b/docs/imgs/bot_api_publish_screenshot3.png differ diff --git a/docs/imgs/group_membership_publish_allowed.png b/docs/imgs/group_membership_publish_allowed.png new file mode 100644 index 000000000..f526869b6 Binary files /dev/null and b/docs/imgs/group_membership_publish_allowed.png differ