Skip to content

Commit

Permalink
Docs (#18)
Browse files Browse the repository at this point in the history
* update to gemini api

* hard code version img and update to gemini env

* deployments docs
  • Loading branch information
richardbertozzo authored Aug 7, 2024
1 parent 2f69102 commit 88c43c0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
Get your right type of coffee ☕

Go application that provides information on the best type of coffee based on user input characteristics.
It uses two data sources: the **ChatGPT API** and a **database** populated by ETL from a dataset, not required if you only want the ChatGPT data source for the best type coffee options.
It uses two data sources: the **Google Gemini API** and a **database** populated by ETL from a dataset.
This dataset was gathered from [Kaggle](https://www.kaggle.com/datasets/volpatto/coffee-quality-database-from-cqi) (kudos for the author), see there for further details.

## Usage

To run the application, you need to have:
- Go installed
- Chat GPT API key, you can create one [here](https://platform.openai.com/account/api-keys)
- Google Gemini API key, you can create one [here](https://aistudio.google.com/app/apikey)
- Postgres URL (_optional_)
- You can run a local docker instance by running the command `$ make pg-up` or pointing for a Cloud instance
- You can run a local docker instance by running the command `$ make pg-up` or pointing to any other instance, like a cloud instance

The application has tree command entry points:

Expand All @@ -33,7 +33,7 @@ then insert them into the Postgres database.
It will create and populate the second data source to retrieve the best type of coffee for you,
which you can get using the other 2 commands, **API** and **CLI**.

This is optimal if only want the ChatGPT, so skip it.
This is optimal if only want the Gemini API result, so skip it.

You can run the ETL by the command:

Expand Down Expand Up @@ -67,8 +67,8 @@ This will run the CLI interface, which will output the best coffees for you from

It uses two data sources:

### ChatGPT API
The ChatGPT API is used to generate responses to user feedback. The application sends user feedback to the API and receives a response based on the user's input.
### Gemini API
The Gemini API is used to generate responses to user feedback. The application sends user feedback to the API and receives a response based on the user's input.

### Database
The application also uses a database that is populated by ETL (Extract, Transform, Load) dataset data.
Expand Down
20 changes: 20 additions & 0 deletions deployments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Deployments

Concentrate all k8s configurations regarding the API deploy and resources

## Vault

The API secrets are stored and injected by Vault sidecar.

You must install and configure the vault in your k8s cluster, you can do it following the commands or the ref links

Commands:
```shell
kubectl create namespace type-coffee
kubectl config set-context --current --namespace=type-coffee
helm repo add hashicorp https://helm.releases.hashicorp.com
helm install vault hashicorp/vault --set "server.dev.enabled=true"
```

Ref:
https://developer.hashicorp.com/vault/tutorials/kubernetes/kubernetes-sidecar?product_intent=vault#install-the-vault-helm-chart
4 changes: 2 additions & 2 deletions deployments/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ spec:
export DB_USERNAME="{{ .Data.data.DB_USERNAME }}"
export DB_PASSWORD="{{ .Data.data.DB_PASSWORD }}"
export DB_DATABASE="{{ .Data.data.DB_DATABASE }}"
export CHAT_GPT_KEY="{{ .Data.data.CHAT_GPT_KEY }}"
export GEMINI_API_KEY="{{ .Data.data.GEMINI_API_KEY }}"
{{- end }}
spec:
serviceAccountName: type-coffee-api
containers:
- name: type-coffee-api
image: ghcr.io/richardbertozzo/type-coffee-api:latest
image: ghcr.io/richardbertozzo/type-coffee-api:v1.0.0
imagePullPolicy: Always
resources:
limits:
Expand Down

0 comments on commit 88c43c0

Please sign in to comment.