Connection
Base URL, credentials and a reachable server.
Count single-line logical columns using fixed tab stops and one column per other Unicode code point.
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 logical_column(text, tab_width):
if not isinstance(text, str):
raise ValueError("text.required")
if type(tab_width) is not int or tab_width <= 0:
raise ValueError("tab.width")
if "\r" in text or "\n" in text:
raise ValueError("line.break")
column = 0
for char in text:
column += tab_width - column % tab_width if char == "\t" else 1
return column