Skip to content

Commit 4665ae7

Browse files
committed
Update to v.0.2.0b2
1 parent e790b79 commit 4665ae7

File tree

109 files changed

+5400
-2667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+5400
-2667
lines changed

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ test:
2828
pytest --cov=maxbot --cov-report html --cov-fail-under=95
2929

3030
stories:
31-
python examples/stories.py examples/hello-world
32-
python examples/stories.py examples/echo
33-
python examples/stories.py examples/restaurant
34-
python examples/stories.py examples/reservation-basic
35-
python examples/stories.py examples/reservation
36-
python examples/stories.py examples/digression-showcase
37-
python examples/stories.py examples/rpc-showcase
31+
maxbot stories -B examples/hello-world
32+
maxbot stories -B examples/echo
33+
maxbot stories -B examples/restaurant
34+
maxbot stories -B examples/reservation-basic
35+
maxbot stories -B examples/reservation
36+
maxbot stories -B examples/digression-showcase
37+
maxbot stories -B examples/rpc-showcase
3838

3939
clean:
4040
rm -f dist/maxbot-*.*.*-py3-none-any.whl

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
For detailed installation instructions, see the
3535
[documentation](https://maxbot.ai/getting-started/installation).
3636

37-
- **Operating system**: macOS / OS X · Linux
38-
- **Python version**: Python 3.9 (only 64 bit)
37+
- **Operating system**: macOS / OS X · Unix/Linux · Windows
38+
- **Python version**: Python 3.9-3.11 (only 64 bit)
3939
- **Package managers**: [pip](https://pypi.org/project/maxbot/)
4040

4141
### Pip
@@ -146,7 +146,4 @@ The **Maxbot** project is maintained by the [Maxbot team](https://maxbot.ai).
146146

147147
- Integration of deterministic dialog models (Dialog Tree, Slot Filling) with large language models (LLM) such as ChatGPT, LLaMA, etc.
148148
- Improved debugging and logging tools.
149-
- Switch from Markdown to command language (XML-based) in bot response scripts.
150-
- Improved built-in date and time extensions.
151149
- Released new examples of using the library to create complex bots.
152-
- Support for Python 3.10, 3.11.

examples/digression-showcase/stories.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@
66
response: What time do you want to go?
77
- message: What time do you close?
88
response: |
9-
The restaurant is open from 8am to 8pm.
10-
11-
What time do you want to go?
9+
<text>The restaurant is open from 8am to 8pm.</text>
10+
<text>What time do you want to go?</text>
1211
- name: digressing away from followup that allows return back
1312
turns:
1413
- message: Do you have any job openings?
1514
response: What kind of work are you interested in?
1615
- message: What are the restaurant opening hours
1716
response: |
18-
The restaurant is open from 8am to 8pm.
19-
20-
What kind of work are you interested in?
17+
<text>The restaurant is open from 8am to 8pm.</text>
18+
<text>What kind of work are you interested in?</text>
2119
- name: digression away from followup that never returns back
2220
turns:
2321
- message: Do you have any job openings?
@@ -50,9 +48,8 @@
5048
response: When do you want to go?
5149
- message: The six of us will come tomorrow at 8pm
5250
response: |
53-
OK. I am making you a reservation.
54-
55-
What kind of work are you interested in?
51+
<text>OK. I am making you a reservation.</text>
52+
<text>What kind of work are you interested in?</text>
5653
- message: I am a hostess
5754
response: |
5855
Yes, we have openings! Please come to the restaurant Monday or

examples/opening-hours/bot.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
channels:
2+
telegram:
3+
api_token: !ENV ${TELEGRAM_API_KEY}
4+
extensions:
5+
datetime: {}
6+
intents:
7+
- name: ask_open
8+
examples:
9+
- Open?
10+
- Are you open?
11+
- Are they open?
12+
- Are you working right now?
13+
- Do you work right now?
14+
dialog:
15+
- condition: intents.ask_open
16+
response: |
17+
{% set local_time = utc_time.astimezone("America/Toronto"|tz) %}
18+
{% if local_time.isoweekday() in [1, 2, 3, 4, 5] and local_time.hour >= 10 and local_time.hour < 18 %}
19+
We are open, welcome!
20+
{% else %}
21+
Now we are not woking.
22+
We are open from 10 am to 6 pm every weekday.
23+
{% endif %}
24+
- condition: true
25+
response: |
26+
I didn't understand. You can try rephrasing.

examples/opening-hours/stories.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
- name: Sunday, 10 am
2+
turns:
3+
- utc_time: "2023-05-21T14:00+00:00"
4+
message: You are open?
5+
response: Now we are not woking. We are open from 10 am to 6 pm every weekday.
6+
- name: Monday, 9 am
7+
turns:
8+
- utc_time: "2023-05-22T13:00+00:00"
9+
message: You are open?
10+
response: Now we are not woking. We are open from 10 am to 6 pm every weekday.
11+
- name: Monday, 10 am
12+
turns:
13+
- utc_time: "2023-05-22T14:00+00:00"
14+
message: You are open?
15+
response: We are open, welcome!
16+
- name: Friday, 5 pm
17+
turns:
18+
- utc_time: "2023-05-26T21:00+00:00"
19+
message: You are open?
20+
response: We are open, welcome!
21+
- name: Friday, 6 pm
22+
turns:
23+
- utc_time: "2023-05-26T22:00+00:00"
24+
message: You are open?
25+
response: Now we are not woking. We are open from 10 am to 6 pm every weekday.
26+
- name: Saturday, 10 am
27+
turns:
28+
- utc_time: "2023-05-27T14:00+00:00"
29+
message: You are open?
30+
response: Now we are not woking. We are open from 10 am to 6 pm every weekday.

examples/reservation/bot.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
extensions:
2-
format: { locale: en }
2+
babel: { locale: en }
33
datetime: {}
44
channels:
55
telegram:
@@ -50,7 +50,7 @@ dialog:
5050
prompt: |
5151
What day would you like to come in?
5252
found: |
53-
{% if slots.date|date < now|date %}
53+
{% if slots.date|date < utc_time.astimezone(""|tz)|date %}
5454
You cannot make a reservation for a day in the past.
5555
<prompt_again />
5656
{% elif not entities.time and not entities.number %}

examples/reservation/stories.yaml

Lines changed: 30 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,16 @@
1111
response: What day would you like to come in?
1212
- message: May 29, 2025
1313
response: |
14-
Thursday, May 29 it is.
15-
16-
What time do you want the reservation to be made for?
14+
<text>Thursday, May 29 it is.</text>
15+
<text>What time do you want the reservation to be made for?</text>
1716
- message: at 5 pm
1817
response: |
19-
Ok, the reservation is for 5:00 PM.
20-
21-
How many people will be dining?
18+
<text>Ok, the reservation is for 5:00 PM.</text>
19+
<text>How many people will be dining?</text>
2220
- message: "6"
2321
response: |
24-
Ok. The reservation is for 6 guests.
25-
26-
I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
22+
<text>Ok. The reservation is for 6 guests.</text>
23+
<text>I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?</text>
2724
- message: Please do.
2825
response: OK. I am making you a reservation for 6 on Thursday, May 29 at 5:00 PM.
2926

@@ -33,19 +30,16 @@
3330
response: What day would you like to come in?
3431
- message: at 5 pm
3532
response: |
36-
Ok, the reservation is for 5:00 PM.
37-
38-
What day would you like to come in?
33+
<text>Ok, the reservation is for 5:00 PM.</text>
34+
<text>What day would you like to come in?</text>
3935
- message: "6"
4036
response: |
41-
Ok. The reservation is for 6 guests.
42-
43-
What day would you like to come in?
37+
<text>Ok. The reservation is for 6 guests.</text>
38+
<text>What day would you like to come in?</text>
4439
- message: May 29, 2025
4540
response: |
46-
Thursday, May 29 it is.
47-
48-
I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
41+
<text>Thursday, May 29 it is.</text>
42+
<text>I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?</text>
4943
- message: Please do.
5044
response: OK. I am making you a reservation for 6 on Thursday, May 29 at 5:00 PM.
5145

@@ -55,9 +49,8 @@
5549
response: How many people will be dining?
5650
- message: "6"
5751
response: |
58-
Ok. The reservation is for 6 guests.
59-
60-
I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
52+
<text>Ok. The reservation is for 6 guests.</text>
53+
<text>I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?</text>
6154
- message: Please do.
6255
response: OK. I am making you a reservation for 6 on Thursday, May 29 at 5:00 PM.
6356

@@ -69,9 +62,8 @@
6962
response: How many people will be dining?
7063
- message: "6"
7164
response: |
72-
Ok. The reservation is for 6 guests.
73-
74-
I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
65+
<text>Ok. The reservation is for 6 guests.</text>
66+
<text>I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?</text>
7567
- message: Please do.
7668
response: OK. I am making you a reservation for 6 on Thursday, May 29 at 5:00 PM.
7769

@@ -90,9 +82,8 @@
9082
response: How many people will be dining?
9183
- message: "0"
9284
response: |
93-
Please specify a number that is larger than 0.
94-
95-
How many people will be dining?
85+
<text>Please specify a number that is larger than 0.</text>
86+
<text>How many people will be dining?</text>
9687
9788
- name: confirmation-not-found
9889
turns:
@@ -109,29 +100,26 @@
109100
response: I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
110101
- message: Change the reservation time to 6pm
111102
response: |
112-
Ok, the reservation is for 6:00 PM.
113-
114-
I'm going to reserve you a table for 6 on Thursday, May 29 at 6:00 PM. Should I go ahead?
103+
<text>Ok, the reservation is for 6:00 PM.</text>
104+
<text>I'm going to reserve you a table for 6 on Thursday, May 29 at 6:00 PM. Should I go ahead?</text>
115105
116106
- name: confirmation-reply-no
117107
turns:
118108
- message: Can 6 of us get a table for lunch on May 29, 2025 at 5pm?
119109
response: I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
120110
- message: Please don't.
121111
response: |
122-
Alright. Let's start over. I'll try to keep up this time.
123-
124-
What day would you like to come in?
112+
<text>Alright. Let's start over. I'll try to keep up this time.</text>
113+
<text>What day would you like to come in?</text>
125114
126115
- name: guests-previous-value
127116
turns:
128117
- message: Can 6 of us get a table for lunch on May 29, 2025 at 5pm?
129118
response: I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
130119
- message: Change the number of persons to 7
131120
response: |
132-
Ok, updating the number of guests from 6 to 7.
133-
134-
I'm going to reserve you a table for 7 on Thursday, May 29 at 5:00 PM. Should I go ahead?
121+
<text>Ok, updating the number of guests from 6 to 7.</text>
122+
<text>I'm going to reserve you a table for 7 on Thursday, May 29 at 5:00 PM. Should I go ahead?</text>
135123
136124
- name: confirmation-slot-in-focus
137125
turns:
@@ -148,17 +136,15 @@
148136
response: What day would you like to come in?
149137
- message: Nevermind
150138
response: |
151-
Ok, we'll stop there. No reservation will be made.
152-
153-
I look forward to helping you with your next reservation. Have a good day.
139+
<text>Ok, we'll stop there. No reservation will be made.</text>
140+
<text>I look forward to helping you with your next reservation. Have a good day.</text>
154141
155142
- name: time-retry-counter
156143
turns:
157144
- message: i'd like to make a reservation on May 29, 2025
158145
response: |
159-
Thursday, May 29 it is.
160-
161-
What time do you want the reservation to be made for?
146+
<text>Thursday, May 29 it is.</text>
147+
<text>What time do you want the reservation to be made for?</text>
162148
- message: orange
163149
response: |
164150
Please specify the time that you want to eat.
@@ -169,6 +155,5 @@
169155
The restaurant seats people between 9AM and 9PM.
170156
- message: purple
171157
response: |
172-
You seem to be having trouble choosing a time. I will make the reservation at 8PM for you.
173-
174-
How many people will be dining?
158+
<text>You seem to be having trouble choosing a time. I will make the reservation at 8PM for you.</text>
159+
<text>How many people will be dining?</text>

examples/restaurant/bot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ entities:
9393
dialog:
9494
- condition: intents.about_restaurant
9595
response: |
96-
![](https://raw.githubusercontent.com/maxbot-ai/misc/main/food_1.jpg)
96+
<image url="https://raw.githubusercontent.com/maxbot-ai/misc/main/food_1.jpg" />
9797
9898
Truck Stop Gourmand is the brainchild of Gloria and Fred Smith.
9999
What started out as a food truck in 2004 has expanded into a

0 commit comments

Comments
 (0)