-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hizeros/feat add mem0 tutorial #898
Conversation
WalkthroughThe changes introduce a new tutorial for building a chatbot using "mem0" and Streamlit, enhancing the documentation with practical examples. A new README file for the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Chatbot
participant MemoryClient
User->>Chatbot: Ask question
Chatbot->>MemoryClient: Retrieve memories
MemoryClient-->>Chatbot: Provide relevant memories
Chatbot->>User: Respond with personalized answer
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
docs/images/Mem0-Platform-Historical-mem-Records .png
is excluded by!**/*.png
docs/images/chatbot-mem0.png
is excluded by!**/*.png
Files selected for processing (6)
- docs/_sidebar.md (1 hunks)
- docs/use_cases/chatbot-integrated-mem0.md (1 hunks)
- example/mem0/README.md (1 hunks)
- example/mem0/app.py (1 hunks)
- example/mem0/core.py (1 hunks)
- promptulate/utils/logger.py (1 hunks)
Files skipped from review due to trivial changes (2)
- docs/_sidebar.md
- example/mem0/app.py
Additional context used
LanguageTool
example/mem0/README.md
[duplication] ~1-~1: Possible typo: you repeated a word
Context: # mem0 Mem0 (pronounced “mem-zero”) enhances AI ass...(ENGLISH_WORD_REPEAT_RULE)
docs/use_cases/chatbot-integrated-mem0.md
[duplication] ~1-~1: Possible typo: you repeated a word
Context: # Build a chatbot using streamlit and mem0 Mem0 (pronounced “mem-zero”) enhances AI ass...(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~13-~13: You might be missing the article “the” here.
Context: ...treamlit_mem0` Next, let’s install all necessary libraries: ```shell pip install -U pro...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[typographical] ~165-~165: The word “Therefore” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...can see that llm has read previous chat records,Therefore, it is possible to create personalized A...(THUS_SENTENCE)
Ruff
promptulate/utils/logger.py
47-47: Line too long (91 > 88)
(E501)
example/mem0/core.py
5-5: Line too long (406 > 88)
(E501)
6-6: Line too long (160 > 88)
(E501)
7-7: Line too long (271 > 88)
(E501)
8-8: Line too long (307 > 88)
(E501)
9-9: Line too long (477 > 88)
(E501)
10-10: Line too long (401 > 88)
(E501)
11-11: Line too long (572 > 88)
(E501)
11-11: Trailing whitespace
Remove trailing whitespace
(W291)
Additional comments not posted (7)
example/mem0/README.md (3)
1-3
: Introduction section is clear and effective.The introduction effectively communicates the purpose and capabilities of
mem0
. The repetition of "mem0 Mem0" appears intentional and is not a typo.Tools
LanguageTool
[duplication] ~1-~1: Possible typo: you repeated a word
Context: # mem0 Mem0 (pronounced “mem-zero”) enhances AI ass...(ENGLISH_WORD_REPEAT_RULE)
5-5
: Example description is informative.The description provides a clear example of how
mem0
can be utilized in a practical application.
9-32
: Quick start guide is comprehensive and well-structured.The quick start guide provides detailed, step-by-step instructions that are easy to follow, covering all necessary steps to get started with
mem0
.docs/use_cases/chatbot-integrated-mem0.md (4)
1-3
: Introduction Section ReviewThe introduction provides a clear and concise overview of the
mem0
technology, its pronunciation, and its applications. This is well-written and sets a good context for the tutorial.Tools
LanguageTool
[duplication] ~1-~1: Possible typo: you repeated a word
Context: # Build a chatbot using streamlit and mem0 Mem0 (pronounced “mem-zero”) enhances AI ass...(ENGLISH_WORD_REPEAT_RULE)
9-11
: Environment Setup: Conda Environment CreationThe command for creating a new conda environment is correctly formatted and appropriate for the setup. This ensures that users start with a clean environment specific to this project.
129-162
: Running the ApplicationThe instructions for running the application are clear and provide a straightforward path for users to follow from cloning the repository to running the app. The use of shell commands is appropriate and well-documented.
32-69
: PersonalHealingAssistant Class ImplementationThe implementation of the
PersonalHealingAssistant
class is comprehensive, covering initialization, memory management, and interaction methods. The use ofMemoryClient
and the handling of user inputs and responses are well implemented. However, ensure that theconfig
parameter in theask_question
method is fully documented or explained elsewhere in the tutorial.
promptulate/utils/logger.py
Outdated
"%(asctime)s | %(levelname)s | %(name)s:%(funcName)s:%(lineno)d - %(message)s", | ||
# noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging format adjustment is appropriate but consider line length.
The repositioning of the # noqa
comment is appropriate. However, consider breaking the line to adhere to the line length standard.
Consider breaking the line to improve readability and adhere to coding standards:
- "%(asctime)s | %(levelname)s | %(name)s:%(funcName)s:%(lineno)d - %(message)s",
+ "%(asctime)s | %(levelname)s | %(name)s:%(funcName)s:%(lineno)d - "
+ "%(message)s",
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"%(asctime)s | %(levelname)s | %(name)s:%(funcName)s:%(lineno)d - %(message)s", | |
# noqa | |
"%(asctime)s | %(levelname)s | %(name)s:%(funcName)s:%(lineno)d - " | |
"%(message)s", | |
# noqa |
Tools
Ruff
47-47: Line too long (91 > 88)
(E501)
example/mem0/core.py
Outdated
SYSTEM_PROMPT = """ | ||
You are a listener, and your task is to help users sort out their emotions and thoughts. You are friendly, approachable, gentle when talking to users, and do not provide advice. You will help users explore their emotions and feelings by asking clever questions, so that you can go directly into in-depth conversations and always maintain a good chat atmosphere. Except for "you", you don't call each other. | ||
1. ** Identify and record emotions **: You will identify emotions in users 'responses and guide users to describe their emotions and what they have experienced. | ||
2. ** Empathic reply **: You show real interest in the user's experience, always show respect and understanding, and express empathy and acceptance in a gentle and cordial way. When showing empathy, you will use poetic language and metaphor to retell the user's feelings. | ||
3. ** Provide companionship and comfort value **: When negative emotions are identified in the user's answer, comfort and encourage the user, you will tell the user,"I will be here with you","Don't be afraid, you will be free" and other warm words, don't use the same comforting words repeatedly every time. | ||
4. ** Guide self-reflection **: You will ask a question at the end of each message to encourage users to reflect deeply on their emotions ** and thoughts. You will ask thoughtful questions, such as "Why do you think that?" and "Where do you feel the source of your emotions?", triggering self-reflection among users. When replying each time, limit the questions to 1-2, and use "or say" to change the answer to complex questions. Avoid making lists and never end conversations. | ||
5. After the user tells an incident and his emotional reaction, do not repeatedly ask questions about the details of the incident. You will encourage users to write their reflections in their diary, or ask users what else they think about and make interesting discoveries today, such as "I'm glad you are willing to share your emotions with me. Have you thought about any interesting topics today?"“。 | ||
6. You will obtain the user's historical chat history. Under appropriate circumstances, you can use the diary content to understand the user's status and guide the user to reflect or recognize their own emotions. For example, if a user wrote in his diary yesterday,"I feel very anxious about doing a project," then when the user initiates a chat with you for the first time today, you can ask,"Have you solved the project problem today?" Will you still feel anxious about project problems?" or "Can I hear why you feel anxious about doing a project?" and other questions. | ||
7. Decide which language to reply to the user based on the language entered by the user | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Significant enhancement to the assistant's capabilities.
The new SYSTEM_PROMPT
significantly enhances the assistant's emotional intelligence and conversational capabilities. However, consider addressing the line length issues to improve code readability and maintainability.
Consider breaking the long lines into shorter segments to adhere to coding standards. For example:
- You are a listener, and your task is to help users sort out their emotions and thoughts. You are friendly, approachable, gentle when talking to users, and do not provide advice. You will help users explore their emotions and feelings by asking clever questions, so that you can go directly into in-depth conversations and always maintain a good chat atmosphere. Except for "you", you don't call each other.
+ You are a listener, and your task is to help users sort out their emotions and thoughts. You are friendly, approachable, gentle when talking to users, and do not provide advice. You will help users explore their emotions and feelings by asking clever questions, so that you can go directly into in-depth conversations and always maintain a good chat atmosphere. Except for "you", you don't call each other.
Committable suggestion was skipped due to low confidence.
Tools
Ruff
5-5: Line too long (406 > 88)
(E501)
6-6: Line too long (160 > 88)
(E501)
7-7: Line too long (271 > 88)
(E501)
8-8: Line too long (307 > 88)
(E501)
9-9: Line too long (477 > 88)
(E501)
10-10: Line too long (401 > 88)
(E501)
11-11: Line too long (572 > 88)
(E501)
11-11: Trailing whitespace
Remove trailing whitespace
(W291)
import pne | ||
from mem0 import MemoryClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import Statements in core.py
The import statement for pne
is unclear as it's not a well-known library. Ensure that pne
is either explained earlier in the document or add a comment explaining what it is used for.
Suggest adding a comment for clarity:
+import pne # Pne is used for [purpose/explanation]
from mem0 import MemoryClient
Committable suggestion was skipped due to low confidence.
You can see that llm has read previous chat records,Therefore, it is possible to create personalized AI assistants for different users | ||
 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical Issue in Running Effect Description
The sentence structure in the running effect description is awkward due to the improper use of "Therefore" without a preceding comma.
Suggest correcting the typographical error:
-You can see that llm has read previous chat records,Therefore, it is possible to create personalized AI assistants for different users
+You can see that llm has read previous chat records, therefore, it is possible to create personalized AI assistants for different users.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
You can see that llm has read previous chat records,Therefore, it is possible to create personalized AI assistants for different users | |
 | |
You can see that llm has read previous chat records, therefore, it is possible to create personalized AI assistants for different users. | |
 |
Tools
LanguageTool
[typographical] ~165-~165: The word “Therefore” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...can see that llm has read previous chat records,Therefore, it is possible to create personalized A...(THUS_SENTENCE)
Next, let’s install all necessary libraries: | ||
|
||
```shell | ||
pip install -U promptulate streamlit mem0ai | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Library Installation Command
The pip install command is clear and includes the necessary libraries. However, consider specifying versions for the libraries to ensure compatibility and prevent potential issues with future library updates.
Suggest specifying library versions:
-pip install -U promptulate streamlit mem0ai
+pip install promptulate==1.0.0 streamlit==1.0.0 mem0ai==1.0.0
Committable suggestion was skipped due to low confidence.
Tools
LanguageTool
[uncategorized] ~13-~13: You might be missing the article “the” here.
Context: ...treamlit_mem0` Next, let’s install all necessary libraries: ```shell pip install -U pro...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
import pne | ||
import streamlit as st | ||
from core import PersonalHealingAssistant | ||
|
||
|
||
def main(): | ||
config = pne.beta.st.model_sidebar() | ||
with st.sidebar: | ||
mem0_user_id = st.text_input("mem0 user id", type="password") | ||
mem0_api_key = st.text_input( | ||
"mem0 API Key", key="provider_mem0_api_key", type="password" | ||
) | ||
|
||
st.title("PersonalHealingAssistant") | ||
st.caption( | ||
""" | ||
Personal Healing Assistant combines pne and mem0ai to create a personalized healing assistant for you \n | ||
🚀 Power by [promptulate](https://github.com/Undertone0809/promptulate) | ||
""" # noqa | ||
) | ||
st.chat_message("assistant").write( | ||
"I am your personal healing assistant, how can I help you? " | ||
) | ||
|
||
ai_assistant = PersonalHealingAssistant() | ||
|
||
if prompt := st.chat_input("Please enter what you want to know "): | ||
if not config.api_key: | ||
st.info("Please add your model API key to continue.") | ||
st.stop() | ||
|
||
if not mem0_api_key: | ||
st.error("Please provide your mem0 API Key to continue.") | ||
st.stop() | ||
|
||
ai_assistant.set_mem0_api_key(mem0_api_key) | ||
|
||
answer = ai_assistant.ask_question( | ||
question=prompt, user_id=mem0_user_id, config=config | ||
) | ||
|
||
st.chat_message("user").write(prompt) | ||
st.chat_message("assistant").write_stream(answer) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Streamlit App Implementation in app.py
The Streamlit app setup and interaction flow are well structured. The use of st.sidebar
for input collection and the main function's control flow are clear. However, the error handling for missing API keys could be improved by providing more specific messages or guidance on where to obtain these keys.
Suggest improving error messages for better user guidance:
-if not config.api_key:
+if not config.api_key:
+ st.info("API key is missing. Please obtain an API key from [source] to continue.")
-if not mem0_api_key:
+if not mem0_api_key:
+ st.error("mem0 API Key is missing. Please obtain a mem0 API Key from [source] to continue.")
Committable suggestion was skipped due to low confidence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- example/mem0/core.py (1 hunks)
Additional comments not posted (1)
example/mem0/core.py (1)
14-19
: Verify integration ofSYSTEM_PROMPT
and review class methods.The
SYSTEM_PROMPT
is integrated into themessages
list during the initialization ofPersonalHealingAssistant
. This is a crucial change as it sets the tone for all interactions handled by this class. Ensure that this integration is tested thoroughly to confirm that the prompt is correctly used in conversations.Additionally, review the methods related to memory handling and chat interactions to ensure they are robust and handle errors gracefully. Consider adding error handling for network issues or API failures, especially in methods that interact with external services like
MemoryClient
andpne.chat
.Also applies to: 19-19
Verification successful
Integration of
SYSTEM_PROMPT
is correct and functional.The
SYSTEM_PROMPT
is effectively integrated into thePersonalHealingAssistant
class. It is used as the initial context for chat interactions, and the message history is maintained throughout the interaction. Theask_question
method appropriately handles the chat flow by appending user and assistant messages, ensuring that the context set bySYSTEM_PROMPT
is preserved. No issues were found with this integration.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration of `SYSTEM_PROMPT` in chat interactions. # Test: Search for the usage of `SYSTEM_PROMPT` in chat interactions. Expect: Proper handling and usage in the flow. rg --type python -A 5 $'SYSTEM_PROMPT'Length of output: 68
Script:
#!/bin/bash # Description: Verify the integration of `SYSTEM_PROMPT` in chat interactions. # Test: Search for the usage of `SYSTEM_PROMPT` in chat interactions. Expect: Proper handling and usage in the flow. rg --type py -A 5 $'SYSTEM_PROMPT'Length of output: 18814
Script:
#!/bin/bash # Description: Verify how `self.messages` is used in `example/mem0/core.py` to ensure `SYSTEM_PROMPT` is utilized correctly. # Test: Search for the usage of `self.messages` in `example/mem0/core.py`. rg --type py 'self\.messages' -A 5Length of output: 4053
SYSTEM_PROMPT = """ | ||
You are a listener, and your task is to help users sort out their emotions and thoughts. You are friendly, approachable, gentle when talking to users, and do not provide advice. You will help users explore their emotions and feelings by asking clever questions, so that you can go directly into in-depth conversations and always maintain a good chat atmosphere. Except for "you", you don't call each other. | ||
1. ** Identify and record emotions **: You will identify emotions in users 'responses and guide users to describe their emotions and what they have experienced. | ||
2. ** Empathic reply **: You show real interest in the user's experience, always show respect and understanding, and express empathy and acceptance in a gentle and cordial way. When showing empathy, you will use poetic language and metaphor to retell the user's feelings. | ||
3. ** Provide companionship and comfort value **: When negative emotions are identified in the user's answer, comfort and encourage the user, you will tell the user,"I will be here with you","Don't be afraid, you will be free" and other warm words, don't use the same comforting words repeatedly every time. | ||
4. ** Guide self-reflection **: You will ask a question at the end of each message to encourage users to reflect deeply on their emotions ** and thoughts. You will ask thoughtful questions, such as "Why do you think that?" and "Where do you feel the source of your emotions?", triggering self-reflection among users. When replying each time, limit the questions to 1-2, and use "or say" to change the answer to complex questions. Avoid making lists and never end conversations. | ||
5. After the user tells an incident and his emotional reaction, do not repeatedly ask questions about the details of the incident. You will encourage users to write their reflections in their diary, or ask users what else they think about and make interesting discoveries today, such as "I'm glad you are willing to share your emotions with me. Have you thought about any interesting topics today?"“。 | ||
6. You will obtain the user's historical chat history. Under appropriate circumstances, you can use the diary content to understand the user's status and guide the user to reflect or recognize their own emotions. For example, if a user wrote in his diary yesterday,"I feel very anxious about doing a project," then when the user initiates a chat with you for the first time today, you can ask,"Have you solved the project problem today?" Will you still feel anxious about project problems?" or "Can I hear why you feel anxious about doing a project?" and other questions. | ||
7. Decide which language to reply to the user based on the language entered by the user | ||
""" # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor SYSTEM_PROMPT
for readability and maintainability.
The SYSTEM_PROMPT
variable contains several lines that exceed the typical length limit for code readability (88 characters). This can make the code hard to read and maintain. Consider breaking these lines into shorter segments to adhere to coding standards. Additionally, ensure that the markdown syntax within the string is correctly formatted to avoid rendering issues in the output.
Here's a suggested refactor for better readability:
- You are a listener, and your task is to help users sort out their emotions and thoughts. You are friendly, approachable, gentle when talking to users, and do not provide advice. You will help users explore their emotions and feelings by asking clever questions, so that you can go directly into in-depth conversations and always maintain a good chat atmosphere. Except for "you", you don't call each other.
+ You are a listener, and your task is to help users sort out their emotions and thoughts. You are friendly, approachable, and gentle when talking to users. You do not provide advice but help users explore their emotions and feelings by asking clever questions. This approach facilitates in-depth conversations and maintains a good chat atmosphere. Avoid using personal pronouns other than "you".
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
SYSTEM_PROMPT = """ | |
You are a listener, and your task is to help users sort out their emotions and thoughts. You are friendly, approachable, gentle when talking to users, and do not provide advice. You will help users explore their emotions and feelings by asking clever questions, so that you can go directly into in-depth conversations and always maintain a good chat atmosphere. Except for "you", you don't call each other. | |
1. ** Identify and record emotions **: You will identify emotions in users 'responses and guide users to describe their emotions and what they have experienced. | |
2. ** Empathic reply **: You show real interest in the user's experience, always show respect and understanding, and express empathy and acceptance in a gentle and cordial way. When showing empathy, you will use poetic language and metaphor to retell the user's feelings. | |
3. ** Provide companionship and comfort value **: When negative emotions are identified in the user's answer, comfort and encourage the user, you will tell the user,"I will be here with you","Don't be afraid, you will be free" and other warm words, don't use the same comforting words repeatedly every time. | |
4. ** Guide self-reflection **: You will ask a question at the end of each message to encourage users to reflect deeply on their emotions ** and thoughts. You will ask thoughtful questions, such as "Why do you think that?" and "Where do you feel the source of your emotions?", triggering self-reflection among users. When replying each time, limit the questions to 1-2, and use "or say" to change the answer to complex questions. Avoid making lists and never end conversations. | |
5. After the user tells an incident and his emotional reaction, do not repeatedly ask questions about the details of the incident. You will encourage users to write their reflections in their diary, or ask users what else they think about and make interesting discoveries today, such as "I'm glad you are willing to share your emotions with me. Have you thought about any interesting topics today?"“。 | |
6. You will obtain the user's historical chat history. Under appropriate circumstances, you can use the diary content to understand the user's status and guide the user to reflect or recognize their own emotions. For example, if a user wrote in his diary yesterday,"I feel very anxious about doing a project," then when the user initiates a chat with you for the first time today, you can ask,"Have you solved the project problem today?" Will you still feel anxious about project problems?" or "Can I hear why you feel anxious about doing a project?" and other questions. | |
7. Decide which language to reply to the user based on the language entered by the user | |
""" # noqa | |
SYSTEM_PROMPT = """ | |
You are a listener, and your task is to help users sort out their emotions and thoughts. You are friendly, approachable, and gentle when talking to users. You do not provide advice but help users explore their emotions and feelings by asking clever questions. This approach facilitates in-depth conversations and maintains a good chat atmosphere. Avoid using personal pronouns other than "you". | |
1. ** Identify and record emotions **: You will identify emotions in users 'responses and guide users to describe their emotions and what they have experienced. | |
2. ** Empathic reply **: You show real interest in the user's experience, always show respect and understanding, and express empathy and acceptance in a gentle and cordial way. When showing empathy, you will use poetic language and metaphor to retell the user's feelings. | |
3. ** Provide companionship and comfort value **: When negative emotions are identified in the user's answer, comfort and encourage the user, you will tell the user,"I will be here with you","Don't be afraid, you will be free" and other warm words, don't use the same comforting words repeatedly every time. | |
4. ** Guide self-reflection **: You will ask a question at the end of each message to encourage users to reflect deeply on their emotions ** and thoughts. You will ask thoughtful questions, such as "Why do you think that?" and "Where do you feel the source of your emotions?", triggering self-reflection among users. When replying each time, limit the questions to 1-2, and use "or say" to change the answer to complex questions. Avoid making lists and never end conversations. | |
5. After the user tells an incident and his emotional reaction, do not repeatedly ask questions about the details of the incident. You will encourage users to write their reflections in their diary, or ask users what else they think about and make interesting discoveries today, such as "I'm glad you are willing to share your emotions with me. Have you thought about any interesting topics today?""。 | |
6. You will obtain the user's historical chat history. Under appropriate circumstances, you can use the diary content to understand the user's status and guide the user to reflect or recognize their own emotions. For example, if a user wrote in his diary yesterday,"I feel very anxious about doing a project," then when the user initiates a chat with you for the first time today, you can ask,"Have you solved the project problem today?" Will you still feel anxious about project problems?" or "Can I hear why you feel anxious about doing a project?" and other questions. | |
7. Decide which language to reply to the user based on the language entered by the user | |
""" # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Summary by CodeRabbit
New Features
Improvements
Bug Fixes