Skip to content

feat: integrate Google AI chat functionality #230

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

Open
wants to merge 4 commits into
base: staging
Choose a base branch
from
Open
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
Empty file added .env.docker
Empty file.
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ services:
dockerfile: Dockerfile
ports:
- "80:3000"
env_file:
- .env
environment:
DATABASE_URL: postgresql://postgres:letmein@db:5432/postgres?schema=public
NODE_ENV: production
depends_on:
db:
condition: service_healthy
Expand All @@ -28,4 +31,4 @@ services:
retries: 5

volumes:
fs_data:
fs_data:
27 changes: 27 additions & 0 deletions gemini.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { GoogleGenAI } from "@google/genai";
import dotenv from "dotenv";

dotenv.config();

const ai = new GoogleGenAI({
apiKey: process.env.VITE_GOOGLE_API_KEY || "",
});

async function main() {
const chat = ai.chats.create({
model: "gemini-2.5-flash",
history: [],
});

const response1 = await chat.sendMessage({
message: "I have 2 dogs in my house.",
});
console.log("Chat response 1:", response1.text);

const response2 = await chat.sendMessage({
message: "How many paws are in my house?",
});
console.log("Chat response 2:", response2.text);
}

await main();
Loading