Spaces:
Sleeping
Sleeping
Commit
·
de00c34
1
Parent(s):
025a7d5
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,35 @@ from langchain.chat_models import ChatOpenAI
|
|
9 |
from langchain.prompts import ChatPromptTemplate
|
10 |
from langchain.chains import LLMChain, SequentialChain
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
# LangChain function for company analysis
|
13 |
|
14 |
def company_analysis(api_key: str, company_name: str) -> dict:
|
|
|
9 |
from langchain.prompts import ChatPromptTemplate
|
10 |
from langchain.chains import LLMChain, SequentialChain
|
11 |
|
12 |
+
from textwrap import dedent
|
13 |
+
import google.generativeai as genai
|
14 |
+
|
15 |
+
# Tool import
|
16 |
+
from crewai.tools.gemini_tools import GeminiSearchTools
|
17 |
+
from langchain.tools.yahoo_finance_news import YahooFinanceNewsTool
|
18 |
+
from crewai.tools.browser_tools import BrowserTools
|
19 |
+
from crewai.tools.sec_tools import SECTools
|
20 |
+
|
21 |
+
# Google Langchain
|
22 |
+
from langchain_google_genai import GoogleGenerativeAI
|
23 |
+
|
24 |
+
#Crew imports
|
25 |
+
from crewai import Agent, Task, Crew, Process
|
26 |
+
|
27 |
+
# Retrieve API Key from Environment Variable
|
28 |
+
GOOGLE_AI_STUDIO = os.environ.get('GOOGLE_API_KEY')
|
29 |
+
|
30 |
+
# Ensure the API key is available
|
31 |
+
if not GOOGLE_AI_STUDIO:
|
32 |
+
raise ValueError("API key not found. Please set the GOOGLE_AI_STUDIO2 environment variable.")
|
33 |
+
|
34 |
+
# Set gemini_llm
|
35 |
+
gemini_llm = GoogleGenerativeAI(model="gemini-pro", google_api_key=GOOGLE_AI_STUDIO)
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
# LangChain function for company analysis
|
42 |
|
43 |
def company_analysis(api_key: str, company_name: str) -> dict:
|