Northeastern Illinois University — Introduction to Artificial Intelligence
Student: Alex Curtis API Used: Google Gemini API
This project uses the Gemini API to make 3 different API calls using Python.
The program runs in the terminal and prints the responses directly to the screen.
The 3 API calls are:
- What is machine learning?
- What is supervised learning?
- User input question for Gemini
The API key is stored safely in the env file and loaded using python-dotenv.
Clone the full course repository and navigate to this assignment's folder:
git clone https://github.com/osindy/NEIU335AI.git
cd NEIU335AI/assignments/assignment-01-apiA virtual environment isolates this project's dependencies from your system Python.
Used: # Windows (Command Prompt)
Go to the assignment folder
cd NEIU335AI/assignments/api_assignmentCreate virtual environment
python -m venv venv
venv\Scripts\activateYou should see (venv) at the start of your prompt — this confirms the environment is active.
pip install -r requirements.txtCopy the example environment file and fill in your real API key:
copy .env.example .envOpen .env in any text editor and replace the placeholder:
MY_API_KEY=your_actual_api_key_here
Important: Never commit your
.envfile. It is covered by the repo's root.gitignore.
python starter.pyYou should see formatted output in the terminal for each of the 3 API calls.
CALL 1
Machine learning enables computers to learn from data without explicit programming.
CALL 2
Supervised learning is a machine learning technique where an algorithm learns from labeled data.
CALL 3
User input: What day is it today?
Response: Today is Thursday.
Program finished successfully.