? Gdańsk AI ?
GdañskAiは、Auth0、Openai、Google Cloud API、Stripe-Web App、API、AIへの統合を備えたフルスタックAI音声チャットボット(スピーチツーテキスト、LLM、テキストツースピーチ)です。
Stripeを使用して支払いインフラストラクチャを提供するため、ユーザーはAPIトークンをbibs
できます。 AUTH0は、認証と承認を提供するために使用されます。それらを無料で使用できます-Auth0には、月に最大7000人のユーザーを無料ティアにしています。 Stripeは購入からのみ料金を請求するため、それらのいずれからも継続的な費用はありません。
これらのサービスを使用する場合は、StripeおよびAuth0アカウントをセットアップし、APIキーをweb-api/
ディレクトリに.env
に入れる必要があります。
node.js、タイプスクリプト、およびエクスプレスがここで使用されます
.env_example
、設定する必要がある値を表示します
CHATBOT_API_KEY={whatever you decide; this value is reused among ai-api, web-api and web in this project}
OPEN_AI_API_KEY={go to platform.openai.com, generate and copy-paste api key here}
# Google Cloud API
type=service_account
project_id={project id}
private_key_id=
private_key={multiline private key with structure like this:-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----n}
client_email={project name}@{project id}.iam.gserviceaccount.com
client_id=
auth_uri=https://accounts.google.com/o/oauth2/auth
token_uri=https://oauth2.googleapis.com/token
auth_provider_x509_cert_url=https://www.googleapis.com/oauth2/v1/certs
client_x509_cert_url=https://www.googleapis.com/robot/v1/metadata/x509/{project-name}%40{project-id}.iam.gserviceaccount.com
universe_domain=googleapis.com
# Stripe
STRIPE_SECRET_KEY={sk_...}
STRIPE_PUBLISHABLE_KEY={pk_...}
TOKENS_PRICE_ID={price_some characters here - you need to create a price in Stripe for tokens first and then copy-paste it here}
# TOKENS_PER_TRANSACTION defines how many interactions user can make with AI per single bibs purchase
TOKENS_PER_TRANSACTION=5
# Auth0
AUTH0_ISSUER_BASE_URL='https://{tenant-name}.us.auth0.com'
AUTH0_DOMAIN='{tenant-name}.us.auth0.com'
AUTH0_CLIENT_ID=
AUTH0_CLIENT_SECRET=
AUTH0_AUDIENCE="https://{tenant-name}.us.auth0.com/api/v2/"
AUTH0_SCOPE="openid profile email offline_access"
CLIENT_URL={url pointing to where web is deployed}
AI_API_URL={url pointing to where ai api is deployed}
web-api
ディレクトリに移動しますnpm install
またはnpm ci
npm run build
npm run start
またはnpm run dev
ホットレロードで実行する現在、Google Chromeで動作します。 GdañskAIロゴを押してオーディオを録音し、もう一度押してWeb APIに送信できます。応答が成功した後、受信したオーディオがプレイされます。
vercelのテンプレートでここで使用されるnext.js
.env_example
、設定する必要がある値を表示します
CHATBOT_API_KEY={whatever you decide; this value is reused among ai-api, web-api and web in this project}
CHATBOT_API_URL={url to where api is deployed}
NEXT_PUBLIC_API_URL={url pointing to where api is deployed}
API_URL={url to where api is deployed}
# Auth0
NEXT_PUBLIC_AUTH0_ISSUER_BASE_URL="https://{tenant-name}.us.auth0.com"
NEXT_PUBLIC_AUTH0_CLIENT_ID=
AUTH0_SECRET=
AUTH0_BASE_URL={url pointing to where web is deployed}
AUTH0_ISSUER_BASE_URL='https://{tenant-name}.us.auth0.com'
AUTH0_DOMAIN='{tenant-name}.us.auth0.com'
AUTH0_CLIENT_ID=
AUTH0_CLIENT_SECRET=
AUTH0_AUDIENCE="https://{tenant-name}.us.auth0.com/api/v2/"
AUTH0_SCOPE="openid profile email offline_access"
CLIENT_URL={url pointing to where web is deployed}
web
ディレクトリに移動しますnpm install
またはnpm ci
npm run build
stripe listen --forward-to http://localhost:3000/webhook
(3000からポートを調整した場合は、ポートを変更した場合はポートを調整します) - ビブの購入で/webhook
エンドポイントを呼び出すためにこれが必要ですnpm run start
signup.ts
でscreen_hint: "signup",
を削除/コメントする/コメントすることができますここでは、OpenaiとGoogle Cloud APIを使用して、音声からテキスト(Whisper-1)、LLM(GPT-3.5-Turbo)、およびテキストツースピーチ(Google Cloud TextTospeechClient)サービスを提供します。
PythonとFastapiはこちら
.env_example
、設定する必要がある値を表示します
CHATBOT_API_KEY={whatever you decide; this value is reused among ai-api, web-api and web in this project}
OPEN_AI_API_KEY={go to platform.openai.com, generate and copy-paste api key here}
# Google Cloud API start
type=service_account
project_id={project id}
private_key_id=
private_key={multiline private key with structure like this:-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----n}
client_email={project name}@{project id}.iam.gserviceaccount.com
client_id=
auth_uri=https://accounts.google.com/o/oauth2/auth
token_uri=https://oauth2.googleapis.com/token
auth_provider_x509_cert_url=https://www.googleapis.com/oauth2/v1/certs
client_x509_cert_url=https://www.googleapis.com/robot/v1/metadata/x509/{project-name}%40{project-id}.iam.gserviceaccount.com
universe_domain=googleapis.com
PORT=9000
ai-api
ディレクトリに移動しますアカウントを作成し、新しいテナントを作成します。セットアップする必要があります。
アプリケーション
API
アカウントを作成し、実稼働時に実行し、実際の支払いを処理する場合を除き、テストモードをターンし、[開発者]タブに移動してからAPIキーを移動します。これは、stripe_secret_keyとstripe_publishable_keyの値を見つけることができる場所です。 [製品]タブに移動し、BIBの1回の購入を表す製品(1つのBIB-ユーザーのAIとの1つの相互作用)を表す製品を追加します。作成したら、PriseIDをコピーして、tokens_price_idとして.envに入れます。
アカウントを作成し、platform.openai.comにアクセスし、APIキーを生成し、.envファイルで使用します
アカウントを作成し、IAM&Adminに移動してからサービスアカウントに移動してプロジェクトを作成します。プロジェクトのIDが必要です。ENVファイルが必要です。次に、資格情報を使用してJSONを生成し、ファイルから.ENVファイルに値を抽出する必要があります。アクセス資格情報の作成ページ(検索エンジンを使用してリンクを見つけることができます)。次にキー - >キーを追加 - >新しいキー - > json-> createを作成します。必要なすべての値を使用して、credentials.jsonを取得する必要があります。最後に、テキストへのスピーチAPIサービスを有効にする必要があり、準備ができている必要があります
ゼロから構成プロセスを経て、ドキュメントのギャップを埋めることにより、READMEを改善してくれたJeff McJunkinに感謝します
GNU GPL V2
このソフトウェアを調査で使用する場合は、次の引用を使用してください。
@software { Maczan_Gdansk_AI_2023 ,
author = { Maczan, Jędrzej Paweł } ,
title = { {Gdańsk AI - Full stack voice chatbot} } ,
url = { https://github.com/jmaczan/gdansk-ai } ,
year = { 2023 } ,
publisher = { GitHub }
}
2023年にポーランドのグダニスクでメイド