Connection
Base URL, credentials and a reachable server.
Use tree_shapes.py to review a shape-count recurrence whose output is a number rather than a collection of trees.
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 tree_shapes(internal_nodes):
if type(internal_nodes) is not int or not 0 <= internal_nodes <= 100:
raise ValueError("shapes.nodes")
counts = [1] + [0]*internal_nodes
for size in range(1, internal_nodes+1):
counts[size] = sum(counts[left]*counts[size-1-left] for left in range(size))
return counts[internal_nodes]