Advanced18 minfree
It Is Not a Calculator
Counting, arithmetic, and numeric representations. Fix three broken questions by moving math into code.
Jev recognises the shape of an answer rather than tallying, and the error grows with the size of the thing being counted. TypeSafe states this plainly in its own documentation: Jev is not a calculator.
The fix is nearly always the same. Iterate in code, ask one question per item, and add up the answers yourself.
items = ["typesafe", "apple", "california", "banana", "orange"]
result = client.system_one(
{"items": items},
{
f"item_{i}": Noul(instructions=f"Is `items[{i}]` the name of a fruit?")
for i in range(len(items))
},
)
count = sum(result.nouls[f"item_{i}"].noul > 0.5 for i in range(len(items)))Numeric representations
Semantic beats numeric. Questions about colours by name outperform the same questions asked with hex values, and Jev cannot reliably judge whether two RGB triples are near each other. Convert in code, then ask the judgment question.