Update app.py
Browse files
app.py
CHANGED
@@ -74,21 +74,18 @@ embedding_function = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2"
|
|
74 |
##########################################
|
75 |
|
76 |
|
77 |
-
|
78 |
-
# This llm definition is redundant as now models will be chosen by user
|
79 |
-
# llm = ChatGroq(
|
80 |
-
# api_key="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",
|
81 |
-
# model="llama3-70b-8192",
|
82 |
-
# # model = 'gemma-7b-it',
|
83 |
-
# temperature = 0
|
84 |
-
# # model = 'mixtral-8x7B-32768'
|
85 |
-
# )
|
86 |
|
87 |
|
88 |
|
89 |
# Get the data from NSE as pandas dataframe
|
90 |
# Function to get dataframe from NSE website
|
91 |
# Data from two pages: NSE Announcements and NSE corporate actions are fetched and hence two dataframes
|
|
|
|
|
|
|
|
|
|
|
92 |
def get_pd(d):
|
93 |
|
94 |
# Get the current date
|
@@ -234,7 +231,8 @@ def get_ca(llm,stock):
|
|
234 |
search=DuckDuckGoSearchRun()
|
235 |
|
236 |
|
237 |
-
os.environ['SERPAPI_API_KEY']=
|
|
|
238 |
from langchain_community.utilities import SerpAPIWrapper
|
239 |
search = SerpAPIWrapper()
|
240 |
|
@@ -793,7 +791,7 @@ def combined_function1(model,stock):
|
|
793 |
|
794 |
def get_model(model_name):
|
795 |
llm = ChatGroq(
|
796 |
-
api_key=
|
797 |
model=model_name,
|
798 |
max_tokens = 8192,
|
799 |
# model = 'gemma-7b-it',
|
|
|
74 |
##########################################
|
75 |
|
76 |
|
77 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
|
80 |
|
81 |
# Get the data from NSE as pandas dataframe
|
82 |
# Function to get dataframe from NSE website
|
83 |
# Data from two pages: NSE Announcements and NSE corporate actions are fetched and hence two dataframes
|
84 |
+
|
85 |
+
groq_api_key = os.getenv('groq')
|
86 |
+
serp_api_key = os.getenv('serp')
|
87 |
+
|
88 |
+
|
89 |
def get_pd(d):
|
90 |
|
91 |
# Get the current date
|
|
|
231 |
search=DuckDuckGoSearchRun()
|
232 |
|
233 |
|
234 |
+
os.environ['SERPAPI_API_KEY']= serp_api_key
|
235 |
+
|
236 |
from langchain_community.utilities import SerpAPIWrapper
|
237 |
search = SerpAPIWrapper()
|
238 |
|
|
|
791 |
|
792 |
def get_model(model_name):
|
793 |
llm = ChatGroq(
|
794 |
+
api_key=groq_api_key,
|
795 |
model=model_name,
|
796 |
max_tokens = 8192,
|
797 |
# model = 'gemma-7b-it',
|