Prathamesh1420 commited on
Commit
4546f56
1 Parent(s): 81a7e89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -4,13 +4,13 @@ from langchain_google_genai import ChatGoogleGenerativeAI
4
  from dotenv import load_dotenv
5
  import os
6
  import asyncio
 
7
 
8
  # Load environment variables
9
  load_dotenv()
10
 
11
- # Ensure an event loop is available
12
- if not asyncio.get_event_loop_policy().get_event_loop():
13
- asyncio.set_event_loop(asyncio.new_event_loop())
14
 
15
  # Initialize Google Gemini AI
16
  llm = ChatGoogleGenerativeAI(
 
4
  from dotenv import load_dotenv
5
  import os
6
  import asyncio
7
+ import nest_asyncio
8
 
9
  # Load environment variables
10
  load_dotenv()
11
 
12
+ # Apply nest_asyncio to allow nested event loops
13
+ nest_asyncio.apply()
 
14
 
15
  # Initialize Google Gemini AI
16
  llm = ChatGoogleGenerativeAI(