AI Application Starter Kit
1.0.0
用於使用霓虹燈作為矢量數據庫的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向端點提出請求,您可以使用以下示例對聊天機器人和語義搜索端點。
要將郵政請求發送到聊天機器人端點,請使用此命令:
curl -X POST http://localhost:3000/chat
-H " Content-Type: application/json "
-d ' {"input": "Hello, how are you?"} '要將郵政請求發送到語義搜索端點,請使用此命令:
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 :端點的URL。-H "Content-Type: application/json"是JSON。-d '{...}' :以JSON格式發送的數據。這些命令將允許您使用curl從命令行測試API端點。
chatbot_responses and documents )設置您的PostgreSQL數據庫,並安裝pgvector擴展名。