From 20887ee5a110c6bf00923bf11544f1672302f3dc Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 27 Oct 2025 19:29:18 +0100 Subject: [PATCH] install dotenv --- .env | 1 + mixer_agent.py | 7 +++++-- requirements.txt | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .env create mode 100644 requirements.txt diff --git a/.env b/.env new file mode 100644 index 0000000..d7da4a6 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +GEMINI_API_KEY='AIzaSyCdjM5XE0hv9O1Ecx-uspvI8UInSzK1U9M' \ No newline at end of file diff --git a/mixer_agent.py b/mixer_agent.py index f1df9be..c6d800b 100644 --- a/mixer_agent.py +++ b/mixer_agent.py @@ -14,6 +14,9 @@ from typing import List, Optional from google import genai from google.genai import types +from dotenv import load_dotenv +load_dotenv() + # Configurazione mixer DEFAULT_HOST = "192.168.1.62" DEFAULT_PORT = 49280 @@ -479,7 +482,7 @@ class TF5AIAgent: self.controller = TF5MixerController(mixer_host, mixer_port) # Configura il client Gemini - api_key = 'AIzaSyCdjM5XE0hv9O1Ecx-uspvI8UInSzK1U9M' + api_key = os.getenv("GEMINI_API_KEY") if not api_key: raise ValueError("GEMINI_API_KEY non trovata nelle variabili d'ambiente") @@ -620,7 +623,7 @@ def main(): args = parser.parse_args() # Verifica che la API key sia impostata - if not 'AIzaSyCdjM5XE0hv9O1Ecx-uspvI8UInSzK1U9M': + if not os.getenv("GEMINI_API_KEY"): print("❌ Errore: GEMINI_API_KEY non trovata nelle variabili d'ambiente") print("\nPer impostare la chiave API:") print(" export GEMINI_API_KEY='la-tua-chiave-api'") diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..fe7c01a --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +dotenv