Skip to content

Files

Latest commit

ec4ea04 · May 6, 2024

History

History

API

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 2, 2024
May 6, 2024
May 2, 2024
May 2, 2024
May 2, 2024

AI API

API endpoint providing access to Google Gemini on /api/ai/gemini-pro

Prerequisites

The API requires nodeJS v18 minimum.

The API rely on local environment variables, you can either create a .env file or if you run the API in a docker image you add the environment variables to it. Here is the list :

  • API_KEY=
  • PROJECT_ID=
  • LOCATION=
  • GEMINI_PRO_MODEL_NAME=gemini-pro
  • GOOGLE_APPLICATION_CREDENTIALS=service-principal-gemini-credential.json

==In order to get the acccess to Google APIs, you need to place a file called service-principal-gemini-credential.json in the API folder. This file must include the credentials for the service account to connect to Google APIs.==

Running the API

Start by installing the modules

npm i

Run the server

node server.js

The API will be listening on port 3001 by default.