Timothy Jaeryang Baek hai 2 meses
pai
achega
9624493b55

+ 5 - 1
backend/open_webui/main.py

@@ -883,7 +883,11 @@ async def chat_completion(
             **(
                 {"function_calling": "native"}
                 if form_data.get("params", {}).get("function_calling") == "native"
-                or model_info.params.model_dump().get("function_calling") == "native"
+                or (
+                    model_info
+                    and model_info.params.model_dump().get("function_calling")
+                    == "native"
+                )
                 else {}
             ),
         }

+ 2 - 1
scripts/prepare-pyodide.js

@@ -11,7 +11,8 @@ const packages = [
 	'regex',
 	'sympy',
 	'tiktoken',
-	'seaborn'
+	'seaborn',
+	'pytz'
 ];
 
 import { loadPyodide } from 'pyodide';

+ 2 - 1
src/lib/components/chat/Messages/CodeBlock.svelte

@@ -132,7 +132,8 @@
 			code.includes('seaborn') ? 'seaborn' : null,
 			code.includes('sympy') ? 'sympy' : null,
 			code.includes('tiktoken') ? 'tiktoken' : null,
-			code.includes('matplotlib') ? 'matplotlib' : null
+			code.includes('matplotlib') ? 'matplotlib' : null,
+			code.includes('pytz') ? 'pytz' : null
 		].filter(Boolean);
 
 		console.log(packages);

+ 2 - 1
src/routes/+layout.svelte

@@ -118,7 +118,8 @@
 			code.includes('re') ? 'regex' : null,
 			code.includes('seaborn') ? 'seaborn' : null,
 			code.includes('sympy') ? 'sympy' : null,
-			code.includes('tiktoken') ? 'tiktoken' : null
+			code.includes('tiktoken') ? 'tiktoken' : null,
+			code.includes('pytz') ? 'pytz' : null
 		].filter(Boolean);
 
 		const pyodideWorker = new PyodideWorker();