Skip to content

A MagicMirror module that generates a random fact from questions submitted to the Google Gemini AI

Notifications You must be signed in to change notification settings

mlcampbe/MMM-GeminiAiFact

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Module: MMM-GeminiAIFact

This MagicMirror module generates a random fact from the following questions submitted to the Google Gemini AI:

  • Tell me a fun fact in 50 words or less
  • Tell me an interesting fact about an animal in <country> in 50 words or less
  • Tell me an interesting fact about the country <country> in 50 words or less
  • Tell me about a famous historical figure from <country> in 50 words or less
  • Tell me about a notable historical event that happened in <country> in 50 words or less
  • Tell me about a notable world record in 50 words or less
  • Tell me an interesting sporting event that happened in <country> in 50 words or less
  • Tell me an odd but true fact in 50 words or less

Inspired by the quotes shown on the MagInkDash project.

Magic-Mirror Module MMM-GeminiAIFact screenshot

Tested with:

  • Raspberry Pi

Dependencies

Installation

Navigate into your MagicMirror's modules folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/mlcampbe/MMM-GeminiAIFact

Navigate to the new MMM-GeminiAIFact folder and install the node dependencies.

cd MMM-GeminiAIFact/ && npm install

Configure the module in your config.js file.

Update the module

Navigate into the MMM-GeminiAIFact folder with cd ~/MagicMirror/modules/MMM-GeminiAIFact and get the latest code from Github with git pull.

If you haven't made any manual changes to the module, this should work without any problems. Type git status to see your changes and if there are any you can reset them with git reset --hard. After that, git pull should be possible.

Using the module

To use this module, add it to the modules array in the config/config.js file:

modules: [
	{
		module: 'MMM-GeminiAIFact',
		position: 'top_right', // This can be any of the regions.
		config: {
			updateInterval: 3600000, // every 1 hour
			geminiApiKey: " xxxxxx", // your Gemini API Key
			model: "gemini-1.5-flash-8b", // which Gemini AI model to use
		},
	},
]

Configuration options

The following properties can be configured:

Option Description
updateInterval How often does the content needs to be fetched? (Milliseconds)
Possible values: 1000 - 86400000
Default value: 3600000 (1 hour)
geminiApiKey Your Google Gemini API Key value
Default value: XXXXXX (dummy value, must be set)
model Which Gemini AI model to use for the fact generation
Default value: gemini-1.5-flash-8b

About

A MagicMirror module that generates a random fact from questions submitted to the Google Gemini AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published