Comments (3)
Hey, I think i can fix this issue.
from gptty.
We should add a verify_internet_endpoint
config that defaults to google.com. We'll need to document this in the README.
# 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'),
}
from gptty.
Great work @hyp-er! Merged!
from gptty.
Related Issues (20)
- Deploy v.0.2.6
- [context] logic sometimes fails to constrain queries to `max_context_length`
- [tests] test additional_context passed to get_context HOT 1
- Add docstrings
- [runtime] test `chat` UX across various terminal emulators
- [integration] Integrate chat and query functionality to Jupyter notebooks
- [api] add rate-limit handling
- [accessibility] add multi-language support
- [docs] add pre-built query templates
- [docs] add `discussion` for custom prompts and examples
- [debug] Include analytics and usage statistics for the given API key HOT 2
- [bug] cannot connect to any model without org_id specified
- Deploy v.0.2.7
- [docs] generate documentation HOT 1
- Deploy v.0.2.8
- [scripting] extend the UniversalCompletion class with context generation
- [db] add support for a wider variety of datastores
- Add a `buy me a coffee` social link
- Validate support for gpt4-turbo HOT 1
- [bug] `questions` not defined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gptty.