openai embedding base search example
1.0.0
Article search examples based on the embedding interface and GPT3.5 interface of OpenAI (of course, most of the code is given through ChatGPT, I only made some changes to encapsulation)
PS. Code is just a simple example. In fact, the embedding data that should be stored in the article using a vector database.
.env file in the root directory of this project and set the OpenAPI API KEY environment variable OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#如果需要使用代理访问,请提供下面的环境变量
# https_proxy=http://127.0.0.1:1080npm installnpm run dev