Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint the project #3

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# [0.1.0](https://github.com/FullStackWithLawrence/openai-hello-world/compare/v0.0.1...v0.1.0) (2024-01-08)


### Bug Fixes

* force a new release ([95477f0](https://github.com/FullStackWithLawrence/openai-hello-world/commit/95477f0ff52811ef297e661977e1d5b5436e11d5))

- force a new release ([95477f0](https://github.com/FullStackWithLawrence/openai-hello-world/commit/95477f0ff52811ef297e661977e1d5b5436e11d5))

### Features

* create docker-based openai hello world ([73deaae](https://github.com/FullStackWithLawrence/openai-hello-world/commit/73deaae8192a8ffc7ff433b411e1d09cd29a6427))
* create docker-based openai hello world ([cdb5bcc](https://github.com/FullStackWithLawrence/openai-hello-world/commit/cdb5bcc505d6cf20dbe50e865805140d58ec6eae))
- create docker-based openai hello world ([73deaae](https://github.com/FullStackWithLawrence/openai-hello-world/commit/73deaae8192a8ffc7ff433b411e1d09cd29a6427))
- create docker-based openai hello world ([cdb5bcc](https://github.com/FullStackWithLawrence/openai-hello-world/commit/cdb5bcc505d6cf20dbe50e865805140d58ec6eae))
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PIP = $(PYTHON) -m pip
ifneq ("$(wildcard .env)","")
include .env
else
$(shell echo -e "OPENAI_API_ORGANIZATION=PLEASE-ADD-ME\nOPENAI_API_KEY=PLEASE-ADD-ME\nENVIRONMENT=dev\n" >> .env)
$(shell echo -e "OPENAI_API_KEY=PLEASE-ADD-ME\nENVIRONMENT=dev\n" >> .env)
endif

.PHONY: analyze pre-commit init lint clean test build release
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# OpenAI Code Samples
# OpenAI API "Hello World"

[![FullStackWithLawrence](https://a11ybadges.com/badge?text=FullStackWithLawrence&badgeColor=orange&logo=youtube&logoColor=282828)](https://www.youtube.com/@FullStackWithLawrence)<br>
[![OpenAI](https://a11ybadges.com/badge?logo=openai)](https://platform.openai.com/)
[![Amazon AWS](https://a11ybadges.com/badge?logo=amazonaws)](https://aws.amazon.com/)
[![ReactJS](https://a11ybadges.com/badge?logo=react)](https://react.dev/)
[![Docker](https://a11ybadges.com/badge?logo=docker)](https://docs.docker.com/)
[![Python](https://a11ybadges.com/badge?logo=python)](https://www.python.org/)
[![Terraform](https://a11ybadges.com/badge?logo=terraform)](https://www.terraform.io/)<br>
[![12-Factor](https://img.shields.io/badge/12--Factor-Compliant-green.svg)](./doc/Twelve_Factor_Methodology.md)
![Unit Tests](https://github.com/FullStackWithLawrence/openai-hello-world/actions/workflows/testsPython.yml/badge.svg?branch=main)
![GHA pushMain Status](https://img.shields.io/github/actions/workflow/status/FullStackWithLawrence/openai-hello-world/pushMain.yml?branch=main)
![Auto Assign](https://github.com/FullStackwithLawrence/openai-hello-world/actions/workflows/auto-assign.yml/badge.svg)
Expand Down
14 changes: 9 additions & 5 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
from app.exceptions import ConfigurationException


# Load environment variables from .env file if available
load_dotenv()
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY", None)


if OPENAI_API_KEY in (None, "PLEASE-ADD-ME"):
raise ConfigurationException("No OpenAI API key found. Please add it to your .env file.")

# OpenAI API settings
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY", None)
OPENAI_API_MODEL = "gpt-3.5-turbo"
OPENAI_API_TEMPERATURE = 0.0
OPENAI_API_MAX_TOKENS = 64


# application settings
LANGUAGES = [
"English",
"Spanish",
Expand All @@ -42,3 +42,7 @@
"Turkish",
"Tamil",
]

# application configuration validations
if OPENAI_API_KEY in (None, "PLEASE-ADD-ME"):
raise ConfigurationException("No OpenAI API key found. Please add it to your .env file.")
Loading