gptcli
1.0.0
ChatGptをコマンドラインに持ち込みます。
demo_config.jsonをconfig.jsonにコピーしますconfig.jsonに入れます$ ./gptcli.py -h
usage: gptcli.py [-h] [-c CONFIG]
options:
-h, --help show this help message and exit
-c CONFIG path to your config.json (default: config.json)サンプルconfig.json :
{
"api_key" : " sk-xxx " ,
"api_base" : " https://chat.pppan.net/v1 " ,
"model" : " gpt-3.5-turbo " ,
"context" : 2 ,
"stream" : true ,
"stream_render" : true ,
"showtokens" : false ,
"proxy" : " socks5://localhost:1080 " ,
"prompt" : [
{ "role" : " system " , "content" : " If your response contains code, show with syntax highlight, for example ```js n code n ``` " }
]
}gpt-3.5-turboです。選択肢は次のとおりです。api_baseへのリクエストにhttp/https/socks4a/socks5プロキシを使用します。コンソールヘルプ(タブコンプリート付き):
gptcli > .help -v
gptcli commands (use ' .help -v ' for verbose/ ' .help <topic> ' for details):
======================================================================================================
.edit Run a text editor and optionally open a file with it
.help List available commands or provide detailed help for a specific command
.load Load conversation from Markdown/JSON file
.multiline input multiple lines, end with ctrl-d(Linux/macOS) or ctrl-z(Windows). Cancel
with ctrl-c
.prompt Load different prompts
.quit Exit this application
.reset Reset session, i.e. clear chat history
.save Save current conversation to Markdown/JSON file
.set Set a settable parameter or show current settings of parameters
.usage Tokens usage of current session / last N days, or print detail billing infoDockerで実行:
# build
$ docker build -t gptcli:latest .
# run
$ docker run -it --rm -v $PWD /.key:/gptcli/.key gptcli:latest -h
# for host proxy access:
$ docker run --rm -it -v $PWD /config.json:/gptcli/config.json --network host gptcli:latest -c /gptcli/config.json.multilineコマンド経由) .save and .loadコマンド経由) llama_indexと統合して、ドキュメントでのチャットをサポートします