Synthetic Faces
A synthetic face is defined by a boolean formula over existing faces. It is assembled on the fly: no separate compilation, no extra training.Formula syntax
Parentheses are supported for grouping:
Create a synthetic face
Pass aformula instead of uploading documents. name is required, as for any face:
alias. All referenced faces must:
- Be owned by you
- Be concrete (non-synthetic) faces
422.
Update the formula
{"formula": ""} removes the formula: the face reads "formula": null and is an ordinary face again.
A formula can be added only to a face with no sources or compiled content of its own,
and that no other synthetic face uses as an operand. Anything else is a 409 and the
face is unchanged: create a new face with the formula instead.
Ask a synthetic face
The same as asking any face:Validation rules
- All referenced aliases must be owned by you at create/update time.
- Referenced faces must be concrete (not synthetic themselves).
- The formula must be a valid boolean expression using
|,&,-,^, parentheses, and valid aliases.
422 with a description of the problem.
Use cases
- Union:
designer | engineer - Intersection:
alice & mentor - Difference:
senior-dev - junior-dev - A/B testing: compare
alice | bobwithalice & bob.
Run-time composites (compose on the fly)
You don’t have to create a synthetic face first. You can pass a formula directly as the face and have it composed for that one call:|, &, -, ^, parentheses), on faces written @alias, with the maestro once after the whole expression. A composite works wherever a face does: /v1/choices ((@alice | @bob):maestro-1), chat and decisions ((@alice | @bob):maestro-1/<model>). See Naming a model.
Behaviorally a run-time composite is identical to a persisted one of the same operands, and there’s no meaningful latency difference. Persist when you’ll reuse it (and want to name it); compose on the fly for one-off blends.
Rules
- Operands must be concrete faces, same as persisted formulas. A bare alias is one of your own faces. Unknown/unowned operand →
404; referencing a synthetic face as an operand →422(no nesting). - Another account’s face works in a run-time formula, for a face you can read, such as a published one:
(@alice | @head~socrates):maestro-1/<model>. A face you cannot read →404. A persisted formula takes only your own faces by bare alias. - Difference: a
-right before@or(is the difference, with or without spaces (@alice-@bob,@alice - @bob); a dash inside a name (@news-bot) is part of the alias, and no alias starts or ends with one. A persisted formula (face:create) still writesalice - bob, with spaces and no@.
Identity: the first operand
A run-time composite answers as its first (leftmost) operand, taking that face’s name and anyprofile_addendum:
profile_addendum at creation.
An empty result
A formula whose result is empty is a422, and nothing is charged:
- or ^ result says “the result of this formula is null”.