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

Uploaded Source

Built Distribution

chattychattybangbang-0.0.17-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chattychattybangbang-0.0.17.tar.gz
  • Upload date:
  • Size: 7.4 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.17.tar.gz
Algorithm Hash digest
SHA256 92a8abc68b70cc9b757ff4e76c158b845d2ef57f6a5a3670debced53942603c9
MD5 3eb08ba00f81fae4b476719f247c27e3
BLAKE2b-256 72e5ed253907d908ead9ebb56135ff854d6db022369c1711adf4839bf9837df8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chattychattybangbang-0.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 6b346551882e7962fc18813820d2d497d3965325244358ad9b8cf3d906d8cf99
MD5 40e40b354ed2e9858ffbd01c8ef90279
BLAKE2b-256 3c72494df12e3f4f3961e9082508d49bc7e651c7df00056b6904d1c2560b5506

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