Skip to content

Commit 9d566be

Browse files
Refine README for chat history, feedback management and prompt registry microservice (opea-project#727)
* [chat_history]: Refine README documentation Signed-off-by: Yeoh, Hoong Tee <hoong.tee.yeoh@intel.com> * [feedback_management]: Refine README documentation Signed-off-by: Yeoh, Hoong Tee <hoong.tee.yeoh@intel.com> * [prompt_registry]: Refine README documentation Signed-off-by: Yeoh, Hoong Tee <hoong.tee.yeoh@intel.com> * Fix readme typo Signed-off-by: Yeoh, Hoong Tee <hoong.tee.yeoh@intel.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Yeoh, Hoong Tee <hoong.tee.yeoh@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1f57d07 commit 9d566be

File tree

7 files changed

+353
-280
lines changed

7 files changed

+353
-280
lines changed

comps/chathistory/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# 📝 Chat History Microservice
2+
3+
The Chat History Microservice is a scalable solution for storing, retrieving and managing chat conversations using various type of databases. This microservice is designed to seamlessly integrate with OPEA chat applications, enabling data persistence and efficient management of chat histories.
4+
5+
It can be integrated into application by making HTTP requests to the provided API endpoints as shown in the flow diagram below.
6+
7+
![Flow Chart](./assets/img/chathistory_flow.png)
8+
9+
---
10+
11+
## 🛠️ Features
12+
13+
- **Store Chat Conversations**: Save chat messages user information, and metadata associated with each conversation.
14+
- **Retrieve Chat Histories**: Fetch chat histories for a specific user or retrieve a particular conversation by its unique identifier.
15+
- **Update Chat Conversations**: Modify existing chat conversations by adding new messages or updating existing ones.
16+
- **Delete Chat Conversations**: Remove chat conversations record from database.
17+
18+
---
19+
20+
## ⚙️ Implementation
21+
22+
The Chat History microservice able to support various database backends for storing the chat conversations.
23+
24+
### Chat History with MongoDB
25+
26+
For more detail, please refer to this [README](./mongo/README.md)

comps/chathistory/mongo/README.md

Lines changed: 74 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# Chat History Microservice
1+
# 📝 Chat History Microservice with MongoDB
22

3-
The Chat History Microservice allows you to store, retrieve and manage chat conversations with a MongoDB database. This microservice can be used for data persistence in OPEA chat applications, enabling you to save and access chat histories.
3+
This README provides setup guides and all the necessary information about the Chat History microservice with MongoDB database.
44

5-
It can be integrated into any application by making HTTP requests to the provided API endpoints as shown in the flow diagram below.
6-
7-
![Flow Chart](./assets/img/chathistory_flow.png)
5+
---
86

97
## Setup Environment Variables
108

@@ -17,6 +15,8 @@ export DB_NAME=${DB_NAME}
1715
export COLLECTION_NAME=${COLLECTION_NAME}
1816
```
1917

18+
---
19+
2020
## 🚀Start Microservice with Docker
2121

2222
### Build Docker Image
@@ -28,78 +28,82 @@ docker build -t opea/chathistory-mongo-server:latest --build-arg https_proxy=$ht
2828

2929
### Run Docker with CLI
3030

31-
- Run mongoDB image
32-
33-
```bash
34-
docker run -d -p 27017:27017 --name=mongo mongo:latest
35-
```
31+
- Run MongoDB image container
3632

37-
- Run the chathistory Service
33+
```bash
34+
docker run -d -p 27017:27017 --name=mongo mongo:latest
35+
```
3836

39-
```bash
40-
docker run -d --name="chathistory-mongo-server" -p 6013:6013 -p 6012:6012 -p 6014:6014 -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e no_proxy=$no_proxy -e MONGO_HOST=${MONGO_HOST} -e MONGO_PORT=${MONGO_PORT} -e DB_NAME=${DB_NAME} -e COLLECTION_NAME=${COLLECTION_NAME} opea/chathistory-mongo-server:latest
41-
```
42-
43-
## Invoke Microservice
44-
45-
Once chathistory service is up and running, users can update the database by using the below API endpoint. The API returns a unique UUID for the saved conversation.
46-
47-
```bash
48-
curl -X 'POST' \
49-
http://${host_ip}:6012/v1/chathistory/create \
50-
-H 'accept: application/json' \
51-
-H 'Content-Type: application/json' \
52-
-d '{
53-
"data": {
54-
"messages": "test Messages", "user": "test"
55-
}
56-
}'
57-
```
37+
- Run the Chat History microservice
5838

59-
- Get all the Conversations for a user
39+
```bash
40+
docker run -d --name="chathistory-mongo-server" -p 6013:6013 -p 6012:6012 -p 6014:6014 -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e no_proxy=$no_proxy -e MONGO_HOST=${MONGO_HOST} -e MONGO_PORT=${MONGO_PORT} -e DB_NAME=${DB_NAME} -e COLLECTION_NAME=$ {COLLECTION_NAME} opea/chathistory-mongo-server:latest
41+
```
6042

61-
```bash
62-
curl -X 'POST' \
63-
http://${host_ip}:6012/v1/chathistory/get \
64-
-H 'accept: application/json' \
65-
-H 'Content-Type: application/json' \
66-
-d '{
67-
"user": "test"}'
68-
```
43+
---
6944

70-
- Get specific conversation by specifying the id.
45+
## ✅ Invoke Microservice
7146

72-
```bash
73-
curl -X 'POST' \
74-
http://${host_ip}:6012/v1/chathistory/get \
75-
-H 'accept: application/json' \
76-
-H 'Content-Type: application/json' \
77-
-d '{
78-
"user": "test", "id":"668620173180b591e1e0cd74"}'
79-
```
47+
The Chat History microservice exposes the following API endpoints:
8048

81-
- Update the conversation by specifying the id.
49+
- Create new chat conversation
8250

83-
```bash
84-
curl -X 'POST' \
85-
http://${host_ip}:6012/v1/chathistory/create \
86-
-H 'accept: application/json' \
87-
-H 'Content-Type: application/json' \
88-
-d '{
89-
"data": {
90-
"messages": "test Messages Update", "user": "test"
91-
},
92-
"id":"668620173180b591e1e0cd74"
93-
}'
94-
```
51+
```bash
52+
curl -X 'POST' \
53+
http://${host_ip}:6012/v1/chathistory/create \
54+
-H 'accept: application/json' \
55+
-H 'Content-Type: application/json' \
56+
-d '{
57+
"data": {
58+
"messages": "test Messages", "user": "test"
59+
}
60+
}'
61+
```
9562

96-
- Delete a stored conversation by specifying the id.
63+
- Get all the Conversations for a user
9764

98-
```bash
99-
curl -X 'POST' \
100-
http://${host_ip}:6012/v1/chathistory/delete \
101-
-H 'accept: application/json' \
102-
-H 'Content-Type: application/json' \
103-
-d '{
104-
"user": "test", "id":"668620173180b591e1e0cd74"}'
105-
```
65+
```bash
66+
curl -X 'POST' \
67+
http://${host_ip}:6012/v1/chathistory/get \
68+
-H 'accept: application/json' \
69+
-H 'Content-Type: application/json' \
70+
-d '{
71+
"user": "test"}'
72+
```
73+
74+
- Get a specific conversation by id.
75+
76+
```bash
77+
curl -X 'POST' \
78+
http://${host_ip}:6012/v1/chathistory/get \
79+
-H 'accept: application/json' \
80+
-H 'Content-Type: application/json' \
81+
-d '{
82+
"user": "test", "id":"668620173180b591e1e0cd74"}'
83+
```
84+
85+
- Update the conversation by id.
86+
87+
```bash
88+
curl -X 'POST' \
89+
http://${host_ip}:6012/v1/chathistory/create \
90+
-H 'accept: application/json' \
91+
-H 'Content-Type: application/json' \
92+
-d '{
93+
"data": {
94+
"messages": "test Messages Update", "user": "test"
95+
},
96+
"id":"668620173180b591e1e0cd74"
97+
}'
98+
```
99+
100+
- Delete a stored conversation.
101+
102+
```bash
103+
curl -X 'POST' \
104+
http://${host_ip}:6012/v1/chathistory/delete \
105+
-H 'accept: application/json' \
106+
-H 'Content-Type: application/json' \
107+
-d '{
108+
"user": "test", "id":"668620173180b591e1e0cd74"}'
109+
```

comps/feedback_management/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# 🗨 Feedback Management Microservice
2+
3+
The Feedback Management microservice facilitates the storage and retrieval of users'feedback data by establishing a connection with the databases. This microservice is designed to seamlessly integrate with OPEA applications, enabling data persistence and efficient management of feedback data.
4+
5+
---
6+
7+
## 🛠️ Features
8+
9+
- **Store Feedback**: Save feedback data from user into database.
10+
- **Retrieve Feedback**: Fetch feedback data from database based on user or id.
11+
- **Update Feedback**: Update feedback data info in the database based on id.
12+
- **Delete Feedback**: Remove feedback record from database.
13+
14+
---
15+
16+
## ⚙️ Implementation
17+
18+
The Feedback Management microservice able to support various database backends for storing the feedback data.
19+
20+
### Feedback Management with MongoDB
21+
22+
For more detail, please refer to this [README](./mongo/README.md)

0 commit comments

Comments
 (0)