generated from childmindresearch/template-python-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes the version detection, renames to cloai (#6)
- Loading branch information
1 parent
3223dfa
commit d73d140
Showing
18 changed files
with
84 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
# CLI-OAI | ||
# CLI-cloai | ||
|
||
CLI-OAI is a Python command-line interface for interacting with the OpenAI API. It provides a set of commands to interact with various OpenAI services such as Speech-to-Text (STT), Text-to-Speech (TTS), and Image Generation. | ||
CLI-cloai is a Python command-line interface for interacting with the OpenAI API. It provides a set of commands to interact with various OpenAI services such as Speech-to-Text (STT), Text-to-Speech (TTS), and Image Generation. | ||
|
||
## Installation | ||
|
||
To install CLI-OAI, you can use the following command: | ||
To install CLI-cloai, you can use the following command: | ||
|
||
```sh | ||
poetry add git+https://github.com/cmi-dair/cli-oai | ||
poetry add git+https://github.com/cmi-dair/cli-cloai | ||
``` | ||
|
||
## Usage | ||
|
||
Before running CLI-OAI, make sure the environment variable `OPENAI_API_KEY` is set to your OpenAI API key. | ||
Before running CLI-cloai, make sure the environment variable `OPENAI_API_KEY` is set to your OpenAI API key. | ||
|
||
To use the CLI, run `oai --help` in your terminal. This will display a list of available commands and their descriptions. | ||
To use the CLI, run `cloai --help` in your terminal. This will display a list of available commands and their descriptions. | ||
|
||
Here is a brief overview of the main commands: | ||
|
||
- `oai stt <filename>`: Transcribes audio files with OpenAI's STT models. The `filename` argument is the file to transcribe. It can be any format that ffmpeg supports. Use the `--clip` option to clip the file if it is too large. | ||
- `cloai stt <filename>`: Transcribes audio files with OpenAI's STT models. The `filename` argument is the file to transcribe. It can be any format that ffmpeg supports. Use the `--clip` option to clip the file if it is too large. | ||
|
||
- `oai tts <text>`: Generates audio files with OpenAI's Text to Speech models. The `text` argument is the text to convert to speech. | ||
- `cloai tts <text>`: Generates audio files with OpenAI's Text to Speech models. The `text` argument is the text to convert to speech. | ||
|
||
- `oai image <prompt>`: Generates images with OpenAI's DALL-E. The `prompt` argument is the text prompt to generate the image from. | ||
- `cloai image <prompt>`: Generates images with OpenAI's DALL-E. The `prompt` argument is the text prompt to generate the image from. | ||
|
||
Each command has additional options that can be viewed by running `oai <command> --help`. | ||
Each command has additional options that can be viewed by running `cloai <command> --help`. | ||
|
||
## Contributing | ||
|
||
Contributions are welcome! Please see the [contributing guidelines](CONTRIBUTING.md) for more information. | ||
|
||
## License | ||
|
||
CLI-OAI is licensed under the terms of the [L-GPLv2.1 license](LICENSE). | ||
CLI-cloai is licensed under the terms of the [L-GPLv2.1 license](LICENSE). | ||
|
||
## Support | ||
|
||
If you encounter any issues or have any questions, please report them on our [issues page](https://github.com/cmi-dair/cli-oai/issues). | ||
If you encounter any issues or have any questions, please report them on our [issues page](https://github.com/cmi-dair/cli-cloai/issues). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,13 @@ requires = ["poetry-core"] | |
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry] | ||
name = "cmi-oai-cli" | ||
version = "0.0.1a6" | ||
name = "cloai" | ||
version = "0.0.1a7" | ||
description = "A CLI for OpenAI's API" | ||
authors = ["Reinder Vos de Wael <[email protected]>"] | ||
license = "LGPL-2.1" | ||
readme = "README.md" | ||
packages = [{include = "oai", from = "src"}] | ||
packages = [{include = "cloai", from = "src"}] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">3.8, <4.0" | ||
|
@@ -43,7 +43,7 @@ pythonpath = [ | |
] | ||
|
||
[tool.poetry.scripts] | ||
oai = 'oai.__main__:main' | ||
cloai = 'cloai.__main__:main' | ||
|
||
[tool.tox] | ||
legacy_tox_ini = """ | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Core modules of the cloai package.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"""Custom exceptions.""" | ||
from oai.core import config | ||
from cloai.core import config | ||
|
||
logger = config.get_logger() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Tests for the entrypoint.""" | ||
import os | ||
|
||
import pytest | ||
|
||
from cloai import __main__ as main | ||
|
||
|
||
def test_main_no_key() -> None: | ||
"""Test case for the main function when OPENAI_API_KEY is not set. | ||
It verifies that the main function raises a SystemExit exception with exit code 1. | ||
""" | ||
del os.environ["OPENAI_API_KEY"] | ||
|
||
with pytest.raises(SystemExit) as exc: | ||
main.main() | ||
|
||
assert exc.value.code == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters