Connection
Base URL, credentials and a reachable server.
Check zero, a negative value and both base limits, rejecting booleans, fractional values and unsupported bases.
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.
def format_radix(value, base):
if type(value) is not int or type(base) is not int or not 2 <= base <= 36:
raise ValueError("radix.input")
if value == 0:
return "0"
sign, value = ("-" if value < 0 else ""), abs(value)
digits = "0123456789abcdefghijklmnopqrstuvwxyz"
result = ""
while value:
value, remainder = divmod(value, base)
result = digits[remainder] + result
return sign + result