Deaksh commited on
Commit
cf2e27f
Β·
verified Β·
1 Parent(s): b4ecdbb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -9,12 +9,10 @@ from langchain.chains import RetrievalQAWithSourcesChain
9
  from langchain.text_splitter import RecursiveCharacterTextSplitter
10
  from langchain.vectorstores import FAISS
11
  from langchain_groq import ChatGroq
12
- from dotenv import load_dotenv
13
  from langchain.schema import Document
 
14
 
15
 
16
- load_dotenv() # Load environment variables from .env file
17
-
18
  st.title("RockyBot: News Research Tool πŸ“ˆ")
19
  st.sidebar.title("News Article URLs")
20
 
@@ -24,7 +22,10 @@ process_url_clicked = st.sidebar.button("Process URLs")
24
  file_path = "faiss_store_openai.pkl"
25
 
26
  main_placeholder = st.empty()
27
- llm = ChatGroq(model_name="llama-3.3-70b-versatile", temperature=0.9, max_tokens=500)
 
 
 
28
 
29
  def fetch_web_content(url):
30
  """Fetches text content from a given URL using BeautifulSoup."""
 
9
  from langchain.text_splitter import RecursiveCharacterTextSplitter
10
  from langchain.vectorstores import FAISS
11
  from langchain_groq import ChatGroq
 
12
  from langchain.schema import Document
13
+ import os
14
 
15
 
 
 
16
  st.title("RockyBot: News Research Tool πŸ“ˆ")
17
  st.sidebar.title("News Article URLs")
18
 
 
22
  file_path = "faiss_store_openai.pkl"
23
 
24
  main_placeholder = st.empty()
25
+ llm = ChatGroq(
26
+ api_key=os.environ["GROQ_API_KEY"], # This will raise an error if unset
27
+ model_name="llama3-70b-8192"
28
+ )
29
 
30
  def fetch_web_content(url):
31
  """Fetches text content from a given URL using BeautifulSoup."""