Connection
Base URL, credentials and a reachable server.
Check multi-digit numbers, shared prefixes and stable-release empty tuples, rejecting leading-zero numbers and invalid identifiers.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
import re
IDENT = re.compile(r"[0-9A-Za-z-]+")
def prerelease_cmp(left, right):
for item in (*left, *right):
if not isinstance(item, str) or not IDENT.fullmatch(item):
raise ValueError("identifier")
if item.isascii() and item.isdigit() and len(item) > 1 and item[0] == "0":
raise ValueError("leading zero")
if not left or not right:
return (not left) - (not right)
for a, b in zip(left, right):
if a == b: continue
an, bn = a.isdigit(), b.isdigit()
if an != bn: return -1 if an else 1
if an and len(a) != len(b): return (len(a) > len(b)) - (len(a) < len(b))
return (a > b) - (a < b)
return (len(left) > len(right)) - (len(left) < len(right))