Skip to content

An AI chatbot for developers written in Python 🐍

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

sebastienrousseau/talkwave

Repository files navigation

talkwave logo

Python TalkWave

talkwave banner

Overview πŸ“–

TalkWave is an AI chatbot for developers written in Python. It features a simple HTML frontend and is designed to be accessible across various browsers and devices. TalkWave supports asynchronous operations and can handle multiple requests simultaneously.

Features ✨

  • Accepts a range of parameters to customize the response, such as max tokens, temperature, and stopping conditions.
  • Accessible design for cross-browser and device compatibility (Chrome, Firefox, Safari, Edge, and mobile).
  • Accurately limits billing with limits and ID binding to prevent exceeding API limits and incurring charges.
  • Implements rate limiting functionality to prevent exceeding API limits and incurring charges.
  • Plain Python implementation with a limited number of dependencies for easy installation and use.
  • Stores responses in log files, JSON, and Markdown formats for easy analysis and sharing.
  • Supports multiple GPT models for generating responses, including gpt-3.5-turbo,text-davinci-002,text-curie-001,text-babbage-001,text-ada-001.

Requirements πŸ“‹

  • Python 3.6 or higher
  • The openai, tabulate, and python-dotenv packages
  • An OpenAI API key (get one here)

Installation πŸ› 

  1. Install the required packages:
pip install openai tabulate python-dotenv
  1. Clone the TalkWave repository:
git clone https://github.com/sebastienrousseau/talkwave.git
  1. Add your OpenAI API key to a .env file in the project directory:
OPENAI_API_KEY="your_api_key_here"

Usage πŸš€

Command Line Interface

To use TalkWave, navigate to the project directory in your terminal and run the following command:

python talkwave -p "Your prompt here"

You can also specify additional options, such as the GPT model, maximum tokens, temperature, and user ID:

python talkwave -m 1 -p "Tell me a joke" -t 50 -T 0.5 -u "test@test.com" -r 5 -s -o "json"

For more information on the available options, run:

python talkwave --help

Web Frontend

To use the web frontend, navigate to the project directory in your terminal and run the following command:

python talkwave/frontend.py

Then, open your browser and navigate to http://127.0.0.1:5000. This will open the TalkWave web frontend, which you can use to generate responses.

File Structure πŸ“

.
β”œβ”€β”€ talkwave
β”‚Β Β  β”œβ”€β”€ data
β”‚Β Β  β”œβ”€β”€ templates
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ 404.html
β”‚Β Β  β”‚Β Β  └── index.html
β”‚Β Β  β”œβ”€β”€ utils
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ curl.py
β”‚Β Β  β”‚Β Β  └── dir.py
β”‚Β Β  β”œβ”€β”€ __init__.py
β”‚Β Β  β”œβ”€β”€ __main__.py
β”‚Β Β  β”œβ”€β”€ core.py
β”‚Β Β  └── frontend.py
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ LICENSE-APACHE
β”œβ”€β”€ LICENSE-MIT
β”œβ”€β”€ MANIFEST.in
β”œβ”€β”€ README.md
β”œβ”€β”€ README_fr.md
β”œβ”€β”€ TEMPLATE.md
β”œβ”€β”€ pylintrc
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ setup.cfg
└── setup.py

License πŸ“œ

The project is licensed under the terms of both the MIT license and the Apache License (Version 2.0).