Skip to content

Commit f4cf486

Browse files
committed
Merge branch 'master' of github.com:Robstei/chatbotsclient
2 parents b4e253b + e1d560e commit f4cf486

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
pip install spacy
55
python -m spacy download en_core_web_lg
66
```
7-
### Install
7+
### Install & Upgrade
88
```
9-
pip install https://github.com/Robstei/chatbotsclient/releases/download/1.0.0/chatbotsclient-1.0.0.tar.gz
10-
```
11-
### Upgrade
12-
```
13-
pip install -U https://github.com/Robstei/chatbotsclient/releases/download/1.0.0/chatbotsclient-1.0.0.tar.gz
9+
pip install -U https://github.com/Robstei/chatbotsclient/releases/download/1.0.1/chatbotsclient-1.0.1.tar.gz
1410
```
1511
## Usage
1612
This package consists of a <code>Moderator</code> and a <code>Chatbot</code> class to make chatbots talk to each other. It is required to have a moderator instance up running before chatbots try to connect to the conversation. Messages are sent through websocket channels using [pusher](https://pusher.com/). The moderator collects all messages from connected chatbots and selects the best fit.
@@ -32,6 +28,17 @@ Before connecting your chatbot to the conversation wait for the moderator to pro
3228

3329
While the conversation is ongoing the moderator script will prompt message scores. Chatbots will only respond to messages of other chatbots.
3430

31+
#### Moderator Panel
32+
When passing <code>connect_panel=True</code> panel mode is activated. The moderator panel is located at <code>chatting-chatbots/moderator/panel</code> inside the chatting-chatbots repository.
33+
34+
```python
35+
# chatting-chatbots/moderator/moderator.py
36+
from chatbotsclient.moderator import Moderator
37+
38+
moderator = Moderator(connect_panel=True)
39+
```
40+
![image](https://user-images.githubusercontent.com/33390325/212190390-8331802d-9585-49c8-857c-dba5d68073e6.png)
41+
3542
### Chatbot
3643
#### Basic Setup
3744
Instantiate a <code>Chatbot</code> object and pass your custom respond function. When ever a message from the moderator is received the provided respond method will be executed. The moderator script must run in first place.
@@ -70,6 +77,7 @@ def respond(message: Message, conversation: List[Message]):
7077
A <code>Message</code> object is passed to the custom respond function of your bot. It contains the plain text message as well as information about the sending bot.
7178
|Field|Description|
7279
|---|---|
80+
|id|Unique identifier to allocate chatbot responses.|
7381
|message|Plain text message. Used to compute your chatbots answer.|
7482
|bot_id|Id of the sending bot.|
7583
|bot_name|Name of the sending bot. Could be used for entity replacement.|

0 commit comments

Comments
 (0)