Skip to content

Commit a3ce554

Browse files
authored
Merge pull request #101 from ks6088ts-labs/feature/issue-100_customization-docs
add customization docs
2 parents daa6f98 + 0d46d1f commit a3ce554

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

apps/7_streamlit_chat_rag/README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,22 @@ To see how the RAG feature works, watch the video below.
7070

7171
[![Streamlit Chat App with RAG Feature](https://img.youtube.com/vi/ummiu-rzYvs/0.jpg)](https://youtu.be/ummiu-rzYvs)
7272

73-
### How to customize
73+
## How to customize
7474

75-
You can customize the chat app by modifying the following codes:
75+
### Customize your application purpose
7676

77-
- [main.py](./main.py): `CUSTOM_SYSTEM_PROMPT` variable which defines the system prompt
78-
- [tools/fetch_contents.py](./tools/fetch_contents.py): `fetch_contents` function comments which is passed to the LLM model
77+
The application purpose is defined in a system prompt. By default, the application provides information about the fictional company Contoso Corporation.
78+
79+
To change the behavior of the application, modify the `CUSTOM_SYSTEM_PROMPT` variable to fit your needs.
80+
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:
81+
82+
- [Prompt Engineering Guide](https://www.promptingguide.ai/)
83+
- [github.com/dahatake/ChatGPT-Prompt-Sample-Japanese/Workshop_English](https://github.com/dahatake/ChatGPT-Prompt-Sample-Japanese/tree/main/Workshop_English)
84+
85+
### Customize tools
86+
87+
As explained in the previous chapter, you can use the function calling feature to connect the LLM model to external tools and systems.
88+
To customize the tools, you have only to modify followings.
89+
90+
1. Implement your own tools just as [tools/fetch_contents.py](./tools/fetch_contents.py) does.
91+
1. Add your tool to the `tool` array in [create_agent()](./main.py) function.

apps/7_streamlit_chat_rag/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def init_messages():
8181
st.session_state.messages = [
8282
{
8383
"role": "assistant",
84-
"content": "Welcome to the internal chat service of Contoso Corporation. Please ask your questions.",
84+
"content": "Welcome to our chat service. How can I help you today?",
8585
}
8686
]
8787
st.session_state["memory"] = ConversationBufferWindowMemory(

0 commit comments

Comments
 (0)