From cb9521237002b5ca37579f8c6077528b680239e9 Mon Sep 17 00:00:00 2001 From: Ashpreet Bedi Date: Mon, 20 May 2024 13:21:38 -0700 Subject: [PATCH] v2.4.13 --- cookbook/examples/personalization/README.md | 2 +- cookbook/examples/personalization/app.py | 2 +- phi/memory/classifier.py | 11 ++++++----- pyproject.toml | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cookbook/examples/personalization/README.md b/cookbook/examples/personalization/README.md index b423f0aef..410063049 100644 --- a/cookbook/examples/personalization/README.md +++ b/cookbook/examples/personalization/README.md @@ -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/ diff --git a/cookbook/examples/personalization/app.py b/cookbook/examples/personalization/app.py index 5a3e99c49..2b10b6aab 100644 --- a/cookbook/examples/personalization/app.py +++ b/cookbook/examples/personalization/app.py @@ -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") diff --git a/phi/memory/classifier.py b/phi/memory/classifier.py index 931f41939..117fecfa8 100644 --- a/phi/memory/classifier.py +++ b/phi/memory/classifier.py @@ -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.", diff --git a/pyproject.toml b/pyproject.toml index e8e979e83..9d6be12ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"