This commit is contained in:
Timothy Jaeryang Baek
2025-08-21 03:38:26 +04:00
parent 86011e40be
commit 094a16ab49
11 changed files with 193 additions and 241 deletions
+10 -24
View File
@@ -44,11 +44,6 @@
copyToClipboard,
getMessageContentParts,
createMessagesList,
extractSentencesForAudio,
promptTemplate,
splitStream,
sleep,
removeDetails,
getPromptVariables,
processDetails,
removeAllDetails
@@ -1655,6 +1650,14 @@
);
await tick();
let userLocation;
if ($settings?.userLocation) {
userLocation = await getAndUpdateUserLocation(localStorage.token).catch((err) => {
console.error(err);
return undefined;
});
}
const stream =
model?.info?.params?.stream_response ??
$settings?.params?.stream_response ??
@@ -1665,16 +1668,7 @@
params?.system || $settings.system
? {
role: 'system',
content: `${promptTemplate(
params?.system ?? $settings?.system ?? '',
$user?.name,
$settings?.userLocation
? await getAndUpdateUserLocation(localStorage.token).catch((err) => {
console.error(err);
return undefined;
})
: undefined
)}`
content: `${params?.system ?? $settings?.system ?? ''}`
}
: undefined,
..._messages.map((message) => ({
@@ -1752,15 +1746,7 @@
memory: $settings?.memory ?? false
},
variables: {
...getPromptVariables(
$user?.name,
$settings?.userLocation
? await getAndUpdateUserLocation(localStorage.token).catch((err) => {
console.error(err);
return undefined;
})
: undefined
)
...getPromptVariables($user?.name, $settings?.userLocation ? userLocation : undefined)
},
model_item: $models.find((m) => m.id === model.id),