Skip to main content

chat utilities

Project description

chattychattybangbang

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.

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

Uploaded Source

Built Distribution

chattychattybangbang-0.0.16-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for chattychattybangbang-0.0.16.tar.gz
Algorithm Hash digest
SHA256 98a67d181d60bc328cbb33d3671a624d412099ea98039a9070493ac7f1146451
MD5 9c337f5e39fe8a8ac5e9b539ad3e8ac0
BLAKE2b-256 1ea70c50e822976b7b61387a0f20d503a9633ea8a7f13643e7ba3018a3f70487

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chattychattybangbang-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 a0a2d2cab9e676200f6171d412854893d9b9533f75dfc24360dc950f62ccca36
MD5 763d14bd8c064d90fbc3413cf4ecb3e7
BLAKE2b-256 8b11ae53fe320ae73b9b18818d13699515e0d4e2250263b9c7adf69b6f206256

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