Skip to content

Commit

Permalink
Merge branch 'main' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jan 8, 2024
2 parents e1ce2ae + 5b2739e commit 4fdcb02
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
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.")

0 comments on commit 4fdcb02

Please sign in to comment.