Skip to content

Commit cdfae50

Browse files
authored
Release v0.10.0 (#418)
# Changelog ## Breaking Changes - Dropped support for python 3.8; added support for python 3.12 (#400); - Reworked DB architecture to support partials turn reads/writes (#93). Old Context storages are incompatible with the new ones. See tutorial Context Storages: 8 for more info; - `Context.labels`, `Context.requests`, `Context.responses` are now only lazily loaded (#93). Items from older turns can be loaded on demand. Their `__getitem__` and `get` methods are now async. ## Features - Added `LLMResponse` and `LLMCondition` classes that allow using LLMs (#376). See the new LLM Integration tutorials and LLM user guide for more info; - Added option to extract group slots partially (#394). See tutorial Slots: 2 for more information; - `Message.original_message` is replaced with `Message.origin` which stores both the original message and the interface from which the message originated (#398); - Added `Context.current_turn_id` field which stores the number of the current turn (#93); - Added `Context.created_at`, `Context.updated_at` timestamp fields (#93); - Added `Context.turns` property which allows iterating over requests/labels/responses by their turn ids (#93); - `Context.labels`, `Context.requests`, `Context.responses` now support slicing (#93). `__getitem__`, `__setitem__` and `__delitem__` methods can now accept slices of turn ids in addition to single turn id. `get` method can now accepts iterable of turn ids in addition to single turn id. ## Documentation - Documentation is now versioned (#346, #409). You can select preferred version via the drop-down menu in the top-right corner. ## Developer changes - Context now has field `origin_interface` to store name of the interface that created it (#398); - Added script `docs_no_docker` for building documentation without docker (ef11ff9); - Added in-RAM context storage to be the default one instead of a plain dict (#93); - Removed methods `Context.add_request`, `Context.add_label` and `Context.add_response` (#93). Use setters with `Context.current_turn_id` instead.
2 parents 253f85c + b245b0e commit cdfae50

File tree

150 files changed

+9286
-3982
lines changed

Some content is hidden

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

150 files changed

+9286
-3982
lines changed

.env_file

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
TG_BOT_TOKEN=token
2+
OPENAI_API_KEY=api_key
3+
ANTHROPIC_API_KEY=api_key
24
MYSQL_USERNAME=root
35
MYSQL_PASSWORD=pass
46
MYSQL_ROOT_PASSWORD=pass

.github/workflows/build_and_publish_docs.yml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- dev
77
- master
88
- test/**
9+
tags:
10+
- v[0-9]+.[0-9]+.[0-9]+
911
pull_request:
1012
branches:
1113
- dev
@@ -21,6 +23,8 @@ jobs:
2123
runs-on: ubuntu-latest
2224
steps:
2325
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
2428

2529
- name: set up python 3.9
2630
uses: actions/setup-python@v5
@@ -33,40 +37,29 @@ jobs:
3337

3438
- name: setup poetry and install dependencies
3539
run: |
36-
python -m pip install --upgrade pip poetry
40+
python -m pip install --upgrade pip poetry==1.8.5
3741
python -m poetry install --with tutorials,docs --all-extras --no-ansi --no-interaction
3842
43+
- name: save docs version into a variable
44+
run: |
45+
echo "DOC_VERSION=${{ github.head_ref || github.ref_name }}" >> $GITHUB_ENV
46+
3947
- name: build documentation
4048
env:
4149
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
4250
TG_BOT_USERNAME: ${{ secrets.TG_BOT_USERNAME }}
51+
DOC_VERSION: ${{ env.DOC_VERSION }}
4352
run: |
4453
python -m poetry run poe docs
4554
46-
- name: remove jekyll theming
47-
run: touch docs/build/.nojekyll
48-
49-
- name: save branch name without slashes
50-
if: ${{ github.ref != 'refs/heads/master' }}
51-
env:
52-
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
53-
run: |
54-
BRANCH_NAME=${{ env.BRANCH_NAME }}
55-
BRANCH_NAME=${BRANCH_NAME////_}
56-
echo BRANCH_NAME=${BRANCH_NAME} >> $GITHUB_ENV
57-
58-
- name: save artifact
59-
if: ${{ github.ref != 'refs/heads/master' }}
60-
uses: actions/upload-artifact@v4
61-
with:
62-
name: ${{ format('github-pages-for-branch-{0}', env.BRANCH_NAME) }}
63-
path: docs/build/
64-
retention-days: 3
65-
6655
- name: deploy website
67-
if: ${{ github.ref == 'refs/heads/master' }}
68-
uses: JamesIves/[email protected]
56+
uses: JamesIves/github-pages-deploy-action@v4
6957
with:
7058
branch: gh-pages
7159
folder: docs/build/
72-
single-commit: True
60+
target-folder: ${{ env.DOC_VERSION }}
61+
clean: True
62+
63+
- name: print link to the documentation
64+
run: |
65+
echo "https://deeppavlov.github.io/chatsky/${{ github.head_ref || github.ref_name }}"

.github/workflows/build_and_upload_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- name: setup poetry
2424
run: |
25-
python -m pip install --upgrade pip poetry
25+
python -m pip install --upgrade pip poetry==1.8.5
2626
2727
- name: build wheels and test uploading to pypi
2828
if: startsWith(github.ref, 'refs/tags/v') != true

.github/workflows/codestyle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- name: setup poetry and install dependencies
3030
run: |
31-
python -m pip install --upgrade pip poetry
31+
python -m pip install --upgrade pip poetry==1.8.5
3232
python -m poetry install --with lint --no-ansi --no-interaction
3333
3434
- name: run codestyle
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: generate_version_switcher
2+
3+
on:
4+
workflow_run:
5+
workflows: ["build_and_publish_docs"]
6+
types:
7+
- completed
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
publish:
16+
name: generate and update version switcher's json file
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: install GitPython
24+
run: python -m pip install GitPython
25+
26+
- name: generate version switcher
27+
env:
28+
VERSION_SWITCHER_STARTING_TAG: ${{ vars.VERSION_SWITCHER_STARTING_TAG }}
29+
VERSION_SWITCHER_TAG_BLACKLIST: ${{ vars.VERSION_SWITCHER_TAG_BLACKLIST }}
30+
VERSION_SWITCHER_TAG_WHITELIST: ${{ vars.VERSION_SWITCHER_TAG_WHITELIST }}
31+
run: |
32+
python ./scripts/switcher_gen.py
33+
34+
- name: copy version switcher for updating it
35+
run: |
36+
mkdir docs/source/switcher/
37+
cp docs/source/_static/switcher.json docs/source/switcher/switcher.json
38+
39+
- name: update version switcher
40+
uses: JamesIves/github-pages-deploy-action@v4
41+
with:
42+
branch: gh-pages
43+
folder: docs/source/switcher/
44+
clean: False

.github/workflows/test_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: setup poetry and install dependencies
3434
run: |
35-
python -m pip install --upgrade pip poetry
35+
python -m pip install --upgrade pip poetry==1.8.5
3636
python -m poetry install --with test,tutorials --all-extras --no-ansi --no-interaction
3737
3838
- name: run tests

.github/workflows/test_full.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
python-version: ["3.8", "3.9", "3.10", "3.11"]
23+
python-version: ["3.9", "3.10", "3.11", "3.12"]
2424
os: [macOS-latest, windows-latest, ubuntu-latest]
2525

2626
runs-on: ${{ matrix.os }}
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: install dependencies
3636
run: |
37-
python -m pip install --upgrade pip poetry
37+
python -m pip install --upgrade pip poetry==1.8.5
3838
python -m poetry install --with test,tutorials --all-extras --no-ansi --no-interaction
3939
4040
- name: run pytest
@@ -49,14 +49,14 @@ jobs:
4949
steps:
5050
- uses: actions/checkout@v4
5151

52-
- name: set up python 3.8
52+
- name: set up python 3.9
5353
uses: actions/setup-python@v5
5454
with:
55-
python-version: 3.8
55+
python-version: 3.9
5656

5757
- name: install dependencies
5858
run: |
59-
python -m pip install --upgrade pip poetry
59+
python -m pip install --upgrade pip poetry==1.8.5
6060
python -m poetry install --with test --no-ansi --no-interaction
6161
6262
- name: run pytest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
dist/
44
venv/
55
build/
6+
dbs/
67
docs/source/apiref
78
docs/source/_misc
89
docs/source/release_notes.rst

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ Note that you'll need `pandoc` installed on your system in order to build docs.
7373

7474
After that `docs/build` dir will be created and you can open index file `docs/build/index.html` in your browser of choice.
7575

76+
You can also build docs faster without docker by running
77+
78+
```bash
79+
poetry run poe docs_no_docker
80+
```
81+
82+
Without docker some tutorials (that require docker services) will show errors and drawio diagrams will not be built.
83+
7684
#### Documentation links
7785

7886
In your tutorials, you can use special expanding directives in markdown cells.
@@ -121,6 +129,9 @@ poetry run poe quick_test
121129

122130
_There's also quick_test_coverage for quick htmlcov generation, though it is very likely to be incomplete due to deselection of some tests._
123131

132+
Both `quick_test_coverage` and `test_all` generate html coverage report.
133+
You can view it by opening the `htmlcov/index.html` file.
134+
124135
To make sure that the code satisfies only the style requirements, run
125136
```bash
126137
poetry run poe lint

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Codestyle](https://github.com/deeppavlov/chatsky/workflows/codestyle/badge.svg?branch=dev)](https://github.com/deeppavlov/chatsky/actions/workflows/codestyle.yml)
55
[![Tests](https://github.com/deeppavlov/chatsky/workflows/test_coverage/badge.svg?branch=dev)](https://github.com/deeppavlov/chatsky/actions/workflows/test_coverage.yml)
66
[![License Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/deeppavlov/chatsky/blob/master/LICENSE)
7-
![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)
7+
![Python 3.9, 3.10, 3.11, 3.12](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-green.svg)
88
[![PyPI](https://img.shields.io/pypi/v/chatsky)](https://pypi.org/project/chatsky/)
99
[![Downloads](https://static.pepy.tech/badge/chatsky)](https://pepy.tech/project/chatsky)
1010

@@ -37,7 +37,7 @@ in the evolving landscape of Python applications and IoT connectivity.
3737
## System Requirements
3838

3939
- Supported operating systems include Ubuntu 18.04+, Windows 10+ (partial support), and MacOS Big Sur (partial support);
40-
- Python version 3.8 or higher is necessary for proper functionality;
40+
- Python version 3.9 or higher is necessary for proper functionality;
4141
- A minimum of 1 GB of RAM is required for optimal performance;
4242
- If analytics collection or database integration is intended, Docker version 20 or higher may be necessary.
4343

0 commit comments

Comments
 (0)