diff options
-rw-r--r-- | LICENSE | 19 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | pyproject.toml | 23 | ||||
-rw-r--r-- | setup.py | 18 | ||||
-rw-r--r-- | src/gpt_chat_cli/__init__.py | 0 | ||||
-rw-r--r-- | src/gpt_chat_cli/argparsing.py (renamed from argparsing.py) | 0 | ||||
-rw-r--r-- | src/gpt_chat_cli/color.py (renamed from color.py) | 0 | ||||
-rw-r--r-- | src/gpt_chat_cli/gcli.py (renamed from gcli.py) | 8 | ||||
-rw-r--r-- | src/gpt_chat_cli/openai_wrappers.py (renamed from openai_wrappers.py) | 0 |
9 files changed, 66 insertions, 3 deletions
@@ -0,0 +1,19 @@ +Copyright (c) 2023 Flur01ne + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a7d5d9f --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +gpt-chat-cli diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..462d249 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,23 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "gpt-chat-cli" +version = "0.0.1" +authors = [ + { name="Flu0r1ne", email="flu0r1ne@flu0r1ne.net" }, +] +description = "A simple ChatGPT terminal CLI" +readme = "README.md" +requires-python = ">=3.7" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] + +[project.urls] +"Homepage" = "https://github.com/flu0r1ne/gpt-chat-cli" +"Bug Tracker" = "https://github.com/flu0r1ne/gpt-chat-cli/issues" + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..0576ace --- /dev/null +++ b/setup.py @@ -0,0 +1,18 @@ +import setuptools + +setuptools.setup( + name='gpt-chat-cli', + version='0.0.1', + entry_points = { + 'console_scripts': ['gpt-chat-cli=gpt_chat_cli.gcli:main'], + }, + author='Flu0r1ne', + description='A simple ChatGPT CLI', + packages=['gpt_chat_cli'], + package_dir={'': 'src'}, + install_requires=[ + 'setuptools', + 'openai >= 0.27.6', + ], + python_requires='>=3.7' +) diff --git a/src/gpt_chat_cli/__init__.py b/src/gpt_chat_cli/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/gpt_chat_cli/__init__.py diff --git a/argparsing.py b/src/gpt_chat_cli/argparsing.py index a7d3218..a7d3218 100644 --- a/argparsing.py +++ b/src/gpt_chat_cli/argparsing.py diff --git a/color.py b/src/gpt_chat_cli/color.py index ce1b182..ce1b182 100644 --- a/color.py +++ b/src/gpt_chat_cli/color.py diff --git a/gcli.py b/src/gpt_chat_cli/gcli.py index 957034b..ded6d6c 100644 --- a/gcli.py +++ b/src/gpt_chat_cli/gcli.py @@ -1,3 +1,5 @@ +#!/bin/env python3 + import argparse import sys import openai @@ -7,19 +9,19 @@ from collections import defaultdict from dataclasses import dataclass from typing import Tuple -from openai_wrappers import ( +from .openai_wrappers import ( create_chat_completion, OpenAIChatResponse, OpenAIChatResponseStream, FinishReason, ) -from argparsing import ( +from .argparsing import ( parse_args, AutoDetectedOption, ) -from color import get_color_codes +from .color import get_color_codes ########################### #### SAVE / REPLAY #### diff --git a/openai_wrappers.py b/src/gpt_chat_cli/openai_wrappers.py index 784a9ce..784a9ce 100644 --- a/openai_wrappers.py +++ b/src/gpt_chat_cli/openai_wrappers.py |