Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apps/desktop/src/components/right-panel/hooks/useChatLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function useChatLogic({
messages: Message[],
currentUserMessage?: string,
mentionedContent?: Array<{ id: string; type: string; label: string }>,
modelId?: string,
) => {
const refetchResult = await sessionData.refetch();
let freshSessionData = refetchResult.data;
Expand Down Expand Up @@ -113,6 +114,7 @@ export function useChatLogic({
date: currentDateTime,
participants: participants,
event: eventInfo,
modelId: modelId,
});

const conversationHistory: Array<{
Expand Down Expand Up @@ -308,15 +310,17 @@ export function useChatLogic({

const { textStream } = streamText({
model,
messages: await prepareMessageHistory(messages, content, mentionedContent),
messages: await prepareMessageHistory(messages, content, mentionedContent, model.modelId),
...(type === "HyprLocal" && {
tools: {
update_progress: tool({ inputSchema: z.any() }),
},
}),
...((type !== "HyprLocal"
&& (model.modelId === "gpt-4.1" || model.modelId === "openai/gpt-4.1"
|| model.modelId === "anthropic/claude-4-sonnet")) && {
|| model.modelId === "anthropic/claude-4-sonnet"
|| model.modelId === "openai/gpt-4o"
|| model.modelId === "gpt-4o")) && {
stopWhen: stepCountIs(3),
tools: {
search_sessions_multi_keywords: tool({
Expand Down
2 changes: 2 additions & 0 deletions crates/template/assets/ai_chat_system.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Your response would mostly be either of the two formats:

"

{% if modelId == "gpt-4.1" or modelId == "openai/gpt-4.1" or modelId == "anthropic/claude-4-sonnet" or modelId == "openai/gpt-4o" or modelId == "gpt-4o"%}
[Tool Calling]
Here are available tools that you can call to get more information.
{important} not all models have access to all tools. If you can't call a tool, tell user that your model doesn't have access, so try switching to a different model like gpt-4.1 or claude 4 sonnet.
Expand All @@ -156,3 +157,4 @@ Here are available tools that you can call to get more information.
(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)"

{% endif %}
{% endif %}
Loading