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

Uploaded Source

Built Distribution

chattychattybangbang-0.0.20-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chattychattybangbang-0.0.20.tar.gz
  • Upload date:
  • Size: 7.5 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.20.tar.gz
Algorithm Hash digest
SHA256 2312a2aaac4ce560b4acb5f4929ebb48aed0cd269c39140eb24dc1aad0cea546
MD5 6aab961194ed8f4ecd64196c21176d82
BLAKE2b-256 63ffdce5276c46342e356c0fb0d2004293d42105cc2a3711106862eabcd8a933

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chattychattybangbang-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 a17db48650e3b0f8c99d3bf764b9bad33fbbb423a26711c0a83266268f42416a
MD5 ec9dcf5467071de76f461873a48cda37
BLAKE2b-256 d84e04b73badaf62193a25992bcfa0442b31575bee8e816c052a93c1909d434c

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