feat: add emoji-regex and remove-accents dependencies; enhance chat and setup pages
- Added `emoji-regex` and `remove-accents` packages to improve text processing capabilities. - Implemented automatic Ollama startup in the chat page for better user experience. - Enhanced setup page to include GPU selection based on hardware specifications. - Updated chat input to support real-time validation and improved user feedback. - Refactored message handling in chat to incorporate new processing features.
This commit is contained in:
1 parent
4275295e4f
commit
84ea2dec19
51 files changed
+7857
-573
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
|
||||
/**
|
||||
* Envia logs do frontend para o terminal via Tauri
|
||||
* Use esta função em vez de console.log para ver logs no terminal
|
||||
*/
|
||||
export async function logToTerminal(level: 'info' | 'warn' | 'error' | 'debug', message: string) {
|
||||
try {
|
||||
await invoke('log_to_terminal', { level, message });
|
||||
} catch (error) {
|
||||
// Fallback para console se o comando falhar
|
||||
console[level](message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper para logs com prefixo [Chat]
|
||||
*/
|
||||
export const chatLog = {
|
||||
info: (message: string) => logToTerminal('info', `[Chat] ${message}`),
|
||||
warn: (message: string) => logToTerminal('warn', `[Chat] ${message}`),
|
||||
error: (message: string) => logToTerminal('error', `[Chat] ${message}`),
|
||||
debug: (message: string) => logToTerminal('debug', `[Chat] ${message}`),
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper para logs com prefixo [DeepResearch]
|
||||
*/
|
||||
export const deepResearchLog = {
|
||||
info: (message: string) => logToTerminal('info', `[DeepResearch] ${message}`),
|
||||
warn: (message: string) => logToTerminal('warn', `[DeepResearch] ${message}`),
|
||||
error: (message: string) => logToTerminal('error', `[DeepResearch] ${message}`),
|
||||
debug: (message: string) => logToTerminal('debug', `[DeepResearch] ${message}`),
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user