diff --git a/apps/7_streamlit_chat_rag/README.md b/apps/7_streamlit_chat_rag/README.md index 2f1769f..9119055 100644 --- a/apps/7_streamlit_chat_rag/README.md +++ b/apps/7_streamlit_chat_rag/README.md @@ -70,9 +70,22 @@ To see how the RAG feature works, watch the video below. [![Streamlit Chat App with RAG Feature](https://img.youtube.com/vi/ummiu-rzYvs/0.jpg)](https://youtu.be/ummiu-rzYvs) -### How to customize +## How to customize -You can customize the chat app by modifying the following codes: +### Customize your application purpose -- [main.py](./main.py): `CUSTOM_SYSTEM_PROMPT` variable which defines the system prompt -- [tools/fetch_contents.py](./tools/fetch_contents.py): `fetch_contents` function comments which is passed to the LLM model +The application purpose is defined in a system prompt. By default, the application provides information about the fictional company Contoso Corporation. + +To change the behavior of the application, modify the `CUSTOM_SYSTEM_PROMPT` variable to fit your needs. +Also designing prompts, so called "prompt engineering", is important to get the best results from the model. There are many resources available to help you design optimal prompts. Here are some recommendations: + +- [Prompt Engineering Guide](https://www.promptingguide.ai/) +- [github.com/dahatake/ChatGPT-Prompt-Sample-Japanese/Workshop_English](https://github.com/dahatake/ChatGPT-Prompt-Sample-Japanese/tree/main/Workshop_English) + +### Customize tools + +As explained in the previous chapter, you can use the function calling feature to connect the LLM model to external tools and systems. +To customize the tools, you have only to modify followings. + +1. Implement your own tools just as [tools/fetch_contents.py](./tools/fetch_contents.py) does. +1. Add your tool to the `tool` array in [create_agent()](./main.py) function. diff --git a/apps/7_streamlit_chat_rag/main.py b/apps/7_streamlit_chat_rag/main.py index 26ffdec..62a79ed 100644 --- a/apps/7_streamlit_chat_rag/main.py +++ b/apps/7_streamlit_chat_rag/main.py @@ -81,7 +81,7 @@ def init_messages(): st.session_state.messages = [ { "role": "assistant", - "content": "Welcome to the internal chat service of Contoso Corporation. Please ask your questions.", + "content": "Welcome to our chat service. How can I help you today?", } ] st.session_state["memory"] = ConversationBufferWindowMemory(