From 57dfe9b87c4e22ff0f06195be9cfdb79b2c1cc41 Mon Sep 17 00:00:00 2001 From: Rajtilak Bhattacharjee Date: Wed, 1 May 2024 12:17:12 +0530 Subject: [PATCH 1/2] Modify main.py and installation.md docs Add extra checks for presence of API key --- docs/getting-started/installation.md | 1 + src/main.py | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 5128f28..20ae9b1 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -18,6 +18,7 @@ These are the details you need to follow in order to make Simone work on your lo 1. Register at [OpenRouter](https://openrouter.ai/) 2. Get an API Key +3. Upload the API key in a file called `.env` at the root of the project. A sample `.env` file is given as `sample.env`, you can upload your API key in this file and rename it to `.env`. ## Installation diff --git a/src/main.py b/src/main.py index cf2958d..d2a100d 100644 --- a/src/main.py +++ b/src/main.py @@ -18,7 +18,7 @@ load_dotenv() api_key = os.getenv("GEMMA_API_KEY") -__version__ = "2.1.0" +__version__ = "2.1.1" def version_callback(value: bool): @@ -48,6 +48,14 @@ def main( ] = None, ): + if api_key: + print("GEMMA 7B API key found. Continuing execution...") + else: + print( + "Error: GEMMA 7B API key not found. Please obtain an API key from OpenRouter.ai before proceeding. Check the documentations if required.", + ) + sys.exit(1) + print("Downloading audio and video...") downloads = Downloader(f"{url}") downloads.audio() From ae268c6072c1bf002956eaae6831722e5005e3f3 Mon Sep 17 00:00:00 2001 From: Rajtilak Bhattacharjee Date: Wed, 1 May 2024 12:25:30 +0530 Subject: [PATCH 2/2] Update main.py Added import sys Signed-off-by: Rajtilak Bhattacharjee --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index d2a100d..5afe79f 100644 --- a/src/main.py +++ b/src/main.py @@ -1,6 +1,7 @@ from __future__ import annotations import os +import sys from typing import Annotated from typing import Optional