Skip to content

Commit dfefedb

Browse files
authored
Release v0.8 (#369)
# Changelog ## General - Framework renamed from DFF to Chatsky (#368) ## Features - New `has_text` condition for asserting that specific text is contained inside the last request (#335) - Validation stage reworked. `Pipeline.validation_stage`, `Pipeline.verbose` and `Context.validation` fields are removed. Added new type for annotating labels `dff.script.ConstLabel` (#289) - Functions `cnd.exact_match` and `check_happy_path` now accept both `Message` and `str`. The following are now equivalent: `exact_match(Message("text"))` == `exact_match("text")` (#337) - CLIMessengerInterface moved to `messengers.console` (#328) - Attachments reworked (#328): - `Session`, `Command`, `Link`, `Button`, `Keyboard` and `Attachments` classes removed, `Message.commands` field removed. - Added `CallbackQuery`, `Contact`, `Invoice`, `Poll`, `Animation`, `Sticker`, `VoiceMessage`, `VideoMessage` and `MediaGroup` classes. - Added attachment caching feature. - Added `has_callback_query` condition. - Removed `title` field from Data Attachments. Use `caption` instead. - Telegram Messenger interface reworked (#328): - Now provides methods for attachment byte download. - Added support for receiving attachment types as members of `Message.attachments`. Others may be accessed via `Message.original_message`. - Added support for sending new attachment types (`Sticker`, `Poll`, e.t.c.). - Added support for extra options such as `disable_notification`, `message_effect_id` or `caption`. - Telegram tutorials rewritten to reflect all the changes. - Added slots that simplify the process of extracting arbitrary data from user messages and accessing it later (#36): - New user guide and tutorials on slots ## Documentation - Return PRE_RESPONSE_PROCESSING and PRE_TRANSITION_PROCESSING tutorials - New telegram interface tutorials (#328) - Slots user guide and tutorials (#36) ## Contrib - Added `poe quick_test` to run tests that are not slow and do not require docker (#344) - `Context.framework_states` renamed to `Context.framework_data` and made `Pydantic.BaseModel` (#359) - Added `MessengerInterfaceWithAttachments` class (#328) - Added tools for enabling json serialization via pickle (#328) - Telegram tests made independent from telegram servers (#328) - `wrap_sync_function_in_async` moved to `utils.devel` (#36) # Checklist - [x] I have performed a self-review of the changes - [x] Rename repos (this; template; demo) - [ ] Add new logo; change favicons in conf.py (this can be done later) - [x] Create new PyPi project and update pypi token - [ ] Create a new release - [x] Make a new release on the [final_dff_release](https://github.com/deeppavlov/dialog_flow_framework/tree/final_dff_release) branch
2 parents 224eaf1 + 8c559cc commit dfefedb

File tree

246 files changed

+9208
-6186
lines changed

Some content is hidden

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

246 files changed

+9208
-6186
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.DS_Store*
22
*.egg-info/
33
dist/
4+
venv/
45
build/
56
docs/source/apiref
67
docs/source/_misc
@@ -21,6 +22,7 @@ GlobalUserTableAccessor*
2122
memory_debugging*
2223
opening_database*
2324
_globals.py
25+
venv*
2426
.vscode
2527
.coverage
2628
.coverage.*

.github/process_github_events.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ def post_comment_on_pr(comment: str, pr_number: int):
4848
- [ ] Update package version
4949
- [ ] Update `poetry.lock`
5050
- [ ] Change PR merge option
51-
- [ ] Test modules without automated testing:
52-
- [ ] Requiring telegram `api_id` and `api_hash`
53-
- [ ] Requiring `HF_API_KEY`
5451
- [ ] Search for objects to be deprecated
5552
"""
5653

.github/workflows/build_and_publish_docs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ jobs:
3939
- name: build documentation
4040
env:
4141
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
42-
TG_API_ID: ${{ secrets.TG_API_ID }}
43-
TG_API_HASH: ${{ secrets.TG_API_HASH }}
4442
TG_BOT_USERNAME: ${{ secrets.TG_BOT_USERNAME }}
4543
run: |
4644
python -m poetry run poe docs

.github/workflows/test_coverage.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ jobs:
3838
- name: run tests
3939
env:
4040
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
41-
TG_API_ID: ${{ secrets.TG_API_ID }}
42-
TG_API_HASH: ${{ secrets.TG_API_HASH }}
4341
TG_BOT_USERNAME: ${{ secrets.TG_BOT_USERNAME }}
4442
run: |
4543
python -m poetry run poe test_all

.github/workflows/test_full.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ jobs:
4040
- name: run pytest
4141
env:
4242
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
43-
TG_API_ID: ${{ secrets.TG_API_ID }}
44-
TG_API_HASH: ${{ secrets.TG_API_HASH }}
4543
TG_BOT_USERNAME: ${{ secrets.TG_BOT_USERNAME }}
4644
run: |
4745
python -m poetry run poe test_no_cov
@@ -64,8 +62,6 @@ jobs:
6462
- name: run pytest
6563
env:
6664
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
67-
TG_API_ID: ${{ secrets.TG_API_ID }}
68-
TG_API_HASH: ${{ secrets.TG_API_HASH }}
6965
TG_BOT_USERNAME: ${{ secrets.TG_BOT_USERNAME }}
7066
run: |
7167
python -m poetry run poe test_no_deps

.github/workflows/update_dashboard.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- 'master'
77
paths:
8-
- 'dff/utils/docker/**'
8+
- 'chatsky/utils/docker/**'
99
workflow_dispatch:
1010

1111
concurrency:
@@ -41,7 +41,7 @@ jobs:
4141
- name: Build and upload image
4242
uses: docker/build-push-action@v5
4343
with:
44-
context: dff/utils/docker
45-
file: dff/utils/docker/dockerfile_stats
44+
context: chatsky/utils/docker
45+
file: chatsky/utils/docker/dockerfile_stats
4646
tags: ${{ steps.meta.outputs.tags }}
4747
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.DS_Store*
22
*.egg-info/
33
dist/
4+
venv/
45
build/
56
docs/source/apiref
67
docs/source/_misc
@@ -21,6 +22,7 @@ GlobalUserTableAccessor*
2122
memory_debugging*
2223
opening_database*
2324
_globals.py
25+
venv*
2426
.vscode
2527
.coverage
2628
.coverage.*

CONTRIBUTING.md

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## Introduction
22
We will be glad to receive your pull requests (PRs) and issues for adding new features if you are missing something.
3-
We always look forward to your contributions to the Dialog Flow Framework (DFF).
3+
We always look forward to your contributions to Chatsky.
44

55
## Rules for submitting a PR
66

7-
All PRs are reviewed by DFF developers team.
7+
All PRs are reviewed by Chatsky developers team.
88
In order to make the job of reviewing easier and increase the chance that your PR will be accepted,
99
please add a short description with information about why this PR is needed and what changes will be made.
1010
Please use the following rules to write the names of branches and commit messages.
@@ -69,27 +69,9 @@ by activating the virtual environment and then running
6969
poetry run poe docs
7070
```
7171

72-
After that `docs/build` dir will be created and you can open index file `docs/build/index.html` in your browser of choice.
73-
74-
#### Documentation links
75-
76-
In your tutorials, you can use special expanding directives in markdown cells.
77-
They can help shorten the comments and avoid boilerplate code.
78-
The documentation links generated by the directives are always relative
79-
to the local documentation and verified during build.
72+
Note that you'll need `pandoc` installed on your system in order to build docs.
8073

81-
- `%pip install {args}`
82-
This directive generates dependency installation cell, adds a comment and sets up "quiet" flag.
83-
84-
It should be used in tutorials, like this: `# %pip install dff[...]`.
85-
- `%doclink({args})`
86-
This directive generates a documentation link. It supports 2 or three arguments and the generated link will look like: `ARG1/ARG2#ARG3`.
87-
88-
The first argument can be either `api` for DFF codebase, `tutorial` for tutorials or `guide` for user guides.
89-
- `%mddoclink({args})`
90-
This directive is a shortcut for `%doclink` that generates a markdown format link instead.
91-
92-
The generated link will be either `[ARG2](%doclink(ARG1,ARG2))` or `[ARG3](%doclink(ARG1,ARG2,ARG3))`.
74+
After that `docs/build` dir will be created and you can open index file `docs/build/index.html` in your browser of choice.
9375

9476
#### Documentation links
9577

@@ -101,11 +83,11 @@ to the local documentation and verified during build.
10183
- `%pip install {args}`
10284
This directive generates dependency installation cell, adds a comment and sets up "quiet" flag.
10385

104-
It should be used in tutorials, like this: `# %pip install dff[...]`.
86+
It should be used in tutorials, like this: `# %pip install chatsky[...]`.
10587
- `%doclink({args})`
10688
This directive generates a documentation link. It supports 2 or three arguments and the generated link will look like: `ARG1/ARG2#ARG3`.
10789

108-
The first argument can be either `api` for DFF codebase, `tutorial` for tutorials or `guide` for user guides.
90+
The first argument can be either `api` for Chatsky codebase, `tutorial` for tutorials or `guide` for user guides.
10991
- `%mddoclink({args})`
11092
This directive is a shortcut for `%doclink` that generates a markdown format link instead.
11193

@@ -132,6 +114,13 @@ poetry run poe test_all
132114
```
133115
for successful execution of this command `Docker` and `docker compose` are required.
134116

117+
To do a quick sanity check without the need to up docker containers or wait for long tests, run
118+
```bash
119+
poetry run poe quick_test
120+
```
121+
122+
_There's also quick_test_coverage for quick htmlcov generation, though it is very likely to be incomplete due to deselection of some tests._
123+
135124
To make sure that the code satisfies only the style requirements, run
136125
```bash
137126
poetry run poe lint
@@ -144,7 +133,7 @@ poetry run poe format
144133
Tests are configured via [`.env_file`](.env_file).
145134

146135
### Docker
147-
DFF uses docker images for two purposes:
136+
Chatsky uses docker images for two purposes:
148137
1. Database images for integration testing.
149138
2. Images for statistics collection.
150139

README.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
# Dialog Flow Framework
1+
# Chatsky
22

3-
[![Documentation Status](https://github.com/deeppavlov/dialog_flow_framework/workflows/build_and_publish_docs/badge.svg?branch=dev)](https://deeppavlov.github.io/dialog_flow_framework)
4-
[![Codestyle](https://github.com/deeppavlov/dialog_flow_framework/workflows/codestyle/badge.svg?branch=dev)](https://github.com/deeppavlov/dialog_flow_framework/actions/workflows/codestyle.yml)
5-
[![Tests](https://github.com/deeppavlov/dialog_flow_framework/workflows/test_coverage/badge.svg?branch=dev)](https://github.com/deeppavlov/dialog_flow_framework/actions/workflows/test_coverage.yml)
6-
[![License Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/deeppavlov/dialog_flow_framework/blob/master/LICENSE)
3+
[![Documentation Status](https://github.com/deeppavlov/chatsky/workflows/build_and_publish_docs/badge.svg?branch=dev)](https://deeppavlov.github.io/chatsky)
4+
[![Codestyle](https://github.com/deeppavlov/chatsky/workflows/codestyle/badge.svg?branch=dev)](https://github.com/deeppavlov/chatsky/actions/workflows/codestyle.yml)
5+
[![Tests](https://github.com/deeppavlov/chatsky/workflows/test_coverage/badge.svg?branch=dev)](https://github.com/deeppavlov/chatsky/actions/workflows/test_coverage.yml)
6+
[![License Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/deeppavlov/chatsky/blob/master/LICENSE)
77
![Python 3.8, 3.9, 3.10, 3.11](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-green.svg)
8-
[![PyPI](https://img.shields.io/pypi/v/dff)](https://pypi.org/project/dff/)
9-
[![Downloads](https://pepy.tech/badge/dff)](https://pepy.tech/project/dff)
8+
[![PyPI](https://img.shields.io/pypi/v/chatsky)](https://pypi.org/project/chatsky/)
9+
[![Downloads](https://pepy.tech/badge/chatsky)](https://pepy.tech/project/chatsky)
1010

11-
The Dialog Flow Framework (DFF) allows you to develop conversational services.
12-
DFF offers a specialized domain-specific language (DSL) for quickly writing dialogs in pure Python. The service is created by defining a special dialog graph that determines the behavior of the dialog agent. The latter is then leveraged in the DFF pipeline.
11+
Chatsky allows you to develop conversational services.
12+
Chatsky offers a specialized domain-specific language (DSL) for quickly writing dialogs in pure Python. The service is created by defining a special dialog graph that determines the behavior of the dialog agent. The latter is then leveraged in the Chatsky pipeline.
1313
You can use the framework in various services such as social networks, call centers, websites, personal assistants, etc.
1414

15-
DFF, a versatile Python-based conversational service framework, can be deployed across a spectrum of platforms,
15+
Chatsky, a versatile Python-based conversational service framework, can be deployed across a spectrum of platforms,
1616
ensuring flexibility for both novice and seasoned developers:
1717

18-
- Cloud platforms like AWS, Azure, and GCP offer scalable environments for DFF,
18+
- Cloud platforms like AWS, Azure, and GCP offer scalable environments for Chatsky,
1919
with options such as AWS Lambda and Azure Functions providing serverless execution.
20-
- For containerized deployment, Docker and Kubernetes streamline the orchestration of DFF applications.
20+
- For containerized deployment, Docker and Kubernetes streamline the orchestration of Chatsky applications.
2121
- Furthermore, the framework's adaptability extends to IoT ecosystems,
2222
making it suitable for integration with edge devices in scenarios like smart homes or industrial automation.
2323

2424
Whether deployed on cloud platforms, containerized environments, or directly on IoT devices,
25-
DFF's accessibility and customization options make it a robust choice for developing conversational services
25+
Chatsky's accessibility and customization options make it a robust choice for developing conversational services
2626
in the evolving landscape of Python applications and IoT connectivity.
2727

28-
## Why choose DFF
28+
## Why choose Chatsky
2929

3030
* Written in pure Python, the framework is easily accessible for both beginners and experienced developers.
31-
* For the same reason, all the abstractions used in DFF can be easily customized and extended using regular language synthax.
32-
* DFF offers easy and straightforward tools for state management which is as easy as setting values of a Python dictionary.
31+
* For the same reason, all the abstractions used in Chatsky can be easily customized and extended using regular language synthax.
32+
* Chatsky offers easy and straightforward tools for state management which is as easy as setting values of a Python dictionary.
3333
* The framework is being actively maintained and thoroughly tested. The team is open to suggestions and quickly reacts to bug reports.
3434

3535
# Quick Start
@@ -44,50 +44,50 @@ in the evolving landscape of Python applications and IoT connectivity.
4444

4545
## Installation
4646

47-
DFF can be installed via pip:
47+
Chatsky can be installed via pip:
4848

4949
```bash
50-
pip install dff
50+
pip install chatsky
5151
```
5252

53-
The above command will set the minimum dependencies to start working with DFF.
53+
The above command will set the minimum dependencies to start working with Chatsky.
5454
The installation process allows the user to choose from different packages based on their dependencies, which are:
5555
```bash
56-
pip install dff[json] # dependencies for using JSON
57-
pip install dff[pickle] # dependencies for using Pickle
58-
pip install dff[redis] # dependencies for using Redis
59-
pip install dff[mongodb] # dependencies for using MongoDB
60-
pip install dff[mysql] # dependencies for using MySQL
61-
pip install dff[postgresql] # dependencies for using PostgreSQL
62-
pip install dff[sqlite] # dependencies for using SQLite
63-
pip install dff[ydb] # dependencies for using Yandex Database
64-
pip install dff[telegram] # dependencies for using Telegram
65-
pip install dff[benchmark] # dependencies for benchmarking
56+
pip install chatsky[json] # dependencies for using JSON
57+
pip install chatsky[pickle] # dependencies for using Pickle
58+
pip install chatsky[redis] # dependencies for using Redis
59+
pip install chatsky[mongodb] # dependencies for using MongoDB
60+
pip install chatsky[mysql] # dependencies for using MySQL
61+
pip install chatsky[postgresql] # dependencies for using PostgreSQL
62+
pip install chatsky[sqlite] # dependencies for using SQLite
63+
pip install chatsky[ydb] # dependencies for using Yandex Database
64+
pip install chatsky[telegram] # dependencies for using Telegram
65+
pip install chatsky[benchmark] # dependencies for benchmarking
6666
```
6767

6868
For example, if you are going to use one of the database backends,
6969
you can specify the corresponding requirements yourself. Multiple dependencies can be installed at once, e.g.
7070
```bash
71-
pip install dff[postgresql,mysql]
71+
pip install chatsky[postgresql,mysql]
7272
```
7373

7474
## Basic example
7575

7676
The following code snippet builds a simplistic chat bot that replies with messages
7777
``Hi!`` and ``OK`` depending on user input, which only takes a few lines of code.
7878
All the abstractions used in this example are thoroughly explained in the dedicated
79-
[user guide](https://deeppavlov.github.io/dialog_flow_framework/user_guides/basic_conceptions.html).
79+
[user guide](https://deeppavlov.github.io/chatsky/user_guides/basic_conceptions.html).
8080

8181
```python
82-
from dff.script import GLOBAL, TRANSITIONS, RESPONSE, Message
83-
from dff.pipeline import Pipeline
84-
import dff.script.conditions.std_conditions as cnd
82+
from chatsky.script import GLOBAL, TRANSITIONS, RESPONSE, Message
83+
from chatsky.pipeline import Pipeline
84+
import chatsky.script.conditions.std_conditions as cnd
8585

8686
# create a dialog script
8787
script = {
8888
GLOBAL: {
8989
TRANSITIONS: {
90-
("flow", "node_hi"): cnd.exact_match(Message("Hi")),
90+
("flow", "node_hi"): cnd.exact_match("Hi"),
9191
("flow", "node_ok"): cnd.true()
9292
}
9393
},
@@ -129,19 +129,19 @@ Response: OK
129129
```
130130

131131
More advanced examples are available as a part of documentation:
132-
[tutorials](https://deeppavlov.github.io/dialog_flow_framework/tutorials.html).
132+
[tutorials](https://deeppavlov.github.io/chatsky/tutorials.html).
133133

134134
## Further steps
135135

136-
To further explore the API of the framework, you can make use of the [detailed documentation](https://deeppavlov.github.io/dialog_flow_framework/index.html).
137-
Broken down into several sections to highlight all the aspects of development with DFF,
136+
To further explore the API of the framework, you can make use of the [detailed documentation](https://deeppavlov.github.io/chatsky/index.html).
137+
Broken down into several sections to highlight all the aspects of development with Chatsky,
138138
the documentation for the library is constantly available online.
139139

140-
# Contributing to the Dialog Flow Framework
140+
# Contributing to Chatsky
141141

142142
We are open to accepting pull requests and bug reports.
143-
Please refer to [CONTRIBUTING.md](https://github.com/deeppavlov/dialog_flow_framework/blob/master/CONTRIBUTING.md).
143+
Please refer to [CONTRIBUTING.md](https://github.com/deeppavlov/chatsky/blob/master/CONTRIBUTING.md).
144144

145145
# License
146146

147-
DFF is distributed under the terms of the [Apache License 2.0](https://github.com/deeppavlov/dialog_flow_framework/blob/master/LICENSE).
147+
Chatsky is distributed under the terms of the [Apache License 2.0](https://github.com/deeppavlov/chatsky/blob/master/LICENSE).

dff/__init__.py renamed to chatsky/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
nest_asyncio.apply()
1212

13-
from dff.pipeline import Pipeline
14-
from dff.script import Context, Script
13+
from chatsky.pipeline import Pipeline
14+
from chatsky.script import Context, Script
1515

16-
Script.model_rebuild()
16+
import chatsky.__rebuild_pydantic_models__

0 commit comments

Comments
 (0)