Skip to content

Commit

Permalink
Update to v.0.2.0b2
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbot-ai committed Jun 1, 2023
1 parent e790b79 commit 4665ae7
Show file tree
Hide file tree
Showing 109 changed files with 5,400 additions and 2,667 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ test:
pytest --cov=maxbot --cov-report html --cov-fail-under=95

stories:
python examples/stories.py examples/hello-world
python examples/stories.py examples/echo
python examples/stories.py examples/restaurant
python examples/stories.py examples/reservation-basic
python examples/stories.py examples/reservation
python examples/stories.py examples/digression-showcase
python examples/stories.py examples/rpc-showcase
maxbot stories -B examples/hello-world
maxbot stories -B examples/echo
maxbot stories -B examples/restaurant
maxbot stories -B examples/reservation-basic
maxbot stories -B examples/reservation
maxbot stories -B examples/digression-showcase
maxbot stories -B examples/rpc-showcase

clean:
rm -f dist/maxbot-*.*.*-py3-none-any.whl
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
For detailed installation instructions, see the
[documentation](https://maxbot.ai/getting-started/installation).

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

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

- Integration of deterministic dialog models (Dialog Tree, Slot Filling) with large language models (LLM) such as ChatGPT, LLaMA, etc.
- Improved debugging and logging tools.
- Switch from Markdown to command language (XML-based) in bot response scripts.
- Improved built-in date and time extensions.
- Released new examples of using the library to create complex bots.
- Support for Python 3.10, 3.11.
15 changes: 6 additions & 9 deletions examples/digression-showcase/stories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
response: What time do you want to go?
- message: What time do you close?
response: |
The restaurant is open from 8am to 8pm.
What time do you want to go?
<text>The restaurant is open from 8am to 8pm.</text>
<text>What time do you want to go?</text>
- name: digressing away from followup that allows return back
turns:
- message: Do you have any job openings?
response: What kind of work are you interested in?
- message: What are the restaurant opening hours
response: |
The restaurant is open from 8am to 8pm.
What kind of work are you interested in?
<text>The restaurant is open from 8am to 8pm.</text>
<text>What kind of work are you interested in?</text>
- name: digression away from followup that never returns back
turns:
- message: Do you have any job openings?
Expand Down Expand Up @@ -50,9 +48,8 @@
response: When do you want to go?
- message: The six of us will come tomorrow at 8pm
response: |
OK. I am making you a reservation.
What kind of work are you interested in?
<text>OK. I am making you a reservation.</text>
<text>What kind of work are you interested in?</text>
- message: I am a hostess
response: |
Yes, we have openings! Please come to the restaurant Monday or
Expand Down
26 changes: 26 additions & 0 deletions examples/opening-hours/bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
channels:
telegram:
api_token: !ENV ${TELEGRAM_API_KEY}
extensions:
datetime: {}
intents:
- name: ask_open
examples:
- Open?
- Are you open?
- Are they open?
- Are you working right now?
- Do you work right now?
dialog:
- condition: intents.ask_open
response: |
{% set local_time = utc_time.astimezone("America/Toronto"|tz) %}
{% if local_time.isoweekday() in [1, 2, 3, 4, 5] and local_time.hour >= 10 and local_time.hour < 18 %}
We are open, welcome!
{% else %}
Now we are not woking.
We are open from 10 am to 6 pm every weekday.
{% endif %}
- condition: true
response: |
I didn't understand. You can try rephrasing.
30 changes: 30 additions & 0 deletions examples/opening-hours/stories.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
- name: Sunday, 10 am
turns:
- utc_time: "2023-05-21T14:00+00:00"
message: You are open?
response: Now we are not woking. We are open from 10 am to 6 pm every weekday.
- name: Monday, 9 am
turns:
- utc_time: "2023-05-22T13:00+00:00"
message: You are open?
response: Now we are not woking. We are open from 10 am to 6 pm every weekday.
- name: Monday, 10 am
turns:
- utc_time: "2023-05-22T14:00+00:00"
message: You are open?
response: We are open, welcome!
- name: Friday, 5 pm
turns:
- utc_time: "2023-05-26T21:00+00:00"
message: You are open?
response: We are open, welcome!
- name: Friday, 6 pm
turns:
- utc_time: "2023-05-26T22:00+00:00"
message: You are open?
response: Now we are not woking. We are open from 10 am to 6 pm every weekday.
- name: Saturday, 10 am
turns:
- utc_time: "2023-05-27T14:00+00:00"
message: You are open?
response: Now we are not woking. We are open from 10 am to 6 pm every weekday.
4 changes: 2 additions & 2 deletions examples/reservation/bot.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extensions:
format: { locale: en }
babel: { locale: en }
datetime: {}
channels:
telegram:
Expand Down Expand Up @@ -50,7 +50,7 @@ dialog:
prompt: |
What day would you like to come in?
found: |
{% if slots.date|date < now|date %}
{% if slots.date|date < utc_time.astimezone(""|tz)|date %}
You cannot make a reservation for a day in the past.
<prompt_again />
{% elif not entities.time and not entities.number %}
Expand Down
75 changes: 30 additions & 45 deletions examples/reservation/stories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@
response: What day would you like to come in?
- message: May 29, 2025
response: |
Thursday, May 29 it is.
What time do you want the reservation to be made for?
<text>Thursday, May 29 it is.</text>
<text>What time do you want the reservation to be made for?</text>
- message: at 5 pm
response: |
Ok, the reservation is for 5:00 PM.
How many people will be dining?
<text>Ok, the reservation is for 5:00 PM.</text>
<text>How many people will be dining?</text>
- message: "6"
response: |
Ok. The reservation is for 6 guests.
I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
<text>Ok. The reservation is for 6 guests.</text>
<text>I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?</text>
- message: Please do.
response: OK. I am making you a reservation for 6 on Thursday, May 29 at 5:00 PM.

Expand All @@ -33,19 +30,16 @@
response: What day would you like to come in?
- message: at 5 pm
response: |
Ok, the reservation is for 5:00 PM.
What day would you like to come in?
<text>Ok, the reservation is for 5:00 PM.</text>
<text>What day would you like to come in?</text>
- message: "6"
response: |
Ok. The reservation is for 6 guests.
What day would you like to come in?
<text>Ok. The reservation is for 6 guests.</text>
<text>What day would you like to come in?</text>
- message: May 29, 2025
response: |
Thursday, May 29 it is.
I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
<text>Thursday, May 29 it is.</text>
<text>I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?</text>
- message: Please do.
response: OK. I am making you a reservation for 6 on Thursday, May 29 at 5:00 PM.

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

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

Expand All @@ -90,9 +82,8 @@
response: How many people will be dining?
- message: "0"
response: |
Please specify a number that is larger than 0.
How many people will be dining?
<text>Please specify a number that is larger than 0.</text>
<text>How many people will be dining?</text>
- name: confirmation-not-found
turns:
Expand All @@ -109,29 +100,26 @@
response: I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
- message: Change the reservation time to 6pm
response: |
Ok, the reservation is for 6:00 PM.
I'm going to reserve you a table for 6 on Thursday, May 29 at 6:00 PM. Should I go ahead?
<text>Ok, the reservation is for 6:00 PM.</text>
<text>I'm going to reserve you a table for 6 on Thursday, May 29 at 6:00 PM. Should I go ahead?</text>
- name: confirmation-reply-no
turns:
- message: Can 6 of us get a table for lunch on May 29, 2025 at 5pm?
response: I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
- message: Please don't.
response: |
Alright. Let's start over. I'll try to keep up this time.
What day would you like to come in?
<text>Alright. Let's start over. I'll try to keep up this time.</text>
<text>What day would you like to come in?</text>
- name: guests-previous-value
turns:
- message: Can 6 of us get a table for lunch on May 29, 2025 at 5pm?
response: I'm going to reserve you a table for 6 on Thursday, May 29 at 5:00 PM. Should I go ahead?
- message: Change the number of persons to 7
response: |
Ok, updating the number of guests from 6 to 7.
I'm going to reserve you a table for 7 on Thursday, May 29 at 5:00 PM. Should I go ahead?
<text>Ok, updating the number of guests from 6 to 7.</text>
<text>I'm going to reserve you a table for 7 on Thursday, May 29 at 5:00 PM. Should I go ahead?</text>
- name: confirmation-slot-in-focus
turns:
Expand All @@ -148,17 +136,15 @@
response: What day would you like to come in?
- message: Nevermind
response: |
Ok, we'll stop there. No reservation will be made.
I look forward to helping you with your next reservation. Have a good day.
<text>Ok, we'll stop there. No reservation will be made.</text>
<text>I look forward to helping you with your next reservation. Have a good day.</text>
- name: time-retry-counter
turns:
- message: i'd like to make a reservation on May 29, 2025
response: |
Thursday, May 29 it is.
What time do you want the reservation to be made for?
<text>Thursday, May 29 it is.</text>
<text>What time do you want the reservation to be made for?</text>
- message: orange
response: |
Please specify the time that you want to eat.
Expand All @@ -169,6 +155,5 @@
The restaurant seats people between 9AM and 9PM.
- message: purple
response: |
You seem to be having trouble choosing a time. I will make the reservation at 8PM for you.
How many people will be dining?
<text>You seem to be having trouble choosing a time. I will make the reservation at 8PM for you.</text>
<text>How many people will be dining?</text>
2 changes: 1 addition & 1 deletion examples/restaurant/bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ entities:
dialog:
- condition: intents.about_restaurant
response: |
![](https://raw.githubusercontent.com/maxbot-ai/misc/main/food_1.jpg)
<image url="https://raw.githubusercontent.com/maxbot-ai/misc/main/food_1.jpg" />
Truck Stop Gourmand is the brainchild of Gloria and Fred Smith.
What started out as a food truck in 2004 has expanded into a
Expand Down
Loading

0 comments on commit 4665ae7

Please sign in to comment.