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.6.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.6-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ChatTDD-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 34bd5a282a87cf37fd3cd15a05a20e15897cd101f0812bbd6fad7e5c8f1e8550
MD5 edd242101c61f279979f4a441531004d
BLAKE2b-256 f662688ff324b3455ac339223975e3f76f69147c9d2ac8a086df7768f1eff10f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ChatTDD-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a6f1413173562a7e861dcbfdb4fa8c9b5f40084e7831fab22d5a075e8a14a643
MD5 2984c7d5c8ffda7d28a0a1e9eaba4b66
BLAKE2b-256 c2975ad0322f245998effcc71eb390bf72aab9f3ed0e9cfbe5e649ed82f261a1

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