Assitant built with ChatGPT!
- Clone the repo
git clone https://github.com/bjwswang/assistant
- Install dependencies
cd assistant
go mod tidy
- Set configuration in
assistant.json
see [Configurations](## Configurations) for more details
- Build the assistant server and CLI
make build
When build is done,you will get two binaries in bin
directory.
assistant
is the assistant serveracli
is the assistant CLI which can interact with the assistant server
- Start the assistant server
./bin/assistant --config assistant.json
- Test the assistant
curl -XGET http://localhost:9999
Output should be
Welcome to AI Assistant 👋!
Parameter | Description | Default |
---|---|---|
addr |
The address which assistant server will watch | :9999 |
assistant.api_key |
OpenAI api key | sk-xxx |
assistant.chat.xxx |
OpenAI model configuration for Chat |
model:gpt-3.5-turbo temperature:0.5 max_tokens:100 |
assistant.unit_test.xxx |
OpenAI model configuration for generating unit tests | model:gpt-3.5-turbo temperature:0.5 max_tokens:100 |
fiber.xxx |
Fiber related parameters | see the official document |
- Normal chat
- path:
/chat
- method:
post
- paramters:
question
: the question you want to chat with the assistant
- Generate unit test
- path:
/ut
- method:
post
- paramters:
code
: the code you want to used for generating unit tests
- Chat with assistant
./bin/acli --server http://localhost:9999 chat --question "What is AI assistant in 10 words?"
- Generate unit tests
./bin/acli --server http://localhost:9999 ut --file {filepath_to_source_code_}"
Welcom to contirbute to this AI assistant!