Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vincent-the-gamer/rust-baipiaogpt
Free chatting with GPT-3.5-Turbo
https://github.com/vincent-the-gamer/rust-baipiaogpt
Last synced: 5 days ago
JSON representation
Free chatting with GPT-3.5-Turbo
- Host: GitHub
- URL: https://github.com/vincent-the-gamer/rust-baipiaogpt
- Owner: Vincent-the-gamer
- Created: 2023-06-24T09:47:54.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-03T05:50:17.000Z (about 1 year ago)
- Last Synced: 2023-10-03T16:15:54.579Z (about 1 year ago)
- Language: Rust
- Homepage: https://vincent-the-gamer.github.io/baipiaogpt-wasm-page/
- Size: 14 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Rust-BaipiaoGPT
Free chatting with gpt-3.5-turbo.
## Notice
This chat backend is no longer supporting context now due to some reason.## WebAssembly web page
[https://vincent-the-gamer.github.io/baipiaogpt-wasm-page/](https://vincent-the-gamer.github.io/baipiaogpt-wasm-page/)
### Build webpage from source code
~~~shell
cd webpage
trunk build --release
~~~
Open webpage to chat with AI.`WebAssembly` page has no backend server.
So we can directly deploy it on `GitHub Pages`.
~~~shell
# deploy to GitHub Pages
trunk build --release --public-url /your-github-repo-name/
~~~## Use core as http service
~~~shell
cd server
cargo build --release
~~~### Features
* multi-platform
* dynamic port binding
* cross origin
* WebAssembly### Usage
#### Run at default port:
Default Port: 8080
~~~shell
# darwin/linux
./rust-baipiaogpt # use your file name!!!!# windows
rust-baipiaogpt.exe # use your file name!!!!
~~~#### Run at custom port:
~~~shell
# darwin/linux
./rust-baipiaogpt 2333 # use your file name!!!!# windows
rust-baipiaogpt.exe 2333 # use your file name!!!!
~~~#### APIs
| URL | Method | Description |
| :---------------- | -------- | -------------------------------------------------------- |
| /chat | post | Return the response of AI, save contexts in an array |
| /clearContext | get | Clear context |
| /showContextCount | get | Get count of current contexts |
| /regenerate | get | Remove latest question and answer, re-ask the latest question to get new answer |##### API Parameters
Only `/chat` has parameter:you need to give a request body(json):
~~~typescript
{
content: "your question"
}// request example using axios
axios.post("/chat",{
content: ""
}).then(res => {
console.log(res.data)
})
~~~For any other API:
~~~typescript
axios.get("/xxx").then(res => {
console.log(res.data)
})
~~~##### API Test
You can use `Postman` , `ApiPost` or any api debug tool to test the APIs![ApiPost](./.github/apipost.png)