Skip to content

Commit

Permalink
v2.4.13
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed May 20, 2024
1 parent 03c8459 commit cb95212
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cookbook/examples/personalization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ streamlit run cookbook/examples/personalization/app.py

- Open [localhost:8501](http://localhost:8501) to view the streamlit app.
- Enter a username to associate with the memory.
- Add to memory: "Call me bestie"
- Add to memory: "Refer to me as bestie"
- Add to memory: "Always respond with a nice greeting and salutation"
- Add to memory: "I like docs so add a dog pun in the response"
- Add a website to the knowledge base: https://techcrunch.com/2024/04/18/meta-releases-llama-3-claims-its-among-the-best-open-models-available/
Expand Down
2 changes: 1 addition & 1 deletion cookbook/examples/personalization/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

with st.expander(":rainbow[:point_down: How to use]"):
st.markdown("Tell the Assistant about your preferences and they will remember them across conversations.")
st.markdown("- Call me bestie")
st.markdown("- Refer to me as bestie")
st.markdown("- Always respond with a nice greeting and salutation")
st.markdown("- I like dogs so add a dog pun in the response")

Expand Down
11 changes: 6 additions & 5 deletions phi/memory/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ def get_system_prompt(self) -> Optional[str]:

# -*- Build a default system prompt for classification
system_prompt_lines = [
"Your task is to analyze the user's message and determine if it is worth remembering for future conversations.",
"The goal is to identify any noteworthy information that could be useful for personalizing the user experience.",
"This includes a broad range of details that could enhance the quality and personalization of ongoing interactions, such as:\n"
"Your task is to identify if the user's message contains information that is worth remembering for future conversations.",
"This includes details that could personalize ongoing interactions with the user, such as:\n"
" - Personal facts: name, age, occupation, location, interests, preferences, etc.\n"
" - Significant life events or experiences shared by the user\n"
" - Important context about the user's current situation, challenges or goals\n"
" - What the user likes or dislikes, their opinions, beliefs, values, etc.\n"
" - Any other details that provide valuable insights into the user's personality, perspective or needs",
"If the user input contains any such noteworthy information, respond with 'yes' to add it to the long-term memory.",
"Your task is to decide whether the user input contains any of the above information worth remembering.",
"If the user input contains any information worth remembering for future conversations, respond with 'yes'.",
"If the input does not contain any important details worth saving, respond with 'no' to disregard it.",
"You will also be provided with a list of existing memories to help you make an informed decision.",
"You will also be provided with a list of existing memories to help you decide if the input is new or already known.",
"If the memory already exists that matches the input, respond with 'no' to keep it as is.",
"If a memory exists that needs to be updated or deleted, respond with 'yes' to update/delete it.",
"You must only respond with 'yes' or 'no'. Nothing else will be considered as a valid response.",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "phidata"
version = "2.4.12"
version = "2.4.13"
description = "Memory, knowledge and tools for LLMs."
requires-python = ">=3.7"
readme = "README.md"
Expand Down

0 comments on commit cb95212

Please sign in to comment.