refac: citations -> sources

This commit is contained in:
Timothy Jaeryang Baek
2024-11-21 19:46:09 -08:00
parent 7062e637e8
commit 81386e9b04
9 changed files with 165 additions and 126 deletions
+4 -4
View File
@@ -5,7 +5,7 @@ type TextStreamUpdate = {
done: boolean;
value: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
citations?: any;
sources?: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
selectedModelId?: any;
error?: any;
@@ -67,8 +67,8 @@ async function* openAIStreamToIterator(
break;
}
if (parsedData.citations) {
yield { done: false, value: '', citations: parsedData.citations };
if (parsedData.sources) {
yield { done: false, value: '', sources: parsedData.sources };
continue;
}
@@ -98,7 +98,7 @@ async function* streamLargeDeltasAsRandomChunks(
yield textStreamUpdate;
return;
}
if (textStreamUpdate.citations) {
if (textStreamUpdate.sources) {
yield textStreamUpdate;
continue;
}