Skip to content

Remove OpenAI dependencies and references #178

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

Merged
merged 2 commits into from
Aug 15, 2025
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ build/
chatlog.jsonl
/backend/chatlog.jsonl
/backend/combined_training.jsonl
/backend/combined_training_gpt-4.1.jsonl
/backend/combined_training_gemini-2.0.jsonl
/backend/feedback.jsonl
/backend/data
/backend/scripts/eval_results.json
/backend/scripts/generate_conversation/*.csv
!/backend/scripts/generate_conversation/tenant_questions_facts_full.csv
combined_training_gpt-4_1.jsonl
combined_training_gemini-2.0.jsonl
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ Live at https://tenantfirstaid.com/
- [uv](https://docs.astral.sh/uv/getting-started/installation/)
- [docker](https://www.docker.com/)

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.
1. copy `backend/.env.example` to a new file named `.env` in the same directory. The chatbot now uses Google Gemini instead of OpenAI.
1. `cd backend`
1. `docker-compose up` (use `-d` if you want to run this in the background, otherwise open a new terminal)
1. `uv sync`
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`.
1. `uv run python -m tenantfirstaid.app`
1. Open a new terminal / tab
1. `cd ../frontend`
Expand Down
2 changes: 1 addition & 1 deletion backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Specify a different model
MODEL_NAME=gpt-2.5-flash

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

# DB Info
Expand Down
2 changes: 0 additions & 2 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies = [
"google-auth>=2.40.3",
"google-genai>=1.28.0",
"google-cloud-aiplatform>=1.106.0",
"openai==1.89",
"jsonlines",
"simplejson",
"python-dotenv",
Expand Down Expand Up @@ -42,5 +41,4 @@ dev = [

gen_convo = [
"pandas",
"openai",
]
84 changes: 0 additions & 84 deletions backend/scripts/create_vector_store.py

This file was deleted.

7 changes: 3 additions & 4 deletions backend/scripts/generate_conversation/chat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# /// script
# requires-python = "~=3.11"
# dependencies = [
# "openai",
# "pandas",
# "python-dotenv",
# ]
Expand Down Expand Up @@ -68,7 +67,7 @@ def _reverse_message_roles(self, messages):
return reversed_messages

def bot_response(self):
"""Generates a response from the bot using the OpenAI API."""
"""Generates a response from the bot using the Gemini API."""
tries = 0
while tries < 3:
# Use the BOT_INSTRUCTIONS for bot responses
Expand All @@ -90,7 +89,7 @@ def bot_response(self):
return failure_message, None

def user_response(self):
"""Generates a response from the user using the OpenAI API."""
"""Generates a response from the user using the Gemini API."""
tries = 0
while tries < 3:
try:
Expand Down Expand Up @@ -217,4 +216,4 @@ def process_csv(input_file=None, output_file=None, num_turns=5, num_rows=None):
process_csv(
num_turns=args.num_turns, num_rows=args.num_rows, output_file=args.output_file
)
# This script generates conversations between a user and a bot using the OpenAI API.
# This script generates conversations between a user and a bot using the Gemini API.
2 changes: 1 addition & 1 deletion config/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Remote server setup

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

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

Expand Down
8 changes: 4 additions & 4 deletions frontend/src/PrivacyPolicy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ export default function PrivacyPolicy() {
<li>
Other Venders: Our Services connect with other technology platforms
and anonymously shared/stored data is governed by their policies
(OpenAI:{" "}
(Google:{" "}
<Link
to="https://openai.com/policies/privacy-policy"
to="https://policies.google.com/privacy"
className="underline text-blue-600"
>
Privacy Policy
</Link>{" "}
and{" "}
<Link
to="https://openai.com/policies/terms-of-use"
to="https://policies.google.com/terms"
className="underline text-blue-600"
>
Terms of Use
Terms of Service
</Link>
)
</li>
Expand Down