Skip to content

Function: toTermInputDto()

@kortexya/reasoninglayer


@kortexya/reasoninglayer / toTermInputDto

Function: toTermInputDto()

toTermInputDto(input): TermInputDto

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

Convert a PsiTermInput or already-formatted TermInputDto to TermInputDto.

Parameters

input

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

TermInputDto | PsiTermInput

Returns

TermInputDto

A TermInputDto suitable for inference request bodies.

Remarks

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.

Example

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