Skip to content

Commit b4ec3f7

Browse files
committed
docs(README): reorganize and update installation steps
- Combine global and local installation steps - Update supported generator list - Fix ERNIE Bot to ERNIE
1 parent 28a9668 commit b4ec3f7

File tree

4 files changed

+40
-56
lines changed

4 files changed

+40
-56
lines changed

.phpstorm.meta.php

+2-10
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
use Illuminate\Bus\Dispatcher;
1616
use Illuminate\Config\Repository;
17+
use Illuminate\Container\Container as IlluminateContainer;
1718
use Illuminate\Contracts\Container\Container;
1819
use Illuminate\Database\DatabaseManager;
1920
use Illuminate\Support\Arr;
@@ -28,42 +29,34 @@
2829
'view.finder' => FileViewFinder::class,
2930
'config' => Repository::class,
3031
]));
31-
32-
override((new \Illuminate\Container\Container())->makeWith(0), map([
32+
override((new IlluminateContainer())->makeWith(0), map([
3333
'' => '@',
3434
'config' => Repository::class,
3535
]));
36-
3736
override((new Container())->get(0), map([
3837
'' => '@',
3938
'config' => Repository::class,
4039
]));
41-
4240
override((new Container())->make(0), map([
4341
'' => '@',
4442
'config' => Repository::class,
4543
]));
46-
4744
override(Container::makeWith(0), map([
4845
'' => '@',
4946
'config' => Repository::class,
5047
]));
51-
5248
override(\App::get(0), map([
5349
'' => '@',
5450
'config' => Repository::class,
5551
]));
56-
5752
override(\App::make(0), map([
5853
'' => '@',
5954
'config' => Repository::class,
6055
]));
61-
6256
override(\App::makeWith(0), map([
6357
'' => '@',
6458
'config' => Repository::class,
6559
]));
66-
6760
override(app(0), map([
6861
'' => '@',
6962
'config' => Repository::class,
@@ -72,7 +65,6 @@
7265
'' => '@',
7366
'config' => Repository::class,
7467
]));
75-
7668
override((new ContainerInterface())->get(0), map([
7769
'' => '@',
7870
'config' => Repository::class,

README-zh_CN.md

+7-11
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
## 支持
1818

19+
- [x] [Bito](https://github.com/gitbito/CLI)
1920
- [x] [OpenAI Chat](https://platform.openai.com/docs/api-reference/chat)
2021
- [x] [OpenAI](https://platform.openai.com/docs/api-reference/completions)
21-
- [x] [Bito](https://github.com/gitbito/CLI)
22-
- [ ] [ERNIE Bot](https://yiyan.baidu.com/welcome)
22+
- [ ] [ERNIE](https://yiyan.baidu.com/welcome)
2323
- [ ] ...
2424

2525
## 环境要求
@@ -38,24 +38,20 @@ chmod +x ai-commit
3838
### 通过 Composer 安装
3939

4040
```shell
41-
# 全局
42-
composer global require guanguans/ai-commit --dev -v
43-
44-
# 本地
45-
composer require guanguans/ai-commit --dev -v
41+
composer global require guanguans/ai-commit --dev -v # 全局
42+
composer require guanguans/ai-commit --dev -v # 本地
4643
```
4744

4845
## 使用
4946

5047
### 快速开始
5148

5249
```shell
53-
./ai-commit config set generators.openaichat.api_key sk-... --global # 配置 OpenAI API key
54-
./ai-commit config set generators.openai.api_key sk-... --global # 配置 OpenAI API key
5550
./ai-commit config set generators.bito.path bito-path... --global # 配置 Bito 路径(可选)
51+
./ai-commit config set generators.openai.api_key sk-... --global # 配置 OpenAI API key
52+
./ai-commit config set generators.openaichat.api_key sk-... --global # 配置 OpenAI API key
5653

57-
# 生成且提交信息
58-
./ai-commit commit
54+
./ai-commit commit # 生成且提交信息
5955
```
6056

6157
```shell

README.md

+7-11
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
## Support
1818

19+
- [x] [Bito](https://github.com/gitbito/CLI)
1920
- [x] [OpenAI Chat](https://platform.openai.com/docs/api-reference/chat)
2021
- [x] [OpenAI](https://platform.openai.com/docs/api-reference/completions)
21-
- [x] [Bito](https://github.com/gitbito/CLI)
22-
- [ ] [ERNIE Bot](https://yiyan.baidu.com/welcome)
22+
- [ ] [ERNIE](https://yiyan.baidu.com/welcome)
2323
- [ ] ...
2424

2525
## Requirement
@@ -38,24 +38,20 @@ chmod +x ai-commit
3838
### Install via Composer
3939

4040
```shell
41-
# global
42-
composer global require guanguans/ai-commit --dev -v
43-
44-
# local
45-
composer require guanguans/ai-commit --dev -v
41+
composer global require guanguans/ai-commit --dev -v # global
42+
composer require guanguans/ai-commit --dev -v # local
4643
```
4744

4845
## Usage
4946

5047
### Quick start
5148

5249
```shell
53-
./ai-commit config set generators.openaichat.api_key sk-... --global # Config OpenAI API key
54-
./ai-commit config set generators.openai.api_key sk-... --global # Config OpenAI API key
5550
./ai-commit config set generators.bito.path bito-path... --global # Config Bito path(Optional)
51+
./ai-commit config set generators.openai.api_key sk-... --global # Config OpenAI API key
52+
./ai-commit config set generators.openaichat.api_key sk-... --global # Config OpenAI API key
5653

57-
# Generate and commit message
58-
./ai-commit commit
54+
./ai-commit commit # Generate and commit message
5955
```
6056

6157
```shell

config/ai-commit.php

+24-24
Original file line numberDiff line numberDiff line change
@@ -56,60 +56,60 @@
5656

5757
// The list of generators.
5858
'generators' => [
59-
'openaichat' => [
60-
'driver' => 'openai',
61-
'http_options' => [
62-
// guzzlehttp\requestoptions::proxy => 'https://proxy.com/v1',
59+
'bito' => [
60+
'driver' => 'bito',
61+
'path' => null,
62+
'prompt_filename' => 'bito.prompt',
63+
'parameters' => [
64+
'cwd' => null,
65+
'env' => null,
66+
'input' => null,
67+
'timeout' => 120,
6368
],
69+
],
70+
'openai' => [
71+
'driver' => 'openai',
6472
'api_key' => env('OPENAI_API_KEY', 'sk-...'),
6573
'parameters' => [
66-
'model' => 'gpt-3.5-turbo', // 'gpt-4,gpt-4-0613,gpt-4-32k,gpt-4-32k-0613,gpt-3.5-turbo,gpt-3.5-turbo-0613,gpt-3.5-turbo-16k,gpt-3.5-turbo-16k-0613
67-
// 'messages' => 'required|array',
74+
'model' => 'text-davinci-003', // text-davinci-003,text-davinci-002,text-curie-001,text-babbage-001,text-ada-001
75+
// 'prompt' => 'string|array',
76+
'suffix' => null,
6877
'max_tokens' => 600,
6978
'temperature' => 0.0,
7079
'top_p' => 1.0,
7180
'n' => 1,
7281
'stream' => true,
82+
'logprobs' => null,
83+
'echo' => false,
7384
'stop' => null,
7485
'presence_penalty' => 0,
7586
'frequency_penalty' => 0,
87+
'best_of' => 1,
7688
// 'logit_bias' => null,
7789
'user' => Illuminate\Support\Str::uuid()->toString(),
7890
],
7991
],
80-
'openai' => [
92+
'openaichat' => [
8193
'driver' => 'openai',
94+
'http_options' => [
95+
// guzzlehttp\requestoptions::proxy => 'https://proxy.com/v1',
96+
],
8297
'api_key' => env('OPENAI_API_KEY', 'sk-...'),
8398
'parameters' => [
84-
'model' => 'text-davinci-003', // text-davinci-003,text-davinci-002,text-curie-001,text-babbage-001,text-ada-001
85-
// 'prompt' => 'string|array',
86-
'suffix' => null,
99+
'model' => 'gpt-3.5-turbo', // 'gpt-4,gpt-4-0613,gpt-4-32k,gpt-4-32k-0613,gpt-3.5-turbo,gpt-3.5-turbo-0613,gpt-3.5-turbo-16k,gpt-3.5-turbo-16k-0613
100+
// 'messages' => 'required|array',
87101
'max_tokens' => 600,
88102
'temperature' => 0.0,
89103
'top_p' => 1.0,
90104
'n' => 1,
91105
'stream' => true,
92-
'logprobs' => null,
93-
'echo' => false,
94106
'stop' => null,
95107
'presence_penalty' => 0,
96108
'frequency_penalty' => 0,
97-
'best_of' => 1,
98109
// 'logit_bias' => null,
99110
'user' => Illuminate\Support\Str::uuid()->toString(),
100111
],
101112
],
102-
'bito' => [
103-
'driver' => 'bito',
104-
'path' => null,
105-
'prompt_filename' => 'bito.prompt',
106-
'parameters' => [
107-
'cwd' => null,
108-
'env' => null,
109-
'input' => null,
110-
'timeout' => 120,
111-
],
112-
],
113113
],
114114

115115
/**

0 commit comments

Comments
 (0)