Spaces:
Sleeping
Sleeping
File size: 1,959 Bytes
243a67a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
from crewai import Agent
from langchain_google_genai import ChatGoogleGenerativeAI
from tools import pmc_search, google_scholar_search, today_tool
import os
def get_gemini_llm():
return ChatGoogleGenerativeAI(
model="gemini-pro",
google_api_key=os.getenv('GEMINI_API_KEY'),
temperature=0.5,
convert_system_message_to_human=True,
top_p=0.8,
top_k=40,
max_output_tokens=2048
)
def get_researcher_agent(verbose):
return Agent(
role="Medical Research Scientist",
goal="""Conduct thorough scientific literature review and synthesize findings into a comprehensive research summary.""",
backstory="""You are an expert medical research scientist with extensive experience in systematic reviews and meta-analyses.
You specialize in analyzing clinical studies, understanding research methodologies, and synthesizing evidence from multiple sources.
Your expertise includes critical appraisal of medical literature, statistical analysis, and identification of key clinical findings.""",
llm=get_gemini_llm(),
tools=[pmc_search, google_scholar_search],
allow_delegation=False,
verbose=verbose
)
def get_writer_agent(verbose):
return Agent(
role="Medical Writer",
goal="""Transform research findings into a well-structured, comprehensive scientific paper following academic standards.""",
backstory="""You are an experienced medical writer with expertise in creating high-quality scientific manuscripts.
You excel at organizing complex medical information, maintaining scientific accuracy, and following academic writing standards.
Your writing is clear, precise, and always supported by evidence from the literature.""",
llm=get_gemini_llm(),
tools=[today_tool],
allow_delegation=False,
verbose=verbose
) |