Skip to content

Commit 2e7d066

Browse files
authored
Merge pull request #3 from AquibPy/dev
Dev
2 parents 6fd01db + e4027b5 commit 2e7d066

File tree

21 files changed

+1323
-903
lines changed

21 files changed

+1323
-903
lines changed

Dockerfile

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
FROM python:3.9-slim
2-
1+
FROM python:3.12.7-slim-bullseye
32

43
WORKDIR /app
54

6-
75
COPY requirements.txt .
86

9-
RUN apt-get update && apt-get install -y libmagic-dev
7+
RUN apt-get update && apt-get install -y \
8+
build-essential \
9+
libmagic-dev \
10+
gcc \
11+
g++ \
12+
&& rm -rf /var/lib/apt/lists/*
1013

1114
RUN pip install --upgrade pip
12-
1315
RUN pip install --no-cache-dir -r requirements.txt
1416

15-
1617
COPY . .
1718

18-
19-
EXPOSE 8000
20-
21-
22-
ENV PORT=8000
23-
24-
# Command to run the application
25-
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
19+
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "10000"]

README.md

Lines changed: 49 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -192,28 +192,7 @@ percentage, missing keywords, and profile summary.
192192
- Choose between vector search or summarization for responses.
193193
- Support for multiple Open Source LLMs models.
194194

195-
### 21. Tech News Agent using Crew ai
196-
197-
- **Route:** `/news_agent`
198-
- **Description:** This endpoint leverages AI agents to conduct research and generate articles on various tech topics. The agents are designed to uncover groundbreaking technologies and narrate compelling tech stories.
199-
- **Features:**
200-
- Accepts a `topic` parameter specifying the tech topic of interest.
201-
- Utilizes caching mechanisms for improved performance by storing and retrieving responses from Redis cache.
202-
- Integrates with MongoDB for storing endpoint usage data.
203-
- Returns articles and research findings related to the specified tech topic.
204-
- Handles exceptions gracefully and returns error messages in JSON format.
205-
206-
### 22. Query Database
207-
208-
- **Route:** `/query_db`
209-
- **Description:** This API endpoint facilitates querying SQL databases using a Cohere ReAct Agent, integrated with Langchain's SQLDBToolkit.
210-
- **Feature:**
211-
- Upload a `.db` file containing the database to be queried.
212-
- Provide a natural language prompt or query to retrieve relevant information
213-
from the database.
214-
- Utilizes a Cohere ReAct Agent to process user queries and generate responses.
215-
216-
### 23. MediGem: Medical Diagnosis AI Assistant
195+
### 21. MediGem: Medical Diagnosis AI Assistant
217196

218197
- **Route:** `/MediGem`
219198
- **Description:** This API endpoint leverages the New Google Gemini AI Model to analyze medical images and identify potential health conditions.
@@ -226,7 +205,7 @@ percentage, missing keywords, and profile summary.
226205
- **Image Quality Note:** Indicates if certain aspects are 'Unable to be determined based on the provided image.'
227206
- **Disclaimer:** Includes the disclaimer: "Consult with a Doctor before making any decisions."
228207

229-
### 24. NoteGem: Automated Note-Taking Assistant
208+
### 22. NoteGem: Automated Note-Taking Assistant
230209

231210
- **Route:** `/NoteGem`
232211
- **Description:** This API endpoint leverages the Google Gemini AI Model to generate comprehensive notes from YouTube video transcripts.
@@ -236,7 +215,50 @@ percentage, missing keywords, and profile summary.
236215
- **Error Handling for Transcripts:** If the transcript is not available, it returns a message indicating that the transcript is not available for transcription.
237216
- **AI Summary Generation:** The AI model generates a structured summary of the transcript focusing on main points, critical information, key takeaways, examples or case studies, quotes, and actionable steps.
238217

239-
### 25. Investment Risk Analyst Agent
218+
### 23. Audio Video Transcriber
219+
220+
- **Route:** `/transcriber`
221+
- **Description:** This API endpoint allows users to upload audio or video files to be transcribed into text using the OpenAI Whisper model.
222+
- **Feature:**
223+
- **File Upload:** Users can upload audio or video files in various formats.
224+
- **Transcription:** The API uses the OpenAI Whisper model to transcribe the uploaded file into text.
225+
226+
### 24. Agrilens
227+
228+
- **Route:** `/agrilens`
229+
- **Description:** This API endpoint allows users to upload agricultural images and receive AI-powered insights into crops, pests, diseases, and overall health assessment.
230+
The analysis also includes actionable recommendations for improving agricultural practices and yields.
231+
- **Features:**
232+
- **Image Upload:** Users can upload agricultural images in JPG, JPEG, or PNG formats.
233+
- **Advanced Detection:** Identifies crops, pests, diseases, and farming equipment within the uploaded image.
234+
- **Health Assessment:** Evaluates crop health, identifying stress factors or signs of disease.
235+
- **Smart Recommendations:** Provides actionable insights for enhancing agricultural productivity, such as fertilizer, pesticide, or irrigation advice.
236+
237+
### AGENTS Endpoint
238+
239+
### 1. Tech News Agent using Crew ai
240+
241+
- **Route:** `/news_agent`
242+
- **Description:** This endpoint leverages AI agents to conduct research and generate articles on various tech topics. The agents are designed to uncover groundbreaking technologies and narrate compelling tech stories.
243+
- **Features:**
244+
- Accepts a `topic` parameter specifying the tech topic of interest.
245+
- Utilizes caching mechanisms for improved performance by storing and retrieving responses from Redis cache.
246+
- Integrates with MongoDB for storing endpoint usage data.
247+
- Returns articles and research findings related to the specified tech topic.
248+
- Handles exceptions gracefully and returns error messages in JSON format.
249+
250+
### 2. Query Database
251+
252+
- **Route:** `/query_db`
253+
- **Description:** This API endpoint facilitates querying SQL databases using a Cohere ReAct Agent, integrated with Langchain's SQLDBToolkit.
254+
- **Feature:**
255+
- Upload a `.db` file containing the database to be queried.
256+
- Provide a natural language prompt or query to retrieve relevant information
257+
from the database.
258+
- Utilizes a Cohere ReAct Agent to process user queries and generate responses.
259+
260+
261+
### 3. Investment Risk Analyst Agent
240262

241263
- **Route:** `/investment_risk_agent`
242264
- **Description:** This API endpoint coordinates a team of AI agents to perform comprehensive investment risk analysis and strategy development.
@@ -247,7 +269,7 @@ percentage, missing keywords, and profile summary.
247269
- **Risk Assessment:** The risk management agent evaluates potential risks associated with the trading strategy and suggests mitigation measures.
248270
- **Execution Planning:** The execution agent develops a detailed plan for executing the trading strategy, considering the assessed risks.
249271

250-
### 26. Agent Doc
272+
### 4. Agent Doc
251273

252274
- **Route:** `/agent_doc`
253275
- **Description:** This API endpoint coordinates a team of AI agents to perform comprehensive healthcare diagnosis and treatment recommendations.
@@ -256,15 +278,7 @@ percentage, missing keywords, and profile summary.
256278
- **Diagnosis:** The diagnostician agent analyzes the input data to provide a preliminary diagnosis with possible conditions.
257279
- **Treatment Recommendations:** The treatment advisor agent formulates a suitable treatment plan based on the diagnosis and user-provided information.
258280

259-
### 27. Audio Video Transcriber
260-
261-
- **Route:** `/transcriber`
262-
- **Description:** This API endpoint allows users to upload audio or video files to be transcribed into text using the OpenAI Whisper model.
263-
- **Feature:**
264-
- **File Upload:** Users can upload audio or video files in various formats.
265-
- **Transcription:** The API uses the OpenAI Whisper model to transcribe the uploaded file into text.
266-
267-
### 28. Job Posting Agent
281+
### 5. Job Posting Agent
268282

269283
- **Route:** `/job_posting_agent`
270284
- **Description:** This API endpoint coordinates a team of AI agents to generate a detailed and engaging job posting tailored to the company's culture and values.
@@ -275,7 +289,7 @@ percentage, missing keywords, and profile summary.
275289
- **Job Posting Drafting:** The job description writer agent uses the insights to create a detailed, engaging, and enticing job posting that aligns with the company's culture and values.
276290
- **Review and Editing:** The review and editing specialist agent reviews the job posting for clarity, engagement, grammatical accuracy, and alignment with company values, refining it to ensure perfection.
277291

278-
### 29. ML Assistant Agent
292+
### 6. ML Assistant Agent
279293

280294
- **Route:** `/ml_assistant`
281295
- **Description:** This endpoint coordinates a team of AI agents to process an uploaded CSV file and a user-defined machine learning problem description. It aims to provide a clear problem definition, assess the data quality, recommend suitable machine learning models, and generate starter Python code for the project.

agents/agent_doc/agents.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
from crewai import Agent
22
from .tools import scrape_tool, search_tool
3-
from langchain_google_genai import ChatGoogleGenerativeAI
43
import os
54
import settings
65

7-
llm=ChatGoogleGenerativeAI(model=settings.GEMINI_FLASH,
8-
verbose=True,
9-
temperature=0.7,
10-
google_api_key=os.getenv("GOOGLE_API_KEY"))
6+
os.environ["GEMINI_API_KEY"] = os.environ.get('GEMINI_API_KEY')
7+
8+
llm = "gemini/gemini-1.5-flash-8b"
119

1210

1311
diagnostician = Agent(

agents/agent_doc/crew.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55

66
doc_crew = Crew(
77
agents=[diagnostician, treatment_advisor],
8-
tasks=[diagnose_task, treatment_task],
9-
verbose=2
8+
tasks=[diagnose_task, treatment_task]
109
)
1110

1211
def run_doc_crew(input_data):
1312
result = doc_crew.kickoff(inputs=input_data)
14-
return result
13+
return str(result)
1514

1615
if __name__=='__main__':
1716
doc_agent_input ={

agents/investment_risk_analyst_agent/agents.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
from .tools import search_tool,scrape_tool
33
from dotenv import load_dotenv
44
load_dotenv()
5-
from langchain_google_genai import ChatGoogleGenerativeAI
65
import os
76
import settings
87

9-
llm=ChatGoogleGenerativeAI(model=settings.GEMINI_FLASH,
10-
verbose=True,
11-
temperature=0.5,
12-
google_api_key=os.getenv("GOOGLE_API_KEY"))
8+
os.environ["GEMINI_API_KEY"] = os.environ.get('GEMINI_API_KEY')
9+
10+
llm = "gemini/gemini-1.5-flash-8b"
1311

1412
data_analyst_agent = Agent(
1513
role="Data Analyst",

agents/investment_risk_analyst_agent/crew.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
from .agents import data_analyst_agent,trading_strategy_agent,execution_agent,risk_management_agent
88
from .tasks import data_analysis_task,strategy_development_task,risk_assessment_task,execution_planning_task
99

10-
llm=ChatGoogleGenerativeAI(model="gemini-1.5-flash-latest",
11-
verbose=True,
12-
temperature=0.7,
13-
google_api_key=os.getenv("GOOGLE_API_KEY"))
10+
os.environ["GEMINI_API_KEY"] = os.environ.get('GEMINI_API_KEY')
11+
12+
llm = "gemini/gemini-1.5-flash-8b"
1413

1514

1615
financial_trading_crew = Crew(
@@ -31,7 +30,7 @@
3130

3231
def run_investment_crew(input_data):
3332
result = financial_trading_crew.kickoff(inputs=input_data)
34-
return result
33+
return str(result)
3534

3635
if __name__=='__main__':
3736
financial_trading_inputs ={

agents/job_posting_agent/agents.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
from .tools import web_search_tool, serper_search_tool
33
import os
44
import settings
5-
from langchain_google_genai import ChatGoogleGenerativeAI
65

7-
llm=ChatGoogleGenerativeAI(model=settings.GEMINI_FLASH,
8-
verbose=True,
9-
temperature=0.7,
10-
google_api_key=os.getenv("GOOGLE_API_KEY"))
6+
os.environ["GEMINI_API_KEY"] = os.environ.get('GEMINI_API_KEY')
7+
8+
llm = "gemini/gemini-1.5-flash-8b"
119

1210

1311
class JobAgents():

agents/job_posting_agent/crew.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
def run_job_crew(input_data):
3434
result = job_crew.kickoff(input_data)
35-
return result
35+
return str(result)
3636

3737
if __name__=='__main__':
3838
job_agent_input = {

agents/ml_assistant/agents.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
class MLAgents():
88
def __init__(self,model) -> None:
9-
self.llm = ChatGroq(
10-
api_key=os.environ['GROQ_API_KEY'],
11-
model_name=model)
9+
os.environ["GROQ_API_KEY"] = os.environ.get('GROQ_API_KEY')
10+
self.llm = f"groq/{model}"
1211

1312
def problem_definition_agent(self):
1413
return Agent(

agents/ml_assistant/crew.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def run_ml_crew(file_path, user_question, model="llama3-70b-8192"):
2828
# Format the input data for agents
2929
input_data = {
3030
"ml_problem": user_question,
31-
"df": df.head(),
31+
"df": df.head().to_json(orient="records"),
3232
"file_name": file_path
3333
}
3434

@@ -40,7 +40,7 @@ def run_ml_crew(file_path, user_question, model="llama3-70b-8192"):
4040
)
4141

4242
result = ml_crew.kickoff(input_data)
43-
return result
43+
return str(result)
4444

4545
if __name__=="__main__":
4646
print(run_ml_crew(file_path="data/iris.csv",

0 commit comments

Comments
 (0)