Examples with Redis Vector and ChromaDB
Embeddings via ru-en-RoSBERTa https://huggingface.co/ai-forever/ru-en-RoSBERTa
| import requests | |
| API_KEY = "EMPTY" | |
| # BASE_URL = "http://localhost:12345/engines/llama.cpp/v1" | |
| BASE_URL = "http://localhost:11223/v1" | |
| URL = f"{BASE_URL}/chat/completions" | |
| # MODEL = "ai/gemma3" | |
| # MODEL = "ai/gemma3n" | |
| MODEL = "gemma3:1b" |
| 3.13 |
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", | |
| ) |