Update api.py
Browse files
api.py
CHANGED
|
@@ -23,13 +23,9 @@ except ImportError as e:
|
|
| 23 |
# You might want to exit or raise a clearer error if imports fail
|
| 24 |
raise
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
from google.generativeai.types import GenerationConfig, Content, Part # Corrected import path
|
| 30 |
-
except ImportError:
|
| 31 |
-
print("google.generativeai library not found. Please install it: pip install google-generativeai")
|
| 32 |
-
genai = None # Set to None if import fails
|
| 33 |
|
| 34 |
# Configure logging for the API
|
| 35 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
|
|
| 23 |
# You might want to exit or raise a clearer error if imports fail
|
| 24 |
raise
|
| 25 |
|
| 26 |
+
|
| 27 |
+
import google.generativeai as genai
|
| 28 |
+
from google.generativeai.types import GenerationConfig, Content, Part # Corrected import path
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
# Configure logging for the API
|
| 31 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|