MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / appendEntries

Function appendEntries

ai/ai.ts:1905–1918  ·  view source on GitHub ↗
(entries: any[] | undefined, isAnnotation = false)

Source from the content-addressed store, hash-verified

1903
1904 const appendEntries = (entries: any[] | undefined, isAnnotation = false) => {
1905 if (!Array.isArray(entries)) return;
1906 for (const entry of entries) {
1907 const url = isAnnotation
1908 ? entry?.url_citation?.url || entry?.url
1909 : entry?.url;
1910 const title = isAnnotation
1911 ? entry?.url_citation?.title || entry?.title
1912 : entry?.title;
1913 if (!url || seen.has(url)) continue;
1914 seen.add(url);
1915 sources.push({ url, title });
1916 }
1917 };
1918
1919 const choice = data?.choices?.[0];
1920
1921 appendEntries(data?.citations);

Callers 1

collectOpenAISourcesFunction · 0.85

Calls 1

addMethod · 0.45

Tested by

no test coverage detected