Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
services:
redis:
image: redis/redis-stack-server:latest
Expand Down
5 changes: 4 additions & 1 deletion chatterbot/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,13 @@ def next_week_day(base_date: datetime, weekday: int) -> datetime:
return day


def datetime_parsing(text: str, base_date: datetime = datetime.now()) -> list[tuple[str, datetime, tuple[int, int]]]:
def datetime_parsing(text: str, base_date: datetime = None) -> list[tuple[str, datetime, tuple[int, int]]]:
"""
Extract datetime objects from a string of text.
"""
if base_date is None:
base_date = datetime.now()

matches = []
found_array = []

Expand Down
30 changes: 13 additions & 17 deletions chatterbot/storage/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,23 +350,20 @@ def filter(self, page_size=4, **kwargs):
filter_condition = query

if 'exclude_text' in kwargs:
query = Text('text') != '|'.join([
f'%%{text}%%' for text in kwargs['exclude_text']
])
if filter_condition:
filter_condition &= query
else:
filter_condition = query
for excl_text in kwargs['exclude_text']:
query = Text('text') != excl_text
if filter_condition:
filter_condition &= query
else:
filter_condition = query

if 'exclude_text_words' in kwargs and kwargs['exclude_text_words']:
_query = '|'.join([
f'%%{text}%%' for text in kwargs['exclude_text_words']
])
query = Text('text') % f'-({_query})'
if filter_condition:
filter_condition &= query
else:
filter_condition = query
for excl_word in kwargs['exclude_text_words']:
query = Text('text') % f'-({excl_word})'
if filter_condition:
filter_condition &= query
else:
filter_condition = query

if 'persona_not_startswith' in kwargs:
_query = _escape_redis_special_characters(kwargs['persona_not_startswith'])
Expand All @@ -377,8 +374,7 @@ def filter(self, page_size=4, **kwargs):
filter_condition = query

if 'text' in kwargs:
_query = _escape_redis_special_characters(kwargs['text'])
query = Text('text') % '|'.join([f'%%{_q}%%' for _q in _query.split()])
query = Text('text') == kwargs['text']
if filter_condition:
filter_condition &= query
else:
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ version = {attr = "chatterbot.__version__"}

[project]
name = "ChatterBot"
requires-python = ">=3.9,<3.14"
requires-python = ">=3.10,<3.15"
urls = { Documentation = "https://docs.chatterbot.us", Repository = "https://github.com/gunthercox/ChatterBot", Changelog = "https://github.com/gunthercox/ChatterBot/releases" }
description = "ChatterBot is a machine learning, conversational dialog engine"
authors = [
Expand Down Expand Up @@ -56,7 +56,7 @@ classifiers = [
"Topic :: Text Processing :: Linguistic",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
]
dependencies = [
Expand All @@ -74,7 +74,7 @@ test = [
"sphinx>=5.3,<9.2",
"sphinx-sitemap>=2.6.0",
"huggingface_hub",
"django<=4.1,<6.0"
"django>=4.1,<6.0"
]
dev = [
"pint>=0.8.1",
Expand All @@ -84,10 +84,10 @@ dev = [
"openai"
]
redis = [
"redis[hiredis]>=7.0,<7.2",
"redis[hiredis]>=7.0,<7.3",
"langchain-redis<0.3.0",
"langchain-huggingface>=0.1.2,<1.3.0",
"accelerate>=1.6.0,<1.13",
"accelerate>=1.6.0,<1.14",
"sentence-transformers>=4.0.2,<5.3.0",
]
mongodb = [
Expand Down
6 changes: 3 additions & 3 deletions tests/storage/test_redis_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@


@unittest.skipIf(
sys.version_info < (3, 10),
'The Redis adapter requires Python 3.10+'
)
sys.version_info >= (3, 14),
'redisvl depends on pydantic v1 which is incompatible with Python 3.14+'
) # TODO: Remove this skip when redisvl supports pydantic v2 and Python 3.14+
class RedisStorageAdapterTestCase(TestCase):

@classmethod
Expand Down
Loading