Skip to main content

A utility to assist in building Test-Driven Python code using Langchain and OpenAI.

Project description

ChatTDD

ChatTDD is a utility designed to help developers create Test-Driven Python code using Langchain and OpenAI. By entering a description of the functionality you need, ChatTDD will generate code for that function based on a test.

Installation

To install ChatTDD, ensure you have Python 3.9 installed, then run the following command:

pip install ChatTDD

Configuration

Before using ChatTDD, you'll need to have an OpenAI API key. If you don't have one, you can obtain it from OpenAI. Remember, using your api key with ChatTDD or any other client will come with a cost to you - so be warned and run at your own risk.

Update your environment with your api key:

export OPENAI_API_KEY='[your key here]'

If a key isn't present in the environment then ChatTDD will prompt you to enter it.

Usage

Once installed, you can use the chattdd command to interact with the tool. Here's how to use ChatTDD:

Select a Model

You can choose between three models: text-davinci-003, gpt-3.5-turbo, and gpt-4. To select a model, use the following command:

chattdd model text-davinci-003

Your model selection will be remembered for future sessions.

Output Folder

chattdd outputfolder [folder_path]

Sets the root folder for generated files. If this is left blank, files will be saved in the specified relative paths without a leading folder.

Generate Test code & feature functions

Simply run

chattdd

ChatTDD will ask for your requirement. Alternative:

chattdd test-and-code "sort a list of objects alphabetically"

ChatTDD will create the necessary Python files under the default directory or the directory you have setup with the 'outputfolder' command.

Generate Only Test Code

chattdd test "sort a list of objects alphabetically"

ChatTDD will create the necessary Python files under the tests directory.

Contributing

If you'd like to contribute to the development of ChatTDD, please feel free to fork the repository and submit a pull request.

License

ChatTDD is licensed under the MIT License. See the LICENSE file for more details.

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

ChatTDD-0.2.5.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ChatTDD-0.2.5-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file ChatTDD-0.2.5.tar.gz.

File metadata

  • Download URL: ChatTDD-0.2.5.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for ChatTDD-0.2.5.tar.gz
Algorithm Hash digest
SHA256 ebf561a9461561ae6778f1a44cbbd328f240fdae434f21ff59c30cd82380d5e2
MD5 9dfdb31af18a713d273a61ad6da381e1
BLAKE2b-256 85845f06f682478a27abb5cd443b36f5dd48d6a069920e077ff20c03d019bf9d

See more details on using hashes here.

File details

Details for the file ChatTDD-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: ChatTDD-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for ChatTDD-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8bf36e408ed5c042acf7db0180bd9a8ee8595a46e818c9f7d3d885bc7acfd5a3
MD5 93511b86112923e0fc8976a449b18f91
BLAKE2b-256 e3eb3a88ec561f378a635784333c355dc703411fa2e3fa8d7d2e533dc62c9445

See more details on using hashes here.

Supported by

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