Skip to content

Commit

Permalink
Refactors home.constants package
Browse files Browse the repository at this point in the history
  • Loading branch information
sajedjalil committed Oct 2, 2024
1 parent 790e952 commit 635f8b1
Showing 2 changed files with 13 additions and 11 deletions.
10 changes: 6 additions & 4 deletions home/constants/chat_models.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
from langchain_anthropic import ChatAnthropic
from langchain_google_genai import GoogleGenerativeAI
from langchain_openai import ChatOpenAI
# from langchain_google_genai import GoogleGenerativeAI
# from langchain_openai import ChatOpenAI

"""Place to define & configure your LLM models"""

# Anthropic Models
model_claude_3_haiku = ChatAnthropic(model="claude-3-haiku-20240307", temperature=0)
model_claude_3_5_sonnet = ChatAnthropic(model="claude-3-5-sonnet-20240620", temperature=0)

# Google Gemini Models - Warning: Found it low performing with both Langchain and function calling
model_gemini_1_5_flash = GoogleGenerativeAI(model="gemini-1.5-flash", temperature=0)
model_gemini_1_5_pro = GoogleGenerativeAI(model="gemini-1.5-pro", temperature=0)
# model_gemini_1_5_flash = GoogleGenerativeAI(model="gemini-1.5-flash", temperature=0)
# model_gemini_1_5_pro = GoogleGenerativeAI(model="gemini-1.5-pro", temperature=0)

# OpenAI Models
# model_gpt_3_5_turbo_0125 = ChatOpenAI(model="gpt-3.5-turbo-0125", temperature=0)
# model_chatgpt_4o = ChatOpenAI(model="chatgpt-4o-latest", temperature=0)
14 changes: 7 additions & 7 deletions home/constants/constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# prompt used for summarization node.
summary_prompt = ("Create a summary of the conversation above. Try to summarize within 150 words. Do not mention "
"anything in response like total word count, or anything other than the summary")

# Starts summarizing when we reach summarize_trigger_count amount chat combining both AI and user
summarize_trigger_count = 4

# prompt used for llm_graph with tool call and summarization
llm_prompt_text = '''You are a helpful AI medical assistant namely Patient Chat and are developed by a software
engineer named Sajed. You should only respond to health-related topics such as:
- General human health and lifestyle
@@ -12,11 +16,13 @@
modify appointments and medication changes. You should filter out and ignore any unrelated, overly sensitive,
or controversial topics.'''

# prompt used for RAG architecture and knowledge graph.
rag_prompt_text = '''You are a helpful AI medical assistant specialized in summarizing personal medical data,
health issues and their connection to various given symptoms. You also take account patient name, age,
medical conditions and medications. You will build your responses based on these information and other provided
medical knowledge.'''

# Sample one pair of user and assistant history for various tests
history_one_turn = history = [
{
"role": "user",
@@ -30,6 +36,7 @@
},
]

# Sample two pairs of user and assistant history for various tests
history_two_turns = [
{
"role": "user",
@@ -50,10 +57,3 @@
"content": "I am doing great."
}
]

knowledge_text = """Marie Curie, born in 1867, was a Polish and naturalised-French physicist and chemist who
conducted pioneering research on radioactivity. She was the first woman to win a Nobel Prize, the first person to win
a Nobel Prize twice, and the only person to win a Nobel Prize in two scientific fields. Her husband, Pierre Curie,
was a co-winner of her first Nobel Prize, making them the first-ever married couple to win the Nobel Prize and
launching the Curie family legacy of five Nobel Prizes. She was, in 1906, the first woman to become a professor at
the University of Paris. She also won a US presidential award."""

0 comments on commit 635f8b1

Please sign in to comment.