Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
reminia committed Nov 29, 2023
1 parent 4e8a611 commit ccb9926
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ A simple translate api that proxies to openai written by Golang.
* HTTP_PORT, port of the server, optional, default to 8080.

2. Build by `make build`.
3. Start server by `./translate`.
4. Use translate-cli by `./translate-cli -c "content" -l Chinese -m "gpt-3.5-turbo"`, -l and -m are optional.
translate-cli is an accompany of the server. It requires to setup TRANSLATE_ENDPOINT env var.
If not set, the endpoint is default to http://localhost:8080.
3. Start server by `./translate`. Try it with:
```bash
curl -X POST \
-d '{"content": "Hi, how are you?", "lang": "Chinese", "model": "gpt-3"}' \
http://localhost:8080/translate
```
4. translate-cli is a way to test translate endpoints. Start translate server first before using the cli tool.
Use it like `./translate-cli -c "content" -l "Chinese" -m "gpt-3.5-turbo"`, -l and -m are optional.
It requires to set TRANSLATE_ENDPOINT env var, it is http://localhost:8080 by default.

## Endpoints

Expand Down Expand Up @@ -50,4 +55,4 @@ Use the [image](https://github.com/reminia/translateit/pkgs/container/translatei

## Additional

Use the companion [translateit-btn](https://github.com/reminia/translateit-btn) with the api.
Use the companion [translateit-btn](https://github.com/reminia/translateit-btn) with the api.
2 changes: 1 addition & 1 deletion translate-cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
)

var endpoint string = os.Getenv("TRANSLATE_ENDPOINT")
var endpoint = os.Getenv("TRANSLATE_ENDPOINT")

func parseFlags() Ask {
var (
Expand Down

0 comments on commit ccb9926

Please sign in to comment.