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扩展名。