-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[runtime] add a check for internet connectivity and return error if no connection #48
Comments
We should add a # parse config data
def get_config_data(config_file='gptty.ini'):
# create a configuration object
config = configparser.ConfigParser()
config['DEFAULT'] = {
'api_key': "",
'your_name': 'question',
'gpt_name': 'response',
'output_file': 'output.txt',
'model': 'text-davinci-003',
'temperature': 0.0,
'max_tokens': 250,
'max_context_length': 150,
'context_keywords_only': True,
'preserve_new_lines': False,
'verify_internet_endpoint': 'google.com',
}
# read the configuration file (if it exists)
config.read(config_file)
parsed_data = {
'api_key': config.get('main', 'api_key', fallback="",),
'your_name': config.get('main', 'your_name', fallback='question'),
'gpt_name': config.get('main', 'gpt_name', fallback='response'),
'output_file': config.get('main', 'output_file', fallback='output.txt'),
'model': config.get('main', 'model', fallback='text-davinci-003'),
'temperature': config.getfloat('main', 'temperature', fallback=0.0),
'max_tokens': config.getint('main', 'max_tokens', fallback=25),
'max_context_length': config.getint('main', 'max_context_length', fallback=150),
'context_keywords_only': config.getboolean('main', 'context_keywords_only', fallback=True),
'preserve_new_lines': config.getboolean('main', 'preserve_new_lines', fallback=False),
'verify_internet_endpoint': config.get('main', 'verify_internet_endpoint', fallback='google.com'),
} |
Open
Hey, I think i can fix this issue. |
signebedi
added a commit
that referenced
this issue
Apr 1, 2023
Added: Internet connectivity check (#48)
Great work @hyp-er! Merged! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See eg. https://stackoverflow.com/a/62115290/13301284.
If the user runs the chatroom or query, but there is no internet connection, return an error message in main.py.
The text was updated successfully, but these errors were encountered: