AI Application Starter Kit
1.0.0
Neonをベクトルデータベースとして使用するAIアプリケーションを構築するためのスターターキット。
リポジトリをクローンします:
git clone https://github.com/imabutahersiddik/AI-Application-Starter-Kit.git
cd ai-starter-kit依存関係をインストールします:
npm installデータベースを設定します:
.envファイルを作成し、データベースURLを追加します。 DATABASE_URL=postgres://user:password@localhost:5432/mydb
アプリケーションを実行します:
npm start{
"input" : " Hello, how are you? "
}{
"response" : " I'm doing well, thank you! "
}{
"query" : " Find similar documents "
}{
"results" : [
{ "id" : 1 , "title" : " Document 1 " , "content" : " Content of document 1 " },
{ "id" : 2 , "title" : " Document 2 " , "content" : " Content of document 2 " }
]
} curlを使用してエンドポイントにリクエストを行うには、チャットボットとセマンティック検索エンドポイントの両方に次の例を使用できます。
チャットボットエンドポイントにPOSTリクエストを送信するには、次のコマンドを使用します。
curl -X POST http://localhost:3000/chat
-H " Content-Type: application/json "
-d ' {"input": "Hello, how are you?"} 'セマンティック検索エンドポイントにPOSTリクエストを送信するには、このコマンドを使用します。
curl -X POST http://localhost:3000/search
-H " Content-Type: application/json "
-d ' {"query": "Find similar documents"} '-X POST :リクエストメソッドを投稿として指定します。http://localhost:3000/chatまたはhttp://localhost:3000/search :endpointのURL。-H "Content-Type: application/json" :コンテンツタイプがJSONであることを示すようにリクエストヘッダーを設定します。-d '{...}' :JSON形式で送信されるデータ。これらのコマンドを使用すると、 curlを使用してコマンドラインからAPIエンドポイントをテストできます。
chatbot_responsesとdocuments )で設定され、 pgvector拡張子がインストールされていることを確認してください。