Few-shot examples work best when they're similar to the user's input but not near-duplicates of each other. Select k examples from a pool of embeddings.
Implement select_examples(query, pool, k, max_sim=0.95, label_balance=None):
max_sim.label_balance is given (a list of labels, one per pool item), don't select more than ceil(k / number_of_distinct_labels) examples from any one label.k if the constraints run out.