Skip to content

Type Alias: PsiTermInput

@kortexya/reasoninglayer


@kortexya/reasoninglayer / PlainValues / PsiTermInput

Type Alias: PsiTermInput

PsiTermInput = PsiTermInputByName | PsiTermInputById

Defined in: src/types/plain-values.ts:69

A format-agnostic psi-term produced by the psi() builder.

Remarks

Exactly one of sortName or sortId is present — enforced by the union type. Can be passed to both term CRUD methods (converted to tagged ValueDto format) and inference methods (converted to untagged TermInputDto format). The SDK handles the conversion automatically based on which method receives it.

Distinguished from plain objects by the __psiTerm brand field, which is stripped before serialization.

Example

// Works with term CRUD:
await client.terms.createTerm({ sortId, ownerId, features: { name: "Alice" } });
// Works with inference:
await client.inference.addFact({ term: psi("person", { name: "Alice" }) });