Skip to content

Function: toTermInputDto()

@kortexya/reasoninglayer


@kortexya/reasoninglayer / toTermInputDto

toTermInputDto(input): TermInputDto

Defined in: src/utils/convert.ts:458

Convert a PsiTermInput or already-formatted TermInputDto to TermInputDto.

TermInputDto | PsiTermInput

PsiTermInput from psi() or an already-formatted TermInputDto.

TermInputDto

A TermInputDto suitable for inference request bodies.

If the input is already a TermInputDto, it is returned as-is. If it is a PsiTermInput, it is converted by stripping the brand field and converting features to untagged format.

toTermInputDto(psi("person", { name: "Alice" }))
// { sortName: "person", features: { name: "Alice" } }