https://github.com/microprediction/chattychattybangbang
Forcing ChatGPT to do its own QA, and other strategies.
https://github.com/microprediction/chattychattybangbang
Last synced: about 1 month ago
JSON representation
Forcing ChatGPT to do its own QA, and other strategies.
- Host: GitHub
- URL: https://github.com/microprediction/chattychattybangbang
- Owner: microprediction
- License: mit
- Created: 2023-04-10T22:41:35.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-08T13:09:42.000Z (almost 2 years ago)
- Last Synced: 2025-03-25T03:12:58.448Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 1.68 MB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chattychattybangbang [docs](https://microprediction.github.io/chattychattybangbang)
Utilities for using chatgpt more reliably### Install
pip install chattychattybangbang
### Set keyimport os
os.environ['OPEN_AI_KEY'] = 'getakeyfromopenaisite'
### Example
Asks ChatGPT a question, then calls it again to QA the answer.from chattychattybangbang.castigateuntilvaluesare import castigate_until_values_are
question = """
I would like you to pick three companies from the sp500 index.
Return a dictionary containing the main color in their logo (pick one only)
The keys of the dictionary should be the company tickers.
Just provide the dict and nothing else in your response, please.
"""
d = castigate_until_values_are(question=question, value_description='a color', max_retries=5)
print(d)
{'AAPL': 'white', 'MSFT': 'red', 'GOOGL': 'green'}See [examples](https://github.com/microprediction/chattychattybangbang/tree/main/examples) for presidential poetry appreciation, etc.
### Article
See [Reliably getting answers out of chatgpt](https://medium.com/@mike.roweprediger/reliably-getting-answers-out-of-chatgpt-by-forcing-it-to-qa-itself-feb1f56782b9) on medium. Thanks to Michael Rowe.### One day certification course
Just [kidding](https://microprediction.github.io/chattychattybangbang/certificate) but check out our [awesome 10x prompting guide](https://microprediction.github.io/chattychattybangbang/awesome).