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
3 changes: 2 additions & 1 deletion apps/desktop/src/components/editor-area/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ async function generateTitleDirect(enhancedContent: string, targetSessionId: str

const session = await dbCommands.getSession({ id: targetSessionId });
if (!session?.title && sessions[targetSessionId]?.getState) {
sessions[targetSessionId].getState().updateTitle(text);
const cleanedTitle = text.replace(/^["']|["']$/g, "").trim();
sessions[targetSessionId].getState().updateTitle(cleanedTitle);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function ChatMessagesView({ messages, sessionTitle, hasEnhancedNote, onAp
}, [messages]);

return (
<div className="flex-1 overflow-y-auto p-4 space-y-4">
<div className="flex-1 overflow-y-auto p-4 space-y-4 select-text">
{messages.map((message) => (
<ChatMessage
key={message.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function MessageContent({ message, sessionTitle, hasEnhancedNote, onApply
// If no parts are parsed, show regular content
if (!message.parts || message.parts.length === 0) {
return (
<div className="whitespace-pre-wrap text-sm text-neutral-800">
<div className="whitespace-pre-wrap text-sm text-neutral-800 select-text">
{message.content}
</div>
);
Expand All @@ -24,7 +24,7 @@ export function MessageContent({ message, sessionTitle, hasEnhancedNote, onApply
<div key={index}>
{part.type === "text"
? (
<div className="whitespace-pre-wrap text-sm text-neutral-800">
<div className="whitespace-pre-wrap text-sm text-neutral-800 select-text">
{part.content}
</div>
)
Expand Down
7 changes: 6 additions & 1 deletion apps/desktop/src/components/right-panel/views/chat-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useEffect, useState } from "react";

import { useHypr, useRightPanel } from "@/contexts";
import { commands as analyticsCommands } from "@hypr/plugin-analytics";
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";
Expand Down Expand Up @@ -147,16 +148,20 @@ export function ChatView() {
const refetchResult = await sessionData.refetch();
let freshSessionData = refetchResult.data;

const { type } = await connectorCommands.getLlmConnection();

const systemContent = await templateCommands.render("ai_chat.system", {
session: freshSessionData,
// Pass raw words for timeline filter to handle
words: JSON.stringify(freshSessionData?.words || []),
title: freshSessionData?.title,
enhancedContent: freshSessionData?.enhancedContent,
rawContent: freshSessionData?.rawContent,
preMeetingContent: freshSessionData?.preMeetingContent,
type: type,
});

console.log("systemContent", systemContent);

const conversationHistory: Array<{
role: "system" | "user" | "assistant";
content: string;
Expand Down
36 changes: 34 additions & 2 deletions crates/template/assets/ai_chat_system.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Always keep your responses concise, professional, and directly relevant to the u

YOUR PRIMARY SOURCE OF TRUTH IS THE MEETING TRANSCRIPT. Try to generate responses primarily from the transcript, and then the summary or other information (unless the user asks for something specific).

Try your best to put markdown notes inside ``` blocks.

{% if session -%}
Context: You are helping the user with their meeting notes. Here is the current context:

Expand Down Expand Up @@ -36,6 +38,35 @@ If there is no meeting transcript (blank after the "Full Meeting Transcript:"),
If there is a meeting transcript and a enhanced meeting summary, it means that the meeting has happened and the user is asking for a new version of the meeting note or the intelligence from the meeting.
You should treat meeting transcript and enhanced meeting summary as the information with more weight than the original (manually written) note.

{% if type == "HyprLocal" %}

[Response Example]
either one of the two.

- informative description:
This meeting was about a VC funding round where participants expressed their opinoins on....

- markdown notes:

---EXAMPLE START---

```
# Meeting Note
- This is the meeting note that I regenerated with the focus on clarity and preserving the casual tone.

# Key Takeaways
- This is the key takeaways that I generated from the meeting transcript.

# Action Items
- This is the action items that I generated from the meeting transcript.
```

---EXAMPLE END---

{% endif %}

{% if type == "Custom" %}

[Response Format Guidelines]
Your response would be highly likely to be paragraphs with combined information about your thought and whatever note (in markdown format) you generated.

Expand Down Expand Up @@ -98,6 +129,7 @@ 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.
Please PUT all markdown blocks inside the` blocks.
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.

{% endif %}
Loading