Connection
Base URL, credentials and a reachable server.
Discuss duplicate accounting in LetterRook: an exact match consumes a letter before displaced matches are considered.
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.
from collections import Counter
def letter_feedback(answer, guess):
if any(type(s) is not str or len(s) != 5 or any(not "a" <= c <= "z" for c in s) for s in (answer, guess)):
raise ValueError("word.lowercase")
marks, remaining = [0] * 5, Counter()
for i, (a, g) in enumerate(zip(answer, guess)):
if a == g:
marks[i] = 2
else:
remaining[a] += 1
for i, g in enumerate(guess):
if marks[i] != 2 and remaining[g]:
marks[i] = 1
remaining[g] -= 1
return marks