Skip to content

Latest commit

 

History

History
117 lines (87 loc) · 6.25 KB

README-EN.md

File metadata and controls

117 lines (87 loc) · 6.25 KB

简体中文 · English

User Communication

Telegram Channel

Version Updates

  • V0.1.4, 20240120, Supports one-click deployment with Zeabur, very convenient, highly recommended!
  • V0.1.3, 20240120, Supports local deployment, can be deployed on your own server
  • V0.1.2, 20240115, Fixes streaming output issues in non-search scenarios for the cloudflare worker version
  • V0.1.1, 20240114, Supports one-click deployment with Vercel, currently suitable for those who like tinkering

For more historical updates, please see Version History

Product Introduction

  • search2ai, supports search and networking for OpenAI, and the large model will decide whether to connect to the network based on your input, not every time. No plugins needed, no need to change the key, just replace the custom address in your commonly used OpenAI third-party client, also supports self-deployment, and will not affect other features of using OpenAI, like drawing, voice, etc.
Effect Example Effect Example
Effect Example Effect Example

How to Use

Direct use: Replace the custom domain in the client with the following address

https://api.search2ai.online

As shown in the picture

Effect Example Effect Example

Demo site experience address: Demo Site, follow the instructions to use your key, replace the custom domain

One-Click Deployment with Zeabur (Highly Recommended)

Click the button for one-click deployment, default duckduckgo search, can be switched on your own

Deploy on Zeabur

To keep the project updated, it is recommended to fork this repository first, then deploy your branch through Zeabur

Deployed on Zeabur

Local Deployment

  1. Clone the repository locally
git clone https://github.com/fatwang2/search2ai
  1. Copy .env.template as .env, configure environment variables
  • SEARCH_SERVICE: Currently supports google, bing, serpapi, serper, duckduckgo (recommended), required
  • APIBASE: If you are using an OpenAI third-party proxy, you can fill it in here, note that v1 is not needed, not required
  • BING_KEY: Required if choosing bing search, please search for tutorials, application address https://search2ai.online/bing
  • GOOGLE_CX: Required if choosing Google search, Search engine ID, please search for tutorials, application address https://search2ai.online/googlecx
  • GOOGLE_KEY: Required if choosing Google search, API key, application address https://search2ai.online/googlekey
  • SERPAPI_KEY: Required if choosing serpapi, free 100 times/month, registration address https://search2ai.online/serpapi
  • SERPER_KEY: Required if choosing serper, free 2500 times for 6 months, note variable name is different from above, registration address https://search2ai.online/serper
  1. Enter the api directory, run the program, and display the log in real-time
cd api && nohup node index.js > output.log 2>&1 & tail -f output.log
  1. Port 3014, the complete address after concatenation is as follows, can be configured according to the client's requirements for the apibase address (if https is required, need to use nginx for reverse proxy, many tutorials online)
http://localhost:3014/v1/chat/completions

Deployment with cloudflare worker

  1. Copy the code of search2ai, no modifications needed! Deploy in cloudflare's worker, after going online, the worker's address can be used as your interface call's custom domain address, note the concatenation, worker address only represents the part before v1 XXX/v1/chat/completions

  2. Configure variables in the worker Effect Example

  • SEARCH_SERVICE: Currently supports google, bing, serpapi, serper, duckduckgo, required
  • APIBASE: If you are using an OpenAI third-party proxy, you can fill it in here, note that v1 is not needed, not required
  • BING_KEY: Required if choosing bing search, please search for tutorials, application address https://search2ai.online/bing
  • GOOGLE_CX: Required if choosing Google search, Search engine ID, please search for tutorials, application address https://search2ai.online/googlecx
  • GOOGLE_KEY: Required if choosing Google search, API key, application address https://search2ai.online/googlekey
  • SERPAPI_KEY: Required if choosing serpapi, free 100 times/month, registration address https://search2ai.online/serpapi
  • SERPER_KEY: Required if choosing serper, free 2500 times for 6 months, note variable name is different from above, registration address https://search2ai.online/serper
  1. Configure triggers - custom domain in the worker, direct access to the worker's address in China might have issues, need to replace with custom domain Alt text

Deployment with Vercel

Special note: Vercel project does not support streaming output and has a 10s response limit, actual user experience is poor, released mainly for experts to pull request

One-click deployment

Deploy with Vercel

To ensure updates, you can also first fork this project and then deploy it on Vercel yourself

Future Iterations

  • Support for Gemini
  • Support for Azure OpenAI
  • Fix streaming output issues in Vercel project
  • Improve the speed of streaming output
  • Support more vertical searches

Special Thanks