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 사용하여 엔드 포인트에 대한 요청을하려면 챗봇 및 시맨틱 검색 엔드 포인트 모두에 대해 다음 예제를 사용할 수 있습니다.
챗봇 엔드 포인트에 게시물 요청을 보내려면이 명령을 사용하십시오.
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 및 documents )과 pgvector 확장자가 설치되어 있는지 확인하십시오.