diff --git a/src/ketr-chat/src/App.tsx b/src/ketr-chat/src/App.tsx index 9566b49..991a484 100644 --- a/src/ketr-chat/src/App.tsx +++ b/src/ketr-chat/src/App.tsx @@ -20,6 +20,8 @@ import MenuIcon from '@mui/icons-material/Menu'; import IconButton from '@mui/material/IconButton'; import Box from '@mui/material/Box'; import CssBaseline from '@mui/material/CssBaseline'; +import AddIcon from '@mui/icons-material/AddCircle'; +import SendIcon from '@mui/icons-material/Send'; import PropagateLoader from "react-spinners/PropagateLoader"; import Markdown from 'react-markdown'; @@ -69,7 +71,7 @@ interface ControlsParams { toggleRag: (tool: Tool) => void, setRags: (rags: Tool[]) => void, setSystemPrompt: (prompt: string) => void, - reset: (types: ("rags" | "tools" | "history" | "system-prompt")[]) => Promise + reset: (types: ("rags" | "tools" | "history" | "system-prompt")[], message: string) => Promise }; const Controls = ({ tools, rags, systemPrompt, toggleTool, toggleRag, setSystemPrompt, reset }: ControlsParams) => { @@ -125,7 +127,7 @@ const Controls = ({ tools, rags, systemPrompt, toggleTool, toggleRag, setSystemP />
- +
@@ -173,8 +175,8 @@ const Controls = ({ tools, rags, systemPrompt, toggleTool, toggleRag, setSystemP } - - + + ); } @@ -386,7 +388,7 @@ const App = () => { }, [systemPrompt, setServerSystemPrompt, serverSystemPrompt, loc, sessionId, setSnack]); - const reset = async (types: ("rags" | "tools" | "history" | "system-prompt")[]) => { + const reset = async (types: ("rags" | "tools" | "history" | "system-prompt")[], message: string = "Update successful.") => { try { const response = await fetch(getConnectionBase(loc) + `/api/reset/${sessionId}`, { method: 'PUT', @@ -419,7 +421,7 @@ const App = () => { break; } } - setSnack("Update successful.", "success"); + setSnack(message, "success"); } else { throw Error(`${{ status: response.status, message: response.statusText }}`); } @@ -477,7 +479,7 @@ const App = () => { type MessageList = Message[]; const onNew = async () => { - reset(["rags", "tools", "history", "system-prompt"]); + reset(["rags", "tools", "history", "system-prompt"], "New chat started."); } const sendQuery = async () => { @@ -643,6 +645,16 @@ const App = () => { > + + + + Ketr-Chat @@ -729,7 +741,7 @@ const App = () => { - + { id="QueryInput" /> - - + diff --git a/src/tools.py b/src/tools.py index e224a0c..981c2ac 100644 --- a/src/tools.py +++ b/src/tools.py @@ -330,7 +330,7 @@ tools = [ { "type": "function", "function": { "name": "get_current_datetime", - "description": "Get the current date and time in a specified timezone", + "description": "Get the current date and time in a specified timezone. For example if a user asks 'What time is it in Poland?' you would pass the Warsaw timezone to get_current_datetime.", "parameters": { "type": "object", "properties": {