refactor: bump version

This commit is contained in:
Florian Hönicke
2023-04-12 17:49:58 +02:00
parent 372f40b7dc
commit e68c47e8da
4 changed files with 19 additions and 6 deletions

View File

@@ -7,7 +7,7 @@ def read_requirements():
setup( setup(
name='gptdeploy', name='gptdeploy',
version='0.18.14', version='0.18.15',
description='Use natural language interface to create, deploy and update your microservice infrastructure.', description='Use natural language interface to create, deploy and update your microservice infrastructure.',
long_description=open('README.md', 'r', encoding='utf-8').read(), long_description=open('README.md', 'r', encoding='utf-8').read(),
long_description_content_type='text/markdown', long_description_content_type='text/markdown',

View File

@@ -1,2 +1,2 @@
__version__ = '0.18.14' __version__ = '0.18.15'
from src.cli import main from src.cli import main

View File

@@ -28,7 +28,11 @@ class GPTSession:
def get_openai_api_key(self): def get_openai_api_key(self):
if 'OPENAI_API_KEY' not in os.environ: if 'OPENAI_API_KEY' not in os.environ:
raise Exception('You need to set OPENAI_API_KEY in your environment') raise Exception('''
You need to set OPENAI_API_KEY in your environment.
If you have updated it already, please restart your terminal.
'''
)
openai.api_key = os.environ['OPENAI_API_KEY'] openai.api_key = os.environ['OPENAI_API_KEY']
def is_gpt4_available(self): def is_gpt4_available(self):

View File

@@ -80,8 +80,12 @@ def set_env_variable(shell, key):
with open(config_file, "a") as file: with open(config_file, "a") as file:
file.write(f"\n{export_line}\n") file.write(f"\n{export_line}\n")
click.echo( click.echo(f'''
f"✅ Success, OPENAI_API_KEY has been set in {config_file}\nPlease restart your shell to apply the changes.") ✅ Success, OPENAI_API_KEY has been set in {config_file}.
Please restart your shell to apply the changes or run:
source {config_file}
'''
)
except FileNotFoundError: except FileNotFoundError:
click.echo(f"Error: {config_file} not found. Please set the environment variable manually.") click.echo(f"Error: {config_file} not found. Please set the environment variable manually.")
@@ -93,7 +97,12 @@ def set_api_key(key):
if system_platform == "windows": if system_platform == "windows":
set_env_variable_command = f'setx OPENAI_API_KEY "{key}"' set_env_variable_command = f'setx OPENAI_API_KEY "{key}"'
subprocess.call(set_env_variable_command, shell=True) subprocess.call(set_env_variable_command, shell=True)
click.echo("✅ Success, OPENAI_API_KEY has been set.\nPlease restart your Command Prompt to apply the changes.") click.echo('''
✅ Success, OPENAI_API_KEY has been set.
Please restart your Command Prompt to apply the changes.
'''
)
elif system_platform in ["linux", "darwin"]: elif system_platform in ["linux", "darwin"]:
if "OPENAI_API_KEY" in os.environ or is_key_set_in_config_file(key): if "OPENAI_API_KEY" in os.environ or is_key_set_in_config_file(key):
if not click.confirm("OPENAI_API_KEY is already set. Do you want to overwrite it?"): if not click.confirm("OPENAI_API_KEY is already set. Do you want to overwrite it?"):