perf: memo GridCard, fuse save fns, fix slash tab active color
This commit is contained in:
@@ -78,7 +78,7 @@ Note content: "${content}"`;
|
||||
if (!response.ok) throw new Error(`Ollama error: ${response.statusText}`);
|
||||
|
||||
const data = await response.json();
|
||||
const text = data.response;
|
||||
const text = (data.response || '').replace(/<think>[\s\S]*?<\/think>/gi, '').trim();
|
||||
|
||||
const jsonMatch = text.match(/\[\s*\{[\s\S]*\}\s*\]/);
|
||||
if (jsonMatch) {
|
||||
@@ -133,7 +133,7 @@ Note content: "${content}"`;
|
||||
if (!response.ok) throw new Error(`Ollama error: ${response.statusText}`);
|
||||
|
||||
const data = await response.json();
|
||||
const text = data.response;
|
||||
const text = (data.response || '').replace(/<think>[\s\S]*?<\/think>/gi, '').trim();
|
||||
|
||||
const jsonMatch = text.match(/\[\s*\{[\s\S]*\}\s*\]/);
|
||||
if (jsonMatch) {
|
||||
@@ -162,7 +162,7 @@ Note content: "${content}"`;
|
||||
if (!response.ok) throw new Error(`Ollama error: ${response.statusText}`);
|
||||
|
||||
const data = await response.json();
|
||||
return data.response.trim();
|
||||
return (data.response || '').replace(/<think>[\s\S]*?<\/think>/gi, '').trim();
|
||||
} catch (e) {
|
||||
console.error('Error generating text (Ollama):', e);
|
||||
throw e;
|
||||
|
||||
Reference in New Issue
Block a user