Giter Site home page Giter Site logo

bedrock-streamlit-example's Introduction

Bedrock Streamlit Example

Bedrock を利用したアプリケーションのプロトタイピングを行うための最低限の実装です。 Streamlit 単体でもセッション(履歴)管理することは可能ですが、本実装する際のことを考慮しデフォルトで DynamoDB を利用するようにしています。

devcontainer を利用することで DynamoDB Local をバックグラウンドで自動起動することができます。

AWS Credentials

Bedrock API を利用するため、ローカル開発時も AWS の認証情報が必要です。

IAM Identity Center (AWS SSO) を利用する場合

下記コマンドで IAM Identity Center から認証情報を取得してください。

aws configure sso --profile default
aws sso login  # 初回以降

IAM User を利用する場合

下記コマンドで Access Key 等を設定してください。

aws configure --profile default

Run dev server

サンプルコードは AWS SDK (boto3) を利用したものと、Langchain を利用したものの2つを用意しています。

どちらもチャットの一時記憶領域に DynamoDB を使用しています。

streamlit run main.py # use AWS SDK

streamlit run chain.py # use Langchain

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.