Skip to main content

chat utilities

Project description

chattychattybangbang docs

Utilities for using chatgpt more reliably

Install

pip install chattychattybangbang

Set key

import 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 for presidential poetry appreciation, etc.

Article

See Reliably getting answers out of chatgpt on medium. Thanks to Michael Rowe.

One day certification course

Just kidding but check out our awesome 10x prompting guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chattychattybangbang-0.0.27.tar.gz (7.8 kB view hashes)

Uploaded Source

Built Distribution

chattychattybangbang-0.0.27-py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page