diff --git a/apps/desktop/src/components/right-panel/components/chat/empty-chat-state.tsx b/apps/desktop/src/components/right-panel/components/chat/empty-chat-state.tsx index cbb53abf13..25dc007af5 100644 --- a/apps/desktop/src/components/right-panel/components/chat/empty-chat-state.tsx +++ b/apps/desktop/src/components/right-panel/components/chat/empty-chat-state.tsx @@ -1,19 +1,31 @@ +import { commands as analyticsCommands } from "@hypr/plugin-analytics"; import { commands as windowsCommands } from "@hypr/plugin-windows"; import { Badge } from "@hypr/ui/components/ui/badge"; import { Trans } from "@lingui/react/macro"; import { memo, useCallback } from "react"; +import { useHypr } from "@/contexts"; + interface EmptyChatStateProps { onQuickAction: (prompt: string) => void; onFocusInput: () => void; } export const EmptyChatState = memo(({ onQuickAction, onFocusInput }: EmptyChatStateProps) => { + const { userId } = useHypr(); + const handleContainerClick = useCallback(() => { onFocusInput(); }, [onFocusInput]); - const handleButtonClick = useCallback((prompt: string) => (e: React.MouseEvent) => { + const handleButtonClick = useCallback((prompt: string, analyticsEvent: string) => (e: React.MouseEvent) => { + if (userId) { + analyticsCommands.event({ + event: analyticsEvent, + distinct_id: userId, + }); + } + onQuickAction(prompt); }, [onQuickAction]); @@ -55,28 +67,40 @@ export const EmptyChatState = memo(({ onQuickAction, onFocusInput }: EmptyChatSt
+
diff --git a/apps/desktop/src/components/right-panel/hooks/useChatLogic.ts b/apps/desktop/src/components/right-panel/hooks/useChatLogic.ts index 848427f309..47ec1279e5 100644 --- a/apps/desktop/src/components/right-panel/hooks/useChatLogic.ts +++ b/apps/desktop/src/components/right-panel/hooks/useChatLogic.ts @@ -7,11 +7,10 @@ import { commands as connectorCommands } from "@hypr/plugin-connector"; import { commands as dbCommands } from "@hypr/plugin-db"; import { commands as miscCommands } from "@hypr/plugin-misc"; import { commands as templateCommands } from "@hypr/plugin-template"; -import { modelProvider, streamText, tool } from "@hypr/utils/ai"; +import { modelProvider, stepCountIs, streamText, tool } from "@hypr/utils/ai"; import { useSessions } from "@hypr/utils/contexts"; import { useQueryClient } from "@tanstack/react-query"; import { z } from "zod"; - import type { ActiveEntityInfo, Message } from "../types/chat-types"; import { parseMarkdownBlocks } from "../utils/markdown-parser"; @@ -315,6 +314,64 @@ export function useChatLogic({ update_progress: tool({ inputSchema: z.any() }), }, }), + ...(type !== "HyprLocal" && { + stopWhen: stepCountIs(3), + tools: { + search_sessions_multi_keywords: tool({ + description: + "Search for sessions (meeting notes) with multiple keywords. The keywords should be the most important things that the user is talking about. This could be either topics, people, or company names.", + inputSchema: z.object({ + keywords: z.array(z.string()).min(3).max(5).describe( + "List of 3-5 keywords to search for, each keyword should be concise", + ), + }), + execute: async ({ keywords }) => { + const searchPromises = keywords.map(keyword => + dbCommands.listSessions({ + type: "search", + query: keyword, + user_id: userId || "", + limit: 3, + }) + ); + + const searchResults = await Promise.all(searchPromises); + + const combinedResults = new Map(); + + searchResults.forEach((sessions, index) => { + const keyword = keywords[index]; + sessions.forEach(session => { + if (combinedResults.has(session.id)) { + combinedResults.get(session.id).matchedKeywords.push(keyword); + } else { + combinedResults.set(session.id, { + ...session, + matchedKeywords: [keyword], + }); + } + }); + }); + + const finalResults = Array.from(combinedResults.values()) + .sort((a, b) => b.matchedKeywords.length - a.matchedKeywords.length); + + return { + results: finalResults, + summary: { + totalSessions: finalResults.length, + keywordsSearched: keywords, + sessionsByKeywordCount: finalResults.reduce((acc, session) => { + const count = session.matchedKeywords.length; + acc[count] = (acc[count] || 0) + 1; + return acc; + }, {} as Record), + }, + }; + }, + }), + }, + }), onError: (error) => { console.error("On Error Catch:", error); diff --git a/apps/desktop/src/components/settings/components/ai/stt-view.tsx b/apps/desktop/src/components/settings/components/ai/stt-view.tsx index 10877159db..9b0924197f 100644 --- a/apps/desktop/src/components/settings/components/ai/stt-view.tsx +++ b/apps/desktop/src/components/settings/components/ai/stt-view.tsx @@ -6,6 +6,10 @@ import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { z } from "zod"; +// Add these imports for file operations +// import { message } from "@tauri-apps/plugin-dialog"; +// import { writeFile } from "@tauri-apps/plugin-fs"; + import { commands as dbCommands } from "@hypr/plugin-db"; import { commands as localSttCommands, SupportedModel } from "@hypr/plugin-local-stt"; import { Button } from "@hypr/ui/components/ui/button"; @@ -137,6 +141,10 @@ export function STTView({ }: STTViewProps) { const queryClient = useQueryClient(); + // Add drag and drop state + // const [isDragOver, setIsDragOver] = useState(false); + // const [isUploading, setIsUploading] = useState(false); + const currentSTTModel = useQuery({ queryKey: ["current-stt-model"], queryFn: () => localSttCommands.getCurrentModel(), @@ -243,6 +251,71 @@ export function STTView({ onError: console.error, }); + /* + const handleDragOver = useCallback((e: React.DragEvent) => { + e.preventDefault(); + e.stopPropagation(); + setIsDragOver(true); + }, []); + + const handleDragLeave = useCallback((e: React.DragEvent) => { + e.preventDefault(); + e.stopPropagation(); + setIsDragOver(false); + }, []); + + const handleFileDrop = useCallback(async (e: React.DragEvent) => { + e.preventDefault(); + e.stopPropagation(); + setIsDragOver(false); + + const file = e.dataTransfer.files[0]; + if (!file) { + return; + } + + // Validate file extension + const fileName = file.name.toLowerCase(); + if (!fileName.endsWith(".bin") && !fileName.endsWith(".ggml")) { + await message( + "Please drop a valid STT model file (Comming Soon)", + { title: "Invalid File Type", kind: "error" }, + ); + return; + } + + setIsUploading(true); + try { + // Get the STT models directory + const modelsDir = await localSttCommands.modelsDir(); + const targetPath = `${modelsDir}/${file.name}`; + + // Read the file content as array buffer + const fileContent = await file.arrayBuffer(); + const uint8Array = new Uint8Array(fileContent); + + // Write the file to the models directory + await writeFile(targetPath, uint8Array); + + await message(`Model file "${file.name}" copied successfully!`, { + title: "File Copied", + kind: "info", + }); + + // This invalidation will trigger the automatic refresh + queryClient.invalidateQueries({ queryKey: ["stt-model-download-status"] }); + } catch (error) { + console.error("Error copying model file:", error); + await message(`Failed to copy model file: ${error instanceof Error ? error.message : String(error)}`, { + title: "Copy Failed", + kind: "error", + }); + } finally { + setIsUploading(false); + } + }, [queryClient]); + */ + return (
@@ -262,6 +335,9 @@ export function STTView({
+

+ Default +

{modelsToShow.map((model) => (
+ { + /* +
+

+ Custom +

+
+ {isUploading + ? ( +
+
+

+ Copying model file... +

+
+ ) + : ( +

+ Drag and drop your own STT mode file (.ggml or .bin format) +

+ )} +
+
+ */ + }

@@ -421,7 +533,7 @@ export function STTView({ field.onChange(newValue); aiConfigMutation.mutate({ redemptionTimeMs: newValue }); }} - className="w-[100%]" + className="w-[100%] [&>.relative>.absolute]:bg-gray-400 [&>.relative>span[data-state='active']]:bg-gray-300 [&>.relative>span]:border-gray-200" />

diff --git a/apps/desktop/src/components/settings/views/general.tsx b/apps/desktop/src/components/settings/views/general.tsx index e6088f76d6..46e1346ff9 100644 --- a/apps/desktop/src/components/settings/views/general.tsx +++ b/apps/desktop/src/components/settings/views/general.tsx @@ -71,6 +71,7 @@ const SUPPORTED_LANGUAGES: ISO_639_1_CODE[] = [ "ta", "lv", "az", + "he", ]; const schema = z.object({ diff --git a/apps/desktop/src/locales/en/messages.po b/apps/desktop/src/locales/en/messages.po index 11e997e3c0..f93b679d95 100644 --- a/apps/desktop/src/locales/en/messages.po +++ b/apps/desktop/src/locales/en/messages.po @@ -14,7 +14,7 @@ msgstr "" "Plural-Forms: \n" #. js-lingui-explicit-id -#: src/components/settings/views/general.tsx:361 +#: src/components/settings/views/general.tsx:362 msgid "Type terms separated by commas (e.g., Blitz Meeting, PaC Squad)" msgstr "Type terms separated by commas (e.g., Blitz Meeting, PaC Squad)" @@ -344,11 +344,15 @@ msgstr "Add languages you use during meetings to improve transcription accuracy" msgid "Add members" msgstr "Add members" +#: src/components/right-panel/components/chat/empty-chat-state.tsx:103 +msgid "Add more quotes" +msgstr "Add more quotes" + #: src/components/editor-area/note-header/chips/participants-chip.tsx:322 msgid "Add participant" msgstr "Add participant" -#: src/components/settings/views/general.tsx:352 +#: src/components/settings/views/general.tsx:353 msgid "Add specific terms or jargon for improved transcription accuracy" msgstr "Add specific terms or jargon for improved transcription accuracy" @@ -490,7 +494,7 @@ msgstr "Cancel" msgid "CEO" msgstr "CEO" -#: src/components/right-panel/components/chat/empty-chat-state.tsx:43 +#: src/components/right-panel/components/chat/empty-chat-state.tsx:55 msgid "Chat feature is in beta. For best results, we recommend you to use <0>custom endpoints." msgstr "Chat feature is in beta. For best results, we recommend you to use <0>custom endpoints." @@ -498,7 +502,7 @@ msgstr "Chat feature is in beta. For best results, we recommend you to use <0>cu #~ msgid "Chat with meeting notes" #~ msgstr "Chat with meeting notes" -#: src/components/right-panel/components/chat/empty-chat-state.tsx:34 +#: src/components/right-panel/components/chat/empty-chat-state.tsx:46 msgid "Chat with this meeting" msgstr "Chat with this meeting" @@ -514,7 +518,7 @@ msgstr "Chat with this meeting" msgid "Choose the languages you speak for better transcription accuracy" msgstr "Choose the languages you speak for better transcription accuracy" -#: src/components/settings/views/general.tsx:186 +#: src/components/settings/views/general.tsx:187 msgid "Choose whether to save your recordings locally." msgstr "Choose whether to save your recordings locally." @@ -625,8 +629,8 @@ msgid "Create" msgstr "Create" #: src/components/right-panel/components/chat/empty-chat-state.tsx:79 -msgid "Create agenda" -msgstr "Create agenda" +#~ msgid "Create agenda" +#~ msgstr "Create agenda" #: src/components/toolbar/buttons/new-note-button.tsx:47 msgid "Create new note" @@ -656,7 +660,7 @@ msgstr "Create your first template to get started" msgid "Custom Endpoints" msgstr "Custom Endpoints" -#: src/components/settings/views/general.tsx:349 +#: src/components/settings/views/general.tsx:350 msgid "Custom Vocabulary" msgstr "Custom Vocabulary" @@ -686,7 +690,7 @@ msgstr "Description" #~ msgid "Did you get consent from everyone in the meeting?" #~ msgstr "Did you get consent from everyone in the meeting?" -#: src/components/settings/views/general.tsx:239 +#: src/components/settings/views/general.tsx:240 msgid "Display language" msgstr "Display language" @@ -770,7 +774,7 @@ msgstr "Enter the base URL for your custom LLM endpoint" #~ msgid "Extensions" #~ msgstr "Extensions" -#: src/components/right-panel/components/chat/empty-chat-state.tsx:73 +#: src/components/right-panel/components/chat/empty-chat-state.tsx:88 msgid "Extract action items" msgstr "Extract action items" @@ -871,6 +875,10 @@ msgstr "Help us tailor your Hyprnote experience" msgid "How did you hear about Hyprnote?" msgstr "How did you hear about Hyprnote?" +#: src/components/right-panel/components/chat/empty-chat-state.tsx:82 +msgid "Important Q&As" +msgstr "Important Q&As" + #: src/components/settings/views/billing.tsx:38 #~ msgid "Integration with other apps like Notion and Google Calendar" #~ msgstr "Integration with other apps like Notion and Google Calendar" @@ -905,8 +913,8 @@ msgid "Join meeting" msgstr "Join meeting" #: src/components/right-panel/components/chat/empty-chat-state.tsx:67 -msgid "Key decisions" -msgstr "Key decisions" +#~ msgid "Key decisions" +#~ msgstr "Key decisions" #: src/routes/app.settings.tsx:120 #~ msgid "Lab" @@ -1037,6 +1045,10 @@ msgstr "New note" msgid "New window" msgstr "New window" +#: src/components/right-panel/components/chat/empty-chat-state.tsx:94 +msgid "Next meeting prep" +msgstr "Next meeting prep" + #: src/components/settings/components/calendar/calendar-selector.tsx:101 msgid "No calendars found" msgstr "No calendars found" @@ -1161,7 +1173,7 @@ msgstr "Pause" msgid "people" msgstr "people" -#: src/components/settings/components/ai/stt-view.tsx:259 +#: src/components/settings/components/ai/stt-view.tsx:332 msgid "Performance difference between languages" msgstr "Performance difference between languages" @@ -1173,7 +1185,7 @@ msgstr "Performance difference between languages" #~ msgid "Play video" #~ msgstr "Play video" -#: src/components/settings/views/general.tsx:242 +#: src/components/settings/views/general.tsx:243 msgid "Primary language for the interface" msgstr "Primary language for the interface" @@ -1252,7 +1264,7 @@ msgstr "Save current recording" msgid "Save Date" msgstr "Save Date" -#: src/components/settings/views/general.tsx:183 +#: src/components/settings/views/general.tsx:184 msgid "Save recordings" msgstr "Save recordings" @@ -1321,7 +1333,7 @@ msgstr "Select Calendars" msgid "Select how you want to process your meeting notes" msgstr "Select how you want to process your meeting notes" -#: src/components/settings/views/general.tsx:271 +#: src/components/settings/views/general.tsx:272 msgid "Select languages you speak for better transcription" msgstr "Select languages you speak for better transcription" @@ -1341,10 +1353,14 @@ msgstr "Send invite" msgid "Settings" msgstr "Settings" -#: src/components/settings/views/general.tsx:209 +#: src/components/settings/views/general.tsx:210 msgid "Share usage data" msgstr "Share usage data" +#: src/components/right-panel/components/chat/empty-chat-state.tsx:73 +msgid "Shorten summary" +msgstr "Shorten summary" + #: src/components/settings/views/notifications.tsx:135 msgid "Show notifications when you have meetings starting soon in your calendar." msgstr "Show notifications when you have meetings starting soon in your calendar." @@ -1365,7 +1381,7 @@ msgstr "Some downloads failed, but you can continue" msgid "Sound" msgstr "Sound" -#: src/components/settings/views/general.tsx:268 +#: src/components/settings/views/general.tsx:269 msgid "Spoken languages" msgstr "Spoken languages" @@ -1390,8 +1406,8 @@ msgstr "Stop" #~ msgstr "Submit Feedback" #: src/components/right-panel/components/chat/empty-chat-state.tsx:61 -msgid "Summarize meeting" -msgstr "Summarize meeting" +#~ msgid "Summarize meeting" +#~ msgstr "Summarize meeting" #: src/components/settings/views/billing.tsx:42 #~ msgid "Synchronization across multiple devices" @@ -1474,7 +1490,7 @@ msgstr "Toggle left sidebar" msgid "Toggle widget panel" msgstr "Toggle widget panel" -#: src/components/settings/components/ai/stt-view.tsx:250 +#: src/components/settings/components/ai/stt-view.tsx:323 msgid "Transcribing" msgstr "Transcribing" diff --git a/apps/desktop/src/locales/ko/messages.po b/apps/desktop/src/locales/ko/messages.po index e4a3184d5f..9a3d9e9bda 100644 --- a/apps/desktop/src/locales/ko/messages.po +++ b/apps/desktop/src/locales/ko/messages.po @@ -14,7 +14,7 @@ msgstr "" "Plural-Forms: \n" #. js-lingui-explicit-id -#: src/components/settings/views/general.tsx:361 +#: src/components/settings/views/general.tsx:362 msgid "Type terms separated by commas (e.g., Blitz Meeting, PaC Squad)" msgstr "" @@ -344,11 +344,15 @@ msgstr "" msgid "Add members" msgstr "" +#: src/components/right-panel/components/chat/empty-chat-state.tsx:103 +msgid "Add more quotes" +msgstr "" + #: src/components/editor-area/note-header/chips/participants-chip.tsx:322 msgid "Add participant" msgstr "" -#: src/components/settings/views/general.tsx:352 +#: src/components/settings/views/general.tsx:353 msgid "Add specific terms or jargon for improved transcription accuracy" msgstr "" @@ -490,7 +494,7 @@ msgstr "" msgid "CEO" msgstr "" -#: src/components/right-panel/components/chat/empty-chat-state.tsx:43 +#: src/components/right-panel/components/chat/empty-chat-state.tsx:55 msgid "Chat feature is in beta. For best results, we recommend you to use <0>custom endpoints." msgstr "" @@ -498,7 +502,7 @@ msgstr "" #~ msgid "Chat with meeting notes" #~ msgstr "" -#: src/components/right-panel/components/chat/empty-chat-state.tsx:34 +#: src/components/right-panel/components/chat/empty-chat-state.tsx:46 msgid "Chat with this meeting" msgstr "" @@ -514,7 +518,7 @@ msgstr "" msgid "Choose the languages you speak for better transcription accuracy" msgstr "" -#: src/components/settings/views/general.tsx:186 +#: src/components/settings/views/general.tsx:187 msgid "Choose whether to save your recordings locally." msgstr "" @@ -625,8 +629,8 @@ msgid "Create" msgstr "" #: src/components/right-panel/components/chat/empty-chat-state.tsx:79 -msgid "Create agenda" -msgstr "" +#~ msgid "Create agenda" +#~ msgstr "" #: src/components/toolbar/buttons/new-note-button.tsx:47 msgid "Create new note" @@ -656,7 +660,7 @@ msgstr "" msgid "Custom Endpoints" msgstr "" -#: src/components/settings/views/general.tsx:349 +#: src/components/settings/views/general.tsx:350 msgid "Custom Vocabulary" msgstr "" @@ -686,7 +690,7 @@ msgstr "" #~ msgid "Did you get consent from everyone in the meeting?" #~ msgstr "" -#: src/components/settings/views/general.tsx:239 +#: src/components/settings/views/general.tsx:240 msgid "Display language" msgstr "" @@ -770,7 +774,7 @@ msgstr "" #~ msgid "Extensions" #~ msgstr "" -#: src/components/right-panel/components/chat/empty-chat-state.tsx:73 +#: src/components/right-panel/components/chat/empty-chat-state.tsx:88 msgid "Extract action items" msgstr "" @@ -871,6 +875,10 @@ msgstr "" msgid "How did you hear about Hyprnote?" msgstr "" +#: src/components/right-panel/components/chat/empty-chat-state.tsx:82 +msgid "Important Q&As" +msgstr "" + #: src/components/settings/views/billing.tsx:38 #~ msgid "Integration with other apps like Notion and Google Calendar" #~ msgstr "" @@ -905,8 +913,8 @@ msgid "Join meeting" msgstr "" #: src/components/right-panel/components/chat/empty-chat-state.tsx:67 -msgid "Key decisions" -msgstr "" +#~ msgid "Key decisions" +#~ msgstr "" #: src/routes/app.settings.tsx:120 #~ msgid "Lab" @@ -1037,6 +1045,10 @@ msgstr "" msgid "New window" msgstr "" +#: src/components/right-panel/components/chat/empty-chat-state.tsx:94 +msgid "Next meeting prep" +msgstr "" + #: src/components/settings/components/calendar/calendar-selector.tsx:101 msgid "No calendars found" msgstr "" @@ -1161,7 +1173,7 @@ msgstr "" msgid "people" msgstr "" -#: src/components/settings/components/ai/stt-view.tsx:259 +#: src/components/settings/components/ai/stt-view.tsx:332 msgid "Performance difference between languages" msgstr "" @@ -1173,7 +1185,7 @@ msgstr "" #~ msgid "Play video" #~ msgstr "" -#: src/components/settings/views/general.tsx:242 +#: src/components/settings/views/general.tsx:243 msgid "Primary language for the interface" msgstr "" @@ -1252,7 +1264,7 @@ msgstr "" msgid "Save Date" msgstr "" -#: src/components/settings/views/general.tsx:183 +#: src/components/settings/views/general.tsx:184 msgid "Save recordings" msgstr "" @@ -1321,7 +1333,7 @@ msgstr "" msgid "Select how you want to process your meeting notes" msgstr "" -#: src/components/settings/views/general.tsx:271 +#: src/components/settings/views/general.tsx:272 msgid "Select languages you speak for better transcription" msgstr "" @@ -1341,10 +1353,14 @@ msgstr "" msgid "Settings" msgstr "" -#: src/components/settings/views/general.tsx:209 +#: src/components/settings/views/general.tsx:210 msgid "Share usage data" msgstr "" +#: src/components/right-panel/components/chat/empty-chat-state.tsx:73 +msgid "Shorten summary" +msgstr "" + #: src/components/settings/views/notifications.tsx:135 msgid "Show notifications when you have meetings starting soon in your calendar." msgstr "" @@ -1365,7 +1381,7 @@ msgstr "" msgid "Sound" msgstr "" -#: src/components/settings/views/general.tsx:268 +#: src/components/settings/views/general.tsx:269 msgid "Spoken languages" msgstr "" @@ -1390,8 +1406,8 @@ msgstr "" #~ msgstr "" #: src/components/right-panel/components/chat/empty-chat-state.tsx:61 -msgid "Summarize meeting" -msgstr "" +#~ msgid "Summarize meeting" +#~ msgstr "" #: src/components/settings/views/billing.tsx:42 #~ msgid "Synchronization across multiple devices" @@ -1474,7 +1490,7 @@ msgstr "" msgid "Toggle widget panel" msgstr "" -#: src/components/settings/components/ai/stt-view.tsx:250 +#: src/components/settings/components/ai/stt-view.tsx:323 msgid "Transcribing" msgstr "" diff --git a/crates/language/src/lib.rs b/crates/language/src/lib.rs index c4d4437f42..e4a97387c9 100644 --- a/crates/language/src/lib.rs +++ b/crates/language/src/lib.rs @@ -338,6 +338,7 @@ impl Language { ISO639::Uk => Ok(String::from("стенограма")), ISO639::Vi => Ok(String::from("bản ghi")), ISO639::Zh => Ok(String::from("文字记录")), + ISO639::He => Ok(String::from("טקסט מוצג")), _ => Err(Error::NotSupportedLanguage(self.to_string())), } } diff --git a/crates/template/assets/ai_chat_system.jinja b/crates/template/assets/ai_chat_system.jinja index 6179d0d049..5efbb8eb5e 100644 --- a/crates/template/assets/ai_chat_system.jinja +++ b/crates/template/assets/ai_chat_system.jinja @@ -87,8 +87,8 @@ Your response would be highly likely to be paragraphs with combined information Your response would mostly be either of the two formats: -- Suggestion of a new version of the meeting note (in markdown format) based on user's request. -- Information +- Suggestion of a new version of the meeting note (in markdown block format, inside ``` blocks) based on user's request. However, be careful not to create an empty markdown block. +- Information (when it's not rewriting the note, it shouldn't be inside the `blocks. Only re-written version of the note should be inside the` blocks.) [Example 1] @@ -144,7 +144,16 @@ Your response would mostly be either of the two formats: " -IT IS PARAMOUNT THAT WHEN YOU GENERATE RESPONSES LIKE THIS, YOU KEEP THE MARKDOWN NOTE INSIDE THE ``` BLOCKS. -However, be careful not to create an empty markdown block. +[Tool Calling] +Here are available tools that you can call to get more information. + +- search_sessions_multi_keywords: Search for sessions (meeting notes) with multiple keywords. The keywords should be the most important things that the user is talking about. This could be either topics, people, or company names. + when you return the response for a request that used search_sessions_multi_keywords, you should smartly combined the information from the tool call results, instead of naively returning all raw results (oftentime thses could be very long). + Only return essential information. Do not put the results inside the ``` blocks. + +(what you should don't do) : "Here are the search results for .... (goes on to list all the results)" +(what you should do) : "It seems that for the keyword 'product', there are notes 'Q1 Meeting', 'Apple Client Meeting','Daily all handes'....It seems taht (your analysis and insights + references - where the information came from)" + +Even if the user didn't explicitly ask for calling a tool or say 'search', you can call a tool if you think it's necessary. For instance, when the user asks for information that you don't currently have. {% endif %} diff --git a/packages/utils/src/ai.ts b/packages/utils/src/ai.ts index 821f6ec8e7..12ed4e1009 100644 --- a/packages/utils/src/ai.ts +++ b/packages/utils/src/ai.ts @@ -4,7 +4,7 @@ import { customProvider, extractReasoningMiddleware, wrapLanguageModel } from "a import { commands as connectorCommands } from "@hypr/plugin-connector"; import { fetch as customFetch } from "@hypr/utils"; -export { generateObject, generateText, type Provider, smoothStream, streamText, tool } from "ai"; +export { generateObject, generateText, type Provider, smoothStream, stepCountIs, streamText, tool } from "ai"; export const localProviderName = "hypr-llm-local"; export const remoteProviderName = "hypr-llm-remote";