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 pytest code for that function. Additionally, it allows you to review and validate the generated test code using different models from OpenAI.

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.

On the first run, ChatTDD will prompt you to enter your OpenAI API key, which will be saved for future use.

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 Function and Test Code

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

ChatTDD will create the necessary Python files under the src and tests directories respectively.

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.1.7.tar.gz (6.5 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.1.7-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ChatTDD-0.1.7.tar.gz
Algorithm Hash digest
SHA256 723bebc3c09f5e93a381dbb64c3bab153cdbb036645afe8d7d67212fc4da9795
MD5 99f735f6084fb024086a08c772472f8f
BLAKE2b-256 771b4a529fe2d673e71983ca5d5f530b9a895e69abb876cf091e7b1a47c7a58e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ChatTDD-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d051876ddae59e9cec16fb7828cbf390c7f98f9b8a9dd9d76ad43ccd6e2071a2
MD5 a9f87468231464d635f694b5c70419de
BLAKE2b-256 ad46f28c6992b75a68638fa276aa04bf168b8a94f4d16a7833e6b6b03b4c78d9

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