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.24.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

chattychattybangbang-0.0.24-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file chattychattybangbang-0.0.24.tar.gz.

File metadata

  • Download URL: chattychattybangbang-0.0.24.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for chattychattybangbang-0.0.24.tar.gz
Algorithm Hash digest
SHA256 556995441455280872e6fa81cc039965070f583765abe307496b7c51d9bccb33
MD5 b39d1565b326e54d3f8ed1132ff9b130
BLAKE2b-256 9bace3239f9c971c6adcd8047a0d6a5cddabe1212143e3f623fe6e71aed93e18

See more details on using hashes here.

File details

Details for the file chattychattybangbang-0.0.24-py3-none-any.whl.

File metadata

File hashes

Hashes for chattychattybangbang-0.0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 9213644dc2c1dc41a074c8df3ee5139fc9135937f74a07bc059d131bb7b0a7f9
MD5 d29efca8aae7c6bef32c8b802c8dfe23
BLAKE2b-256 e4fafc6c5afe0441a5e2d2930c6ff5c27fb753662426bbd4185b557600d8faad

See more details on using hashes here.

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