Examples with Redis Vector and ChromaDB
Embeddings via ru-en-RoSBERTa https://huggingface.co/ai-forever/ru-en-RoSBERTa
Examples with Redis Vector and ChromaDB
Embeddings via ru-en-RoSBERTa https://huggingface.co/ai-forever/ru-en-RoSBERTa
from functools import wraps | |
from timeit import default_timer | |
from typing import reveal_type, Callable, Concatenate | |
type ExecutionTime = float | |
def with_execution_time[**P, T]( | |
func: Callable[P, T], | |
) -> Callable[P, tuple[T, ExecutionTime]]: |
import logging | |
# DEFAULT_LOG_FORMAT = "[%(asctime)s.%(msecs)03d] %(funcName)20s %(module)s:%(lineno)d %(levelname)-8s - %(message)s" | |
DEFAULT_LOG_FORMAT = ( | |
"%(funcName)10s %(module)s:%(lineno)d %(levelname)-8s - %(message)s" | |
) | |
def configure_logging(level: int = logging.INFO) -> None: | |
logging.basicConfig( |
You're right—just setting _server_version_info isn’t enough; the MSSQL dialect caches feature flags at init. We need to refresh those flags so the compiler knows OFFSET/FETCH is supported.
Use this function (note the call to _setup_version_attributes) and make sure your statement has ORDER BY and .offset(...):
from typing import Optional, Tuple, Union
import os | |
TOKEN = os.getenv( | |
"BOT_TOKEN", | |
"123:abc", | |
) |
from typing import Protocol | |
class MessageCallback(Protocol): | |
__name__: str | |
def __call__( | |
self, | |
message: str, | |
size: int, |
import logging | |
# DEFAULT_LOG_FORMAT = "[%(asctime)s.%(msecs)03d] %(funcName)20s %(module)s:%(lineno)d %(levelname)-8s - %(message)s" | |
DEFAULT_LOG_FORMAT = ( | |
"%(funcName)10s %(module)s:%(lineno)d %(levelname)-8s - %(message)s" | |
) | |
def configure_logging(level: int = logging.INFO) -> None: | |
logging.basicConfig( |