| 123456789101112 |
- export async function loadTxtFromString(text, { source, metadata } = {}) {
- const normalized = String(text ?? "").trim();
- if (!normalized) return [];
- return [
- {
- text: normalized,
- source: source ?? "txt",
- metadata: metadata ?? null
- }
- ];
- }
|