chatgpt-prompt-wrapper


Namechatgpt-prompt-wrapper JSON
Version 0.0.16 PyPI version JSON
download
home_pagehttps://github.com/rcmdnk/chatgpt-prompt-wrapper
SummaryCLI tool to wrap ChatGPT Python API.
upload_time2023-09-23 15:31:47
maintainer
docs_urlNone
authorrcmdnk
requires_python>=3.9,<3.12
licenseApache-2.0
keywords chat gpt openai cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # chatgpt-prompt-wrapper

[![test](https://github.com/rcmdnk/chatgpt-prompt-wrapper/actions/workflows/test.yml/badge.svg)](https://github.com/rcmdnk/chatgpt-prompt-wrapper/actions/workflows/test.yml)
[![test coverage](https://img.shields.io/badge/coverage-check%20here-blue.svg)](https://github.com/rcmdnk/chatgpt-prompt-wrapper/tree/coverage)

Python CLI implementation for [ChatGPT](https://openai.com/blog/chatgpt).

## Requirements

- Python 3.9, 3.10, 3.11

## Installation

By Homebrew:

```
$ brew install rcmdnk/rcmdnkpac/chatgpt-prompt-wrapper
```

By pip:

```
$ pip3 install chatgpt-prompt-wrapper
```

## Preparation

To get an OpenAI API key, go to [Account API Keys - OpenAI API](https://platform.openai.com/account/api-keys).

Set it as the environment variable `OPENAI_API_KEY`.

To load the variable when you start the terminal, write it in **.bashrc** or **.zshrc**.

```
export OPENAI_API_KEY="sk-..."
```

Alternatively, pass the key using the '-k' or '--key' argument in the command.

## Usage

### Command-line interface Help

```
$ cg help
usage: cg [-h] [-k KEY] [-c CONF] [-m MODEL] [-t MAX_TOKENS] [-T MIN_MAX_TOKENS] [-l TOKENS_LIMIT] [--show] [--hide] [--multiline]
          [--no_multiline] [--vi] [--emacs] [--show_cost]
          subcommand [message ...]

positional arguments:
  subcommand            Subcommand to run. Use 'commands' subcommand to list up available subcommands.
  message               Message to send to ChatGPT

optional arguments:
  -h, --help            show this help message and exit
  -k KEY, --key KEY     OpenAI API key.
  -c CONF, --conf CONF  Path to the configuration toml file.
  -m MODEL, --model MODEL
                        ChatGPT Model to use.
  -t MAX_TOKENS, --max_tokens MAX_TOKENS
                        The maximum number of tokens to generate in the chat completion. Set 0 to use the max values for the model
                        minus prompt tokens.
  -T MIN_MAX_TOKENS, --min_max_tokens MIN_MAX_TOKENS
                        The minimum of max_tokens for the completion when max_tokens = 0.
  -l TOKENS_LIMIT, --tokens_limit TOKENS_LIMIT
                        The limit of the total tokens of the prompt and the completion. Set 0 to use the max values for the model.
  --show                Show prompt for ask command.
  --hide                Hide prompt for ask command.
  --multiline           Use multiline input for chat command.
  --no_multiline        Use single line input for chat command.
  --vi                  Use vi mode at chat.
  --emacs               Use emacs mode at chat.
  --show_cost           Show cost used.
```

```

$ cg commands
Available subcommands:
  Reserved commands:
    ask       : Ask w/o predefined prompt.
    chat      : Start chat w/o predefined prompt.
    discuss   : Start a discussion between GPTs. Give a them as a message.
    init      : Initialize config file with an example command.
    cost      : Show estimated cost used until now.
    commands  : List up subcommands (show this).
    version   : Show version.
    help      : Show help.
  User commands:
    test      : Example command to test the OpenAI API.
    ...
```

### Ask, Chat

`ask` and `chat` are reserved commands for running simple interaction without a predefined prompt.

- `ask`

`cg ask <message>` returns the answer from ChatGPT for `message`.

- `chat`

`cg chat` starts a chat.

:memo: In `chat` mode, all messages in the past, including answers from
ChatGPT, will be sent each time you send a new message.

The oldest message will be dropped when the total tokens (including the reserved tokens for the completion defined by `max_tokens` or `min_max_tokens`) exceeds the tokens limit (`tokens_limit` or the number of max tokens (-1) for the used model).

It means you will send almost the max length after a long conversation.
Please keep the cost in mind. You may want to set `tokens_limit`.

### Discuss

`discuss` is another reserved command which start a discussion between two ChatGPTs.

Two GPTs are ask to perform as:

- Please engage in the discussion as a supporter.
- Please engage in the discussion as a opponent.

You input message will be a message and they start a discussion.

Please push `Enter` to proceed a duscussion and `Ctrl-C` to quit a discussion.

### Configuration file

You can define your command in the configuration files.

A command can be in either `ask` mode, `chat` mode or `discuss` mode.

- `ask` mode: Send a predefined prompt and a message from the command line and receive one answer.
- `chat` mode: Start a chat with a predefined prompt if defined:
  - `chat` mode can be either `multiline` or single (`no_multiline`), and `vim` or `emacs`.
- `discuss` mode: Start a discussion between two different ChatGPTs.

#### File path

The default path to the configuration file is **$XDG_CONFIG_HOME/cg/config.toml**.

If **$XDG_CONFIG_HOME** is not defined, use **~/.config/cg/config.toml**.

If it does not exist and **~/.cg/config.toml** exists,
the existing file is used.

You can change the path by `-c <file>` (`--conf <file>`) option.

#### How to write the configuration file

The configuration file is written in the [TOML format](https://toml.io/en/).

You can define a command as the top table name.

`global` is the special table to define global options,
which are enabled for all commands if the command does not have the corresponding options.

The options for each table can be:

- `description`: Description of the command.
- `mode`: Set `ask`, `chat` or `discuss`. (default is `ask` mode.)
- `show_cost`: Set `true` to show the cost at the end of the command.
- `model`: The model to use (default: "gpt-3.5-turbo").
- `max_tokens`: The maximum number of tokens to generate in the chat completion. Set 0 to use the maximum values for the model. (default: 0)
- `min_max_tokens`: The minimum of `max_tokens` for the completion when `max_tokens = 0`. (default: 200)
- `tokens_limit`: The limit of the total tokens of the prompt and the completion. Set 0 to use the maximum values for the model. (default: 0)
- `temperature`: Sampling temperature (0 ~ 2). (default: 1)
- `top_p`: Probability (0 ~ 1) that the model will consider the top_p tokens. Do not set both temperature and top_p at the same time. (default: 1)
- `presence_penalty`: The penalty for the model to return the same token (-2 ~ 2). (default: 0)
- `frequency_penalty`: The penalty for the model to return the same token multiple times (-2 ~ 2). (default: 0)
- Table of `alias`: Dictionary of role aliases. The default alias is: '`user' = 'User'`, `'system' = 'System'`, `'assistant' = 'Assistant'`.
- `model_max_tokens`: Additional or updated model's max_token definitions.
- `price`: Additional or updated model's price definitions.
- List of `messages`: Dictionary of message, which must have `role` and `content` (message text).
  - For `ask`, `chat` modes, `role` must be one of `system`, `user` and `assistant`
  - For `discuss` mode, three roles, `theme`, `gpt1` and `gpt2` are needed.

The options for ask mode:

- `show`: Set `true` to show prompt for non chat command.
- `hide`: Set `true` to hide prompt for non chat command (default).

The options for chat mode:

- `multiline`: Set `true` to hide prompt for non chat command.
- `no_multiline`: Set `true` to hide prompt for non chat command (default).
- `vi`: Set `true` to use vi mode.
- `emacs`: Set `true` to use emacs mode (default).

You can make a example configuration file by `cg init`.

Here is a example configuration:

```toml
[global]
# Global configuration
# `global` is special name and not a subcommand
model = 'gpt-3.5-turbo'

# Following model_max_tokens and prices are pre-defined in
# https://github.com/rcmdnk/chatgpt-prompt-wrapper/blob/main/src/chatgpt_prompt_wrapper/chatgpt/chatgpt.py
# If you find new model or price change, you can overwrite these variables in config as below.

[global.model_max_tokens]
"gpt-3.5-turbo-16k" = 16384

[global.prices]
"gpt-3.5-turbo-16k" = [0.003, 0.004]

[test]
# Example command to test the OpenAI API, taken from below.
# [Chat completion - OpenAI API](https://platform.openai.com/docs/guides/chat/introduction)

description = "Example command to test the OpenAI API."
show = true

[[test.messages]]
role = "system"
content = "You are a helpful assistant."
[[test.messages]]
role = "user"
content = "Who won the world series in 2020?"
[[test.messages]]
role = "assistant"
"content" = "The Los Angeles Dodgers won the World Series in 2020."
[[test.messages]]
role = "user"
content = "Where was it played?"

[sh]
description = "Ask a shell scripting question."
[[sh.messages]]
role = "user"
content = "You are an expert of the shell scripting. Answer the following questions."

[py]
description = "Ask a python programming question."
[[py.messages]]
role = "user"
content = "You are an expert python programmer. Answer the following questions."

[enjoy_chat]
description = "Chat example with a predefined prompt."
mode = 'chat'
[[chat.messages]]
role = "user"
content = "Let's enjoy a chat."


[dd]
mode = 'discuss'

[dd.names]
gpt1 = "pros"
gpt2 = "cons"

[[dd.messages]]
role = "theme"
content = "Discuss whether or not to actively adopt ChatGPT in the education field. Please provide one-sentence responses."
[[dd.messages]]
role = "gpt1"
content = "Please speak from the standpoint that you should actively adopt ChatGPT in the field of education."
[[dd.messages]]
role = "gpt2"
content = "Please speak from the standpoint that you should not actively adopt ChatGPT in the field of education."
```

These messages will be sent as an prompt before your input message.

You can give full questions and use `cg` w/o input messages like a first example `test` command.

Command examples:

- test

![test command](https://raw.githubusercontent.com/rcmdnk/chatgpt-prompt-wrapper/main/fig/cg_test.png)

- sh

![sh command](https://raw.githubusercontent.com/rcmdnk/chatgpt-prompt-wrapper/main/fig/cg_sh.png)

- py

![py command](https://raw.githubusercontent.com/rcmdnk/chatgpt-prompt-wrapper/main/fig/cg_py.png)

- enjoy_chat

![chat command](https://raw.githubusercontent.com/rcmdnk/chatgpt-prompt-wrapper/main/fig/cg_chat.gif)

## Example usage as a part of an external script

### Git commit by ChatGPT

See [git-gpt-commit](https://github.com/rcmdnk/git-gpt-commit).

## Development

### Poetry

Use [Poetry](https://python-poetry.org/) to setup environment.

To install poetry, run:

```
$ pip install poetry
```

or use `pipx` (`x` is `3` or anything of your python version).

Setup poetry environment:

```
$ poetry install
```

Then enter the environment:

```
$ poetry shell
```

## pre-commit

To check codes at the commit, use [pre-commit](https://pre-commit.com/).

`pre-commit` command will be installed in the poetry environment.

First, run:

```
$ pre-commit install
```

Then `pre-commit` will be run at the commit.

Sometimes, you may want to skip the check. In that case, run:

```
$ git commit --no-verify
```

You can run `pre-commit` on entire repository manually:

```
$ pre-commit run -a
```

### pytest

Tests are written with [pytest](https://docs.pytest.org/).

Write tests in **/tests** directory.

To run tests, run:

```
$ pytest
```

The default setting runs tests in parallel with `-n auto`.
If you run tests in serial, run:

```
$ pytest -n 0
```

## GitHub Actions

If you push a repository to GitHub, GitHub Actions will run a test job
by [GitHub Actions](https://github.co.jp/features/actions).

The job runs at the Pull Request, too.

It checks codes with `pre-commit` and runs tests with `pytest`.
It also makes a test coverage report and uploads it to [the coverage branch](https://github.com/rcmdnk/chatgpt-prompt-wrapper/tree/coverage).

You can see the test status as a badge in the README.

### Renovate

If you want to update dependencies automatically, [install Renovate into your repository](https://docs.renovatebot.com/getting-started/installing-onboarding/).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rcmdnk/chatgpt-prompt-wrapper",
    "name": "chatgpt-prompt-wrapper",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<3.12",
    "maintainer_email": "",
    "keywords": "chat,gpt,openai,cli",
    "author": "rcmdnk",
    "author_email": "rcmdnk@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/73/0e/b4aa3f34724252d8cce4eac0780a34d8ae422c2480ad3dc99e105b179ba8/chatgpt_prompt_wrapper-0.0.16.tar.gz",
    "platform": null,
    "description": "# chatgpt-prompt-wrapper\n\n[![test](https://github.com/rcmdnk/chatgpt-prompt-wrapper/actions/workflows/test.yml/badge.svg)](https://github.com/rcmdnk/chatgpt-prompt-wrapper/actions/workflows/test.yml)\n[![test coverage](https://img.shields.io/badge/coverage-check%20here-blue.svg)](https://github.com/rcmdnk/chatgpt-prompt-wrapper/tree/coverage)\n\nPython CLI implementation for [ChatGPT](https://openai.com/blog/chatgpt).\n\n## Requirements\n\n- Python 3.9, 3.10, 3.11\n\n## Installation\n\nBy Homebrew:\n\n```\n$ brew install rcmdnk/rcmdnkpac/chatgpt-prompt-wrapper\n```\n\nBy pip:\n\n```\n$ pip3 install chatgpt-prompt-wrapper\n```\n\n## Preparation\n\nTo get an OpenAI API key, go to [Account API Keys - OpenAI API](https://platform.openai.com/account/api-keys).\n\nSet it as the environment variable `OPENAI_API_KEY`.\n\nTo load the variable when you start the terminal, write it in **.bashrc** or **.zshrc**.\n\n```\nexport OPENAI_API_KEY=\"sk-...\"\n```\n\nAlternatively, pass the key using the '-k' or '--key' argument in the command.\n\n## Usage\n\n### Command-line interface Help\n\n```\n$ cg help\nusage: cg [-h] [-k KEY] [-c CONF] [-m MODEL] [-t MAX_TOKENS] [-T MIN_MAX_TOKENS] [-l TOKENS_LIMIT] [--show] [--hide] [--multiline]\n          [--no_multiline] [--vi] [--emacs] [--show_cost]\n          subcommand [message ...]\n\npositional arguments:\n  subcommand            Subcommand to run. Use 'commands' subcommand to list up available subcommands.\n  message               Message to send to ChatGPT\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -k KEY, --key KEY     OpenAI API key.\n  -c CONF, --conf CONF  Path to the configuration toml file.\n  -m MODEL, --model MODEL\n                        ChatGPT Model to use.\n  -t MAX_TOKENS, --max_tokens MAX_TOKENS\n                        The maximum number of tokens to generate in the chat completion. Set 0 to use the max values for the model\n                        minus prompt tokens.\n  -T MIN_MAX_TOKENS, --min_max_tokens MIN_MAX_TOKENS\n                        The minimum of max_tokens for the completion when max_tokens = 0.\n  -l TOKENS_LIMIT, --tokens_limit TOKENS_LIMIT\n                        The limit of the total tokens of the prompt and the completion. Set 0 to use the max values for the model.\n  --show                Show prompt for ask command.\n  --hide                Hide prompt for ask command.\n  --multiline           Use multiline input for chat command.\n  --no_multiline        Use single line input for chat command.\n  --vi                  Use vi mode at chat.\n  --emacs               Use emacs mode at chat.\n  --show_cost           Show cost used.\n```\n\n```\n\n$ cg commands\nAvailable subcommands:\n  Reserved commands:\n    ask       : Ask w/o predefined prompt.\n    chat      : Start chat w/o predefined prompt.\n    discuss   : Start a discussion between GPTs. Give a them as a message.\n    init      : Initialize config file with an example command.\n    cost      : Show estimated cost used until now.\n    commands  : List up subcommands (show this).\n    version   : Show version.\n    help      : Show help.\n  User commands:\n    test      : Example command to test the OpenAI API.\n    ...\n```\n\n### Ask, Chat\n\n`ask` and `chat` are reserved commands for running simple interaction without a predefined prompt.\n\n- `ask`\n\n`cg ask <message>` returns the answer from ChatGPT for `message`.\n\n- `chat`\n\n`cg chat` starts a chat.\n\n:memo: In `chat` mode, all messages in the past, including answers from\nChatGPT, will be sent each time you send a new message.\n\nThe oldest message will be dropped when the total tokens (including the reserved tokens for the completion defined by `max_tokens` or `min_max_tokens`) exceeds the tokens limit (`tokens_limit` or the number of max tokens (-1) for the used model).\n\nIt means you will send almost the max length after a long conversation.\nPlease keep the cost in mind. You may want to set `tokens_limit`.\n\n### Discuss\n\n`discuss` is another reserved command which start a discussion between two ChatGPTs.\n\nTwo GPTs are ask to perform as:\n\n- Please engage in the discussion as a supporter.\n- Please engage in the discussion as a opponent.\n\nYou input message will be a message and they start a discussion.\n\nPlease push `Enter` to proceed a duscussion and `Ctrl-C` to quit a discussion.\n\n### Configuration file\n\nYou can define your command in the configuration files.\n\nA command can be in either `ask` mode, `chat` mode or `discuss` mode.\n\n- `ask` mode: Send a predefined prompt and a message from the command line and receive one answer.\n- `chat` mode: Start a chat with a predefined prompt if defined:\n  - `chat` mode can be either `multiline` or single (`no_multiline`), and `vim` or `emacs`.\n- `discuss` mode: Start a discussion between two different ChatGPTs.\n\n#### File path\n\nThe default path to the configuration file is **$XDG_CONFIG_HOME/cg/config.toml**.\n\nIf **$XDG_CONFIG_HOME** is not defined, use **~/.config/cg/config.toml**.\n\nIf it does not exist and **~/.cg/config.toml** exists,\nthe existing file is used.\n\nYou can change the path by `-c <file>` (`--conf <file>`) option.\n\n#### How to write the configuration file\n\nThe configuration file is written in the [TOML format](https://toml.io/en/).\n\nYou can define a command as the top table name.\n\n`global` is the special table to define global options,\nwhich are enabled for all commands if the command does not have the corresponding options.\n\nThe options for each table can be:\n\n- `description`: Description of the command.\n- `mode`: Set `ask`, `chat` or `discuss`. (default is `ask` mode.)\n- `show_cost`: Set `true` to show the cost at the end of the command.\n- `model`: The model to use (default: \"gpt-3.5-turbo\").\n- `max_tokens`: The maximum number of tokens to generate in the chat completion. Set 0 to use the maximum values for the model. (default: 0)\n- `min_max_tokens`: The minimum of `max_tokens` for the completion when `max_tokens = 0`. (default: 200)\n- `tokens_limit`: The limit of the total tokens of the prompt and the completion. Set 0 to use the maximum values for the model. (default: 0)\n- `temperature`: Sampling temperature (0 ~ 2). (default: 1)\n- `top_p`: Probability (0 ~ 1) that the model will consider the top_p tokens. Do not set both temperature and top_p at the same time. (default: 1)\n- `presence_penalty`: The penalty for the model to return the same token (-2 ~ 2). (default: 0)\n- `frequency_penalty`: The penalty for the model to return the same token multiple times (-2 ~ 2). (default: 0)\n- Table of `alias`: Dictionary of role aliases. The default alias is: '`user' = 'User'`, `'system' = 'System'`, `'assistant' = 'Assistant'`.\n- `model_max_tokens`: Additional or updated model's max_token definitions.\n- `price`: Additional or updated model's price definitions.\n- List of `messages`: Dictionary of message, which must have `role` and `content` (message text).\n  - For `ask`, `chat` modes, `role` must be one of `system`, `user` and `assistant`\n  - For `discuss` mode, three roles, `theme`, `gpt1` and `gpt2` are needed.\n\nThe options for ask mode:\n\n- `show`: Set `true` to show prompt for non chat command.\n- `hide`: Set `true` to hide prompt for non chat command (default).\n\nThe options for chat mode:\n\n- `multiline`: Set `true` to hide prompt for non chat command.\n- `no_multiline`: Set `true` to hide prompt for non chat command (default).\n- `vi`: Set `true` to use vi mode.\n- `emacs`: Set `true` to use emacs mode (default).\n\nYou can make a example configuration file by `cg init`.\n\nHere is a example configuration:\n\n```toml\n[global]\n# Global configuration\n# `global` is special name and not a subcommand\nmodel = 'gpt-3.5-turbo'\n\n# Following model_max_tokens and prices are pre-defined in\n# https://github.com/rcmdnk/chatgpt-prompt-wrapper/blob/main/src/chatgpt_prompt_wrapper/chatgpt/chatgpt.py\n# If you find new model or price change, you can overwrite these variables in config as below.\n\n[global.model_max_tokens]\n\"gpt-3.5-turbo-16k\" = 16384\n\n[global.prices]\n\"gpt-3.5-turbo-16k\" = [0.003, 0.004]\n\n[test]\n# Example command to test the OpenAI API, taken from below.\n# [Chat completion - OpenAI API](https://platform.openai.com/docs/guides/chat/introduction)\n\ndescription = \"Example command to test the OpenAI API.\"\nshow = true\n\n[[test.messages]]\nrole = \"system\"\ncontent = \"You are a helpful assistant.\"\n[[test.messages]]\nrole = \"user\"\ncontent = \"Who won the world series in 2020?\"\n[[test.messages]]\nrole = \"assistant\"\n\"content\" = \"The Los Angeles Dodgers won the World Series in 2020.\"\n[[test.messages]]\nrole = \"user\"\ncontent = \"Where was it played?\"\n\n[sh]\ndescription = \"Ask a shell scripting question.\"\n[[sh.messages]]\nrole = \"user\"\ncontent = \"You are an expert of the shell scripting. Answer the following questions.\"\n\n[py]\ndescription = \"Ask a python programming question.\"\n[[py.messages]]\nrole = \"user\"\ncontent = \"You are an expert python programmer. Answer the following questions.\"\n\n[enjoy_chat]\ndescription = \"Chat example with a predefined prompt.\"\nmode = 'chat'\n[[chat.messages]]\nrole = \"user\"\ncontent = \"Let's enjoy a chat.\"\n\n\n[dd]\nmode = 'discuss'\n\n[dd.names]\ngpt1 = \"pros\"\ngpt2 = \"cons\"\n\n[[dd.messages]]\nrole = \"theme\"\ncontent = \"Discuss whether or not to actively adopt ChatGPT in the education field. Please provide one-sentence responses.\"\n[[dd.messages]]\nrole = \"gpt1\"\ncontent = \"Please speak from the standpoint that you should actively adopt ChatGPT in the field of education.\"\n[[dd.messages]]\nrole = \"gpt2\"\ncontent = \"Please speak from the standpoint that you should not actively adopt ChatGPT in the field of education.\"\n```\n\nThese messages will be sent as an prompt before your input message.\n\nYou can give full questions and use `cg` w/o input messages like a first example `test` command.\n\nCommand examples:\n\n- test\n\n![test command](https://raw.githubusercontent.com/rcmdnk/chatgpt-prompt-wrapper/main/fig/cg_test.png)\n\n- sh\n\n![sh command](https://raw.githubusercontent.com/rcmdnk/chatgpt-prompt-wrapper/main/fig/cg_sh.png)\n\n- py\n\n![py command](https://raw.githubusercontent.com/rcmdnk/chatgpt-prompt-wrapper/main/fig/cg_py.png)\n\n- enjoy_chat\n\n![chat command](https://raw.githubusercontent.com/rcmdnk/chatgpt-prompt-wrapper/main/fig/cg_chat.gif)\n\n## Example usage as a part of an external script\n\n### Git commit by ChatGPT\n\nSee [git-gpt-commit](https://github.com/rcmdnk/git-gpt-commit).\n\n## Development\n\n### Poetry\n\nUse [Poetry](https://python-poetry.org/) to setup environment.\n\nTo install poetry, run:\n\n```\n$ pip install poetry\n```\n\nor use `pipx` (`x` is `3` or anything of your python version).\n\nSetup poetry environment:\n\n```\n$ poetry install\n```\n\nThen enter the environment:\n\n```\n$ poetry shell\n```\n\n## pre-commit\n\nTo check codes at the commit, use [pre-commit](https://pre-commit.com/).\n\n`pre-commit` command will be installed in the poetry environment.\n\nFirst, run:\n\n```\n$ pre-commit install\n```\n\nThen `pre-commit` will be run at the commit.\n\nSometimes, you may want to skip the check. In that case, run:\n\n```\n$ git commit --no-verify\n```\n\nYou can run `pre-commit` on entire repository manually:\n\n```\n$ pre-commit run -a\n```\n\n### pytest\n\nTests are written with [pytest](https://docs.pytest.org/).\n\nWrite tests in **/tests** directory.\n\nTo run tests, run:\n\n```\n$ pytest\n```\n\nThe default setting runs tests in parallel with `-n auto`.\nIf you run tests in serial, run:\n\n```\n$ pytest -n 0\n```\n\n## GitHub Actions\n\nIf you push a repository to GitHub, GitHub Actions will run a test job\nby [GitHub Actions](https://github.co.jp/features/actions).\n\nThe job runs at the Pull Request, too.\n\nIt checks codes with `pre-commit` and runs tests with `pytest`.\nIt also makes a test coverage report and uploads it to [the coverage branch](https://github.com/rcmdnk/chatgpt-prompt-wrapper/tree/coverage).\n\nYou can see the test status as a badge in the README.\n\n### Renovate\n\nIf you want to update dependencies automatically, [install Renovate into your repository](https://docs.renovatebot.com/getting-started/installing-onboarding/).\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "CLI tool to wrap ChatGPT Python API.",
    "version": "0.0.16",
    "project_urls": {
        "Homepage": "https://github.com/rcmdnk/chatgpt-prompt-wrapper",
        "Repository": "https://github.com/rcmdnk/chatgpt-prompt-wrapper"
    },
    "split_keywords": [
        "chat",
        "gpt",
        "openai",
        "cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "06a0c2e9e83b0e3785283419cf550f3bbe3ca35e9389f479fac7096670811d2e",
                "md5": "590f5a1aeb9e800593bca4c18093bb2a",
                "sha256": "54ac8734e71777cba30151eeb894b734a2ae0599906b6170ef0e573488d7594e"
            },
            "downloads": -1,
            "filename": "chatgpt_prompt_wrapper-0.0.16-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "590f5a1aeb9e800593bca4c18093bb2a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<3.12",
            "size": 26669,
            "upload_time": "2023-09-23T15:31:45",
            "upload_time_iso_8601": "2023-09-23T15:31:45.322226Z",
            "url": "https://files.pythonhosted.org/packages/06/a0/c2e9e83b0e3785283419cf550f3bbe3ca35e9389f479fac7096670811d2e/chatgpt_prompt_wrapper-0.0.16-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "730eb4aa3f34724252d8cce4eac0780a34d8ae422c2480ad3dc99e105b179ba8",
                "md5": "e4799bdfe49c776a166febc4afb49ce0",
                "sha256": "8b897a53b7d01f230ada2cc32f920e45c791d69cf1ff05f4d5dab2090f128db7"
            },
            "downloads": -1,
            "filename": "chatgpt_prompt_wrapper-0.0.16.tar.gz",
            "has_sig": false,
            "md5_digest": "e4799bdfe49c776a166febc4afb49ce0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<3.12",
            "size": 24227,
            "upload_time": "2023-09-23T15:31:47",
            "upload_time_iso_8601": "2023-09-23T15:31:47.459393Z",
            "url": "https://files.pythonhosted.org/packages/73/0e/b4aa3f34724252d8cce4eac0780a34d8ae422c2480ad3dc99e105b179ba8/chatgpt_prompt_wrapper-0.0.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-23 15:31:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rcmdnk",
    "github_project": "chatgpt-prompt-wrapper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "chatgpt-prompt-wrapper"
}
        
Elapsed time: 0.12514s