Skip to content

Commit 1be1589

Browse files
yangm2claude[bot]
andauthored
Remove OpenAI dependencies and references (#178)
* Remove OpenAI dependencies and references - Remove openai package from backend/pyproject.toml dependencies - Delete backend/scripts/create_vector_store.py (OpenAI-only script) - Update frontend privacy policy to reference Google policies instead of OpenAI - Remove OpenAI package installation from GitHub workflow - Update documentation to reflect migration from OpenAI to Google Gemini - Update .gitignore patterns from GPT-4 to Gemini - Fix misleading comments in conversation generation script Fixes #174 Co-authored-by: yangm2 <[email protected]> * Remove OpenAI dependencies and references - Remove openai package from backend/pyproject.toml dependencies - Delete backend/scripts/create_vector_store.py (OpenAI-only script) - Update frontend privacy policy to reference Google policies instead of OpenAI - Update documentation to reflect migration from OpenAI to Google Gemini - Update .gitignore patterns from GPT-4 to Gemini - Fix misleading comments in conversation generation script Note: Workflow file .github/workflows/generate_conversations.yml still needs manual update due to permissions (remove openai from pip install and OPENAI_API_KEY env var) Fixes #174 Co-authored-by: yangm2 <[email protected]> --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1 parent 9d561b1 commit 1be1589

File tree

8 files changed

+12
-100
lines changed

8 files changed

+12
-100
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ build/
5555
chatlog.jsonl
5656
/backend/chatlog.jsonl
5757
/backend/combined_training.jsonl
58-
/backend/combined_training_gpt-4.1.jsonl
58+
/backend/combined_training_gemini-2.0.jsonl
5959
/backend/feedback.jsonl
6060
/backend/data
6161
/backend/scripts/eval_results.json
6262
/backend/scripts/generate_conversation/*.csv
6363
!/backend/scripts/generate_conversation/tenant_questions_facts_full.csv
64-
combined_training_gpt-4_1.jsonl
64+
combined_training_gemini-2.0.jsonl

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ Live at https://tenantfirstaid.com/
1313
- [uv](https://docs.astral.sh/uv/getting-started/installation/)
1414
- [docker](https://www.docker.com/)
1515

16-
1. copy `backend/.env.example` to a new file named `.env` in the same directory and populate it with your `OPENAI_API_KEY`. You can set an invalid key, in which case the bot will return error messages. This may still be useful for developing other features.
16+
1. copy `backend/.env.example` to a new file named `.env` in the same directory. The chatbot now uses Google Gemini instead of OpenAI.
1717
1. `cd backend`
1818
1. `docker-compose up` (use `-d` if you want to run this in the background, otherwise open a new terminal)
1919
1. `uv sync`
20-
1. If you have not uploaded the Oregon Housing Law documents to a vector store in OpenAI, run `uv run scripts/create_vector_store.py` and follow the instructions to add the vector store ID to your `.env`.
2120
1. `uv run python -m tenantfirstaid.app`
2221
1. Open a new terminal / tab
2322
1. `cd ../frontend`

backend/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Specify a different model
22
MODEL_NAME=gpt-2.5-flash
33

4-
# Vector store ID for OpenAI (use the create_vector_store script to create one)
4+
# Vector store ID for Gemini (deprecated - no longer needed)
55
VECTOR_STORE_ID=my_vector_store_id
66

77
# DB Info

backend/pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ dependencies = [
1515
"google-auth>=2.40.3",
1616
"google-genai>=1.28.0",
1717
"google-cloud-aiplatform>=1.106.0",
18-
"openai==1.89",
1918
"jsonlines",
2019
"simplejson",
2120
"python-dotenv",
@@ -48,5 +47,4 @@ dev = [
4847

4948
gen_convo = [
5049
"pandas",
51-
"openai",
5250
]

backend/scripts/create_vector_store.py

Lines changed: 0 additions & 84 deletions
This file was deleted.

backend/scripts/generate_conversation/chat.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# /// script
22
# requires-python = "~=3.11"
33
# dependencies = [
4-
# "openai",
54
# "pandas",
65
# "python-dotenv",
76
# ]
@@ -68,7 +67,7 @@ def _reverse_message_roles(self, messages):
6867
return reversed_messages
6968

7069
def bot_response(self):
71-
"""Generates a response from the bot using the OpenAI API."""
70+
"""Generates a response from the bot using the Gemini API."""
7271
tries = 0
7372
while tries < 3:
7473
# Use the BOT_INSTRUCTIONS for bot responses
@@ -90,7 +89,7 @@ def bot_response(self):
9089
return failure_message, None
9190

9291
def user_response(self):
93-
"""Generates a response from the user using the OpenAI API."""
92+
"""Generates a response from the user using the Gemini API."""
9493
tries = 0
9594
while tries < 3:
9695
try:
@@ -217,4 +216,4 @@ def process_csv(input_file=None, output_file=None, num_turns=5, num_rows=None):
217216
process_csv(
218217
num_turns=args.num_turns, num_rows=args.num_rows, output_file=args.output_file
219218
)
220-
# This script generates conversations between a user and a bot using the OpenAI API.
219+
# This script generates conversations between a user and a bot using the Gemini API.

config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Remote server setup
22

3-
Ubuntu LTS 24.04 hosted on Digital Ocean with 2 CPUs and 2GB RAM. Stack includes Certbot, Porkbun, OpenAI, and Nginx.
3+
Ubuntu LTS 24.04 hosted on Digital Ocean with 2 CPUs and 2GB RAM. Stack includes Certbot, Porkbun, Google Gemini, and Nginx.
44

55
This folder is just a copy of the things on the remote server. There is no Github action or similar to sync these.
66

frontend/src/PrivacyPolicy.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ export default function PrivacyPolicy() {
7777
<li>
7878
Other Venders: Our Services connect with other technology platforms
7979
and anonymously shared/stored data is governed by their policies
80-
(OpenAI:{" "}
80+
(Google:{" "}
8181
<Link
82-
to="https://openai.com/policies/privacy-policy"
82+
to="https://policies.google.com/privacy"
8383
className="underline text-blue-600"
8484
>
8585
Privacy Policy
8686
</Link>{" "}
8787
and{" "}
8888
<Link
89-
to="https://openai.com/policies/terms-of-use"
89+
to="https://policies.google.com/terms"
9090
className="underline text-blue-600"
9191
>
92-
Terms of Use
92+
Terms of Service
9393
</Link>
9494
)
9595
</li>

0 commit comments

Comments
 (0)