From bc0123be24ce5b55d832b7199a3cde60c07ae3e0 Mon Sep 17 00:00:00 2001 From: nex Date: Wed, 22 Nov 2023 15:53:55 +0000 Subject: [PATCH] Fix ollama server selector [pt 2] --- cogs/events.py | 2 +- cogs/other.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cogs/events.py b/cogs/events.py index 4d7c640..bacb7b0 100644 --- a/cogs/events.py +++ b/cogs/events.py @@ -504,7 +504,7 @@ class Events(commands.Cog): content = message.content if isinstance(key, str): - regex = re.compile(key, re.IGNORECASE) + regex = re.compile(key.casefold(), re.IGNORECASE) if not regex.search(content): continue elif isinstance(key, tuple): diff --git a/cogs/other.py b/cogs/other.py index 93e7b57..503559b 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -1938,6 +1938,13 @@ class OtherCog(commands.Cog): def model_is_allowed(model_name: str, srv: dict[str, str | list[str] | int]) -> bool: for pat in srv.get("allow", ['*']): if not fnmatch.fnmatch(model_name.casefold(), pat.casefold()): + print( + "Server %r does not support %r (only %r.)" % ( + srv['name'], + model_name, + ', '.join(srv['allow']) + ) + ) return False return True