Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
statefb committed Mar 19, 2024
1 parent 02367d0 commit 8291c26
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 43 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -96,7 +93,8 @@ It's an architecture built on AWS managed services, eliminating the need for inf

## Features and Roadmap

### Basic chat features
<details>
<summary>Basic chat features</summary>

- [x] Authentication (Sign-up, Sign-in)
- [x] Creation, storage, and deletion of conversations
Expand All @@ -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
</details>

### Customized bot features
<details>
<summary>Customized bot features</summary>

- [x] Customized bot creation
- [x] Customized bot sharing
- [x] Publish as stand-alone API
</details>

### RAG features
<details>
<summary>RAG features</summary>

- [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
</details>

### Admin features
<details>
<summary>Admin features</summary>

- [x] Tracking usage fees per bot
- [x] List all published bot
</details>

## Deploy using CDK

Expand Down
4 changes: 0 additions & 4 deletions cdk/lib/constructs/usage-analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions docs/ADMINISTRATOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
23 changes: 17 additions & 6 deletions docs/PUBLISH_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,31 @@

## 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

Using only an API key is not recommended as described in: [AWS API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html). Consequently, this sample implements a simple IP address restriction via AWS WAF. The WAF rule is applied commonly across the application due to cost considerations, under the assumption that the sources one would want to restrict are likely the same across all issued APIs. **Please adhere to your organization's security policy for actual implementation.** Also see [Architecture](#architecture) section.

## 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

Expand All @@ -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
59 changes: 34 additions & 25 deletions docs/README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)として知られています)。なお、作成したボットはアプリケーションのユーザー間で共有することができます。
Expand Down Expand Up @@ -76,36 +73,48 @@ AWS のマネージドサービスで構成した、インフラストラクチ

## 機能・ロードマップ

### 基本

- [x] 認証 (サインアップ・サインイン)
- [x] 会話の新規作成・保存・削除
- [x] チャットボットの返信内容のコピー
- [x] 会話の件名自動提案
- [x] コードのシンタックスハイライト
- [x] マークダウンのレンダリング
- [x] ストリーミングレスポンス
- [x] IP アドレス制限
- [x] メッセージの編集と再送
- [x] I18n
- [x] モデルの切り替え (Claude Instant / Claude)
<details>
<summary>基本的なチャット機能</summary>

- [x] 認証 (サインアップ、サインイン)
- [x] 会話の作成、保存、削除
- [x] チャットボットの返答のコピー
- [x] 会話のための自動的なトピックの提案
- [x] コードの構文強調表示
- [x] Markdown の表示
- [x] ストリーミング応答
- [x] IP アドレスの制限
- [x] メッセージの編集と再送信
- [x] 国際化
- [x] モデルの切り替え
</details>

### カスタマイズボット
<details>
<summary>カスタマイズされたボットの機能</summary>

- [x] カスタマイズボットの作成
- [x] カスタマイズボットのシェア
- [x] カスタマイズされたボットの作成
- [x] カスタマイズされたボットの共有
- [x] 独立した API として公開
</details>

### RAG
<details>
<summary>RAG機能</summary>

- [x] Web (html)
- [x] テキストデータ (txt, csv, markdown and etc)
- [x] テキストデータ (txtcsvmarkdown など)
- [x] PDF
- [x] Microsoft オフィス (pptx, docx, xlsx)
- [x] Youtube 字幕
- [x] Microsoft Office ファイル (pptx、docx、xlsx)
- [x] YouTube の字幕
- [ ] S3 バケットからのインポート
- [ ] 既存の Kendra / OpenSearch / KnowledgeBase からのインポート
</details>

### 管理者用機能
<details>
<summary>管理者機能</summary>

- [ ] ユーザーの利用状況分析
- [x] ボットごとの使用料の追跡
- [x] 公開されたボットの一覧表示
</details>

## Deploy using CDK

Expand Down
Binary file added docs/imgs/bot_api_publish_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/bot_api_publish_screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/bot_api_publish_screenshot3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/group_membership_publish_allowed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8291c26

Please sign in to comment.