Skip to content

Latest commit

 

History

History
93 lines (63 loc) · 2.43 KB

developer-guide.md

File metadata and controls

93 lines (63 loc) · 2.43 KB

Developer Guidelines

This document outlines the best practices and guidelines for developers contributing to this project.

Table of Contents

Project Structure

The main application starts with chat.py. The prompts sent to generative AIs are located under the prompts folder.

As the application structure evolves, one should see more Python library folders being added to the project.

Development Setup

Prerequisites

  • A Python 3.10 (or later) runtime environment
  • Cluster credentials with administrative privileges to a Kubernetes cluster
  • An API Key to ChatGPT

Installation

CLI setup

If you want to iterate through development using a terminal, you can consult the following reference on creating the Python environment: https://docs.python.org/3/library/venv.html

VIRTUAL_ENV_DIR=/path/to/new/virtual/environment
python -m venv ${VIRTUAL_ENV_DIR:?}

Configuration

Create a configuration file in a location in your filesystem, such as ${HOME}/etc/k8s-chat.env

cat << EOF > "${HOME}/etc/k8s-chat.env"
OPENAI_API_KEY=sk-...

K8_HOSTNAME=https://api....
K8_PASSWORD=...
K8_USERNAME=...
SKIP_TLS=true

LOGGING_LEVEL=debug
EOF

Usage

Activate the virtual environment:

${VIRTUAL_ENV_DIR}/bin/activate
pip install -r requirements.txt

Launch the application:

python --env-file $HOME/etc/k8s-chat.env app.py

Coding Standards

(under construction)

  • Code formatting using Flake8
  • Documentation standards: All documents written in markdown format.

Git Workflow

  • Always open an issue first, following the appropriate template for either enhancement or a bug fix.
  • Code branches should follow the convention \<issue-number\>-\<dash-separated-lower-case-name\>, such as 12-feature-name.
  • Only one commit per pull request.
  • Follow these guidelines when writing the Git commit message.

Testing

(under construction)