@tanstack/ai
Version:
Type-safe TypeScript AI SDK for streaming chat, tool calling, agents, structured outputs, and multimodal generation.
17 lines (16 loc) • 591 B
JavaScript
function firstSentence(text) {
const trimmed = text.trim();
if (!trimmed) return "";
const match = trimmed.match(/^.*?[.!?](?=\s|$)/);
return (match ? match[0] : trimmed).trim();
}
function renderLazyCatalogEntry(name, description, includeDescription = "none") {
if (includeDescription === "none" || !description.trim()) return name;
const desc = includeDescription === "first-sentence" ? firstSentence(description) : description.trim();
return desc ? `${name} — ${desc}` : name;
}
export {
firstSentence,
renderLazyCatalogEntry
};
//# sourceMappingURL=lazy-tools.js.map