Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

firstSentence.md

26 lines540 Bytes

Function: firstSentence()

function firstSentence(text): string;

Defined in: packages/ai/src/activities/chat/tools/lazy-tools.ts:8

Extract the first sentence of a description (up to the first ., !, or ? followed by whitespace or end-of-string). Falls back to the whole trimmed string when there is no sentence terminator.

Parameters

text

string

Returns

string