Connection
Base URL, credentials and a reachable server.
Transpose a rectangular matrix into newly allocated rows.
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 transpose(rows):
rows = [list(row) for row in rows]
if not rows:
return []
width = len(rows[0])
if any(len(row) != width for row in rows):
raise ValueError("matrix.ragged")
return [[row[column] for row in rows] for column in range(width)]