mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-20 07:04:20 +01:00
refactor: bump version
This commit is contained in:
2
setup.py
2
setup.py
@@ -7,7 +7,7 @@ def read_requirements():
|
||||
|
||||
setup(
|
||||
name='gptdeploy',
|
||||
version='0.18.14',
|
||||
version='0.18.15',
|
||||
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_content_type='text/markdown',
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
__version__ = '0.18.14'
|
||||
__version__ = '0.18.15'
|
||||
from src.cli import main
|
||||
@@ -28,7 +28,11 @@ class GPTSession:
|
||||
|
||||
def get_openai_api_key(self):
|
||||
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']
|
||||
|
||||
def is_gpt4_available(self):
|
||||
|
||||
@@ -80,8 +80,12 @@ def set_env_variable(shell, key):
|
||||
with open(config_file, "a") as file:
|
||||
file.write(f"\n{export_line}\n")
|
||||
|
||||
click.echo(
|
||||
f"✅ Success, OPENAI_API_KEY has been set in {config_file}\nPlease restart your shell to apply the changes.")
|
||||
click.echo(f'''
|
||||
✅ 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:
|
||||
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":
|
||||
set_env_variable_command = f'setx OPENAI_API_KEY "{key}"'
|
||||
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"]:
|
||||
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?"):
|
||||
|
||||
Reference in New Issue
Block a user