mirror of
https://github.com/open-webui/open-webui
synced 2024-12-28 06:42:47 +00:00
chore: format
This commit is contained in:
parent
22b5feb747
commit
cbc7801b0e
@ -25,7 +25,7 @@ def prompt_template(
|
|||||||
# Format the date to YYYY-MM-DD
|
# Format the date to YYYY-MM-DD
|
||||||
formatted_date = current_date.strftime("%Y-%m-%d")
|
formatted_date = current_date.strftime("%Y-%m-%d")
|
||||||
formatted_time = current_date.strftime("%I:%M:%S %p")
|
formatted_time = current_date.strftime("%I:%M:%S %p")
|
||||||
formatted_weekday = current_date.strftime("%A") # EX:Monday
|
formatted_weekday = current_date.strftime("%A")
|
||||||
|
|
||||||
template = template.replace("{{CURRENT_DATE}}", formatted_date)
|
template = template.replace("{{CURRENT_DATE}}", formatted_date)
|
||||||
template = template.replace("{{CURRENT_TIME}}", formatted_time)
|
template = template.replace("{{CURRENT_TIME}}", formatted_time)
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "open-webui",
|
"name": "open-webui",
|
||||||
"version": "0.4.5",
|
"version": "0.4.6",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "open-webui",
|
"name": "open-webui",
|
||||||
"version": "0.4.5",
|
"version": "0.4.6",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/lang-javascript": "^6.2.2",
|
"@codemirror/lang-javascript": "^6.2.2",
|
||||||
"@codemirror/lang-python": "^6.1.6",
|
"@codemirror/lang-python": "^6.1.6",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "open-webui",
|
"name": "open-webui",
|
||||||
"version": "0.4.5",
|
"version": "0.4.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npm run pyodide:fetch && vite dev --host",
|
"dev": "npm run pyodide:fetch && vite dev --host",
|
||||||
|
@ -367,11 +367,9 @@ export const generateQueries = async (
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Step 1: Safely extract the response string
|
// Step 1: Safely extract the response string
|
||||||
const response = res?.choices[0]?.message?.content ?? '';
|
const response = res?.choices[0]?.message?.content ?? '';
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const jsonStartIndex = response.indexOf('{');
|
const jsonStartIndex = response.indexOf('{');
|
||||||
const jsonEndIndex = response.lastIndexOf('}');
|
const jsonEndIndex = response.lastIndexOf('}');
|
||||||
@ -390,7 +388,7 @@ export const generateQueries = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no valid JSON block found, return an empty array
|
// If no valid JSON block found, return response as is
|
||||||
return [response];
|
return [response];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Catch and safely return empty array on any parsing errors
|
// Catch and safely return empty array on any parsing errors
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user