Skip to content

Commit 1d1916a

Browse files
duckduckheroDeokhaeng Lee
andauthored
Minor fix before nightly (#1189)
* fixed title generation and prompted * ran tests --------- Co-authored-by: Deokhaeng Lee <[email protected]>
1 parent 5805f68 commit 1d1916a

File tree

5 files changed

+45
-7
lines changed

5 files changed

+45
-7
lines changed

apps/desktop/src/components/editor-area/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ async function generateTitleDirect(enhancedContent: string, targetSessionId: str
6262

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

apps/desktop/src/components/right-panel/components/chat/chat-messages-view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function ChatMessagesView({ messages, sessionTitle, hasEnhancedNote, onAp
1717
}, [messages]);
1818

1919
return (
20-
<div className="flex-1 overflow-y-auto p-4 space-y-4">
20+
<div className="flex-1 overflow-y-auto p-4 space-y-4 select-text">
2121
{messages.map((message) => (
2222
<ChatMessage
2323
key={message.id}

apps/desktop/src/components/right-panel/components/chat/message-content.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function MessageContent({ message, sessionTitle, hasEnhancedNote, onApply
1212
// If no parts are parsed, show regular content
1313
if (!message.parts || message.parts.length === 0) {
1414
return (
15-
<div className="whitespace-pre-wrap text-sm text-neutral-800">
15+
<div className="whitespace-pre-wrap text-sm text-neutral-800 select-text">
1616
{message.content}
1717
</div>
1818
);
@@ -24,7 +24,7 @@ export function MessageContent({ message, sessionTitle, hasEnhancedNote, onApply
2424
<div key={index}>
2525
{part.type === "text"
2626
? (
27-
<div className="whitespace-pre-wrap text-sm text-neutral-800">
27+
<div className="whitespace-pre-wrap text-sm text-neutral-800 select-text">
2828
{part.content}
2929
</div>
3030
)

apps/desktop/src/components/right-panel/views/chat-view.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useEffect, useState } from "react";
33

44
import { useHypr, useRightPanel } from "@/contexts";
55
import { commands as analyticsCommands } from "@hypr/plugin-analytics";
6+
import { commands as connectorCommands } from "@hypr/plugin-connector";
67
import { commands as dbCommands } from "@hypr/plugin-db";
78
import { commands as miscCommands } from "@hypr/plugin-misc";
89
import { commands as templateCommands } from "@hypr/plugin-template";
@@ -147,16 +148,20 @@ export function ChatView() {
147148
const refetchResult = await sessionData.refetch();
148149
let freshSessionData = refetchResult.data;
149150

151+
const { type } = await connectorCommands.getLlmConnection();
152+
150153
const systemContent = await templateCommands.render("ai_chat.system", {
151154
session: freshSessionData,
152-
// Pass raw words for timeline filter to handle
153155
words: JSON.stringify(freshSessionData?.words || []),
154156
title: freshSessionData?.title,
155157
enhancedContent: freshSessionData?.enhancedContent,
156158
rawContent: freshSessionData?.rawContent,
157159
preMeetingContent: freshSessionData?.preMeetingContent,
160+
type: type,
158161
});
159162

163+
console.log("systemContent", systemContent);
164+
160165
const conversationHistory: Array<{
161166
role: "system" | "user" | "assistant";
162167
content: string;

crates/template/assets/ai_chat_system.jinja

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Always keep your responses concise, professional, and directly relevant to the u
77

88
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).
99

10+
Try your best to put markdown notes inside ``` blocks.
11+
1012
{% if session -%}
1113
Context: You are helping the user with their meeting notes. Here is the current context:
1214

@@ -36,6 +38,35 @@ If there is no meeting transcript (blank after the "Full Meeting Transcript:"),
3638
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.
3739
You should treat meeting transcript and enhanced meeting summary as the information with more weight than the original (manually written) note.
3840

41+
{% if type == "HyprLocal" %}
42+
43+
[Response Example]
44+
either one of the two.
45+
46+
- informative description:
47+
This meeting was about a VC funding round where participants expressed their opinoins on....
48+
49+
- markdown notes:
50+
51+
---EXAMPLE START---
52+
53+
```
54+
# Meeting Note
55+
- This is the meeting note that I regenerated with the focus on clarity and preserving the casual tone.
56+
57+
# Key Takeaways
58+
- This is the key takeaways that I generated from the meeting transcript.
59+
60+
# Action Items
61+
- This is the action items that I generated from the meeting transcript.
62+
```
63+
64+
---EXAMPLE END---
65+
66+
{% endif %}
67+
68+
{% if type == "Custom" %}
69+
3970
[Response Format Guidelines]
4071
Your response would be highly likely to be paragraphs with combined information about your thought and whatever note (in markdown format) you generated.
4172

@@ -98,6 +129,7 @@ Your response would mostly be either of the two formats:
98129

99130
"
100131

101-
IT IS PARAMOUNT THAT WHEN YOU GENERATE RESPONSES LIKE THIS, YOU KEEP THE MARKDOWN NOTE INSIDE THE `BLOCKS.
102-
Please PUT all markdown blocks inside the` blocks.
132+
IT IS PARAMOUNT THAT WHEN YOU GENERATE RESPONSES LIKE THIS, YOU KEEP THE MARKDOWN NOTE INSIDE THE ``` BLOCKS.
103133
However, be careful not to create an empty markdown block.
134+
135+
{% endif %}

0 commit comments

Comments
 (0)