chat-ui / src /lib /utils /parseStringToList.ts
nsarrazin's picture
nsarrazin HF staff
Add websearch controls for assistants (#812)
3f5871c unverified
raw
history blame
238 Bytes
export function parseStringToList(links: unknown): string[] {
if (typeof links !== "string") {
throw new Error("Expected a string");
}
return links
.split(",")
.map((link) => link.trim())
.filter((link) => link.length > 0);
}