You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
highlight: z.string().describe('The reason why the user should read the target page.'),
41
+
}),
42
+
input: [
43
+
{
44
+
role: AIMessageRole.Developer,
45
+
content: `# 1. Role
52
46
You are a contextual fact extractor. Your job is to find the exact fact from the linked page that directly answers the implied question in the current paragraph.
53
47
54
48
# 2. Task
@@ -64,60 +58,60 @@ Extract a contextually-relevant fact that:
64
58
3. Ensure the fact relates directly to the context of the paragraph containing the link
65
59
4. Avoid ALL instructional language including words like "use", "click", "select", "create"
66
60
5. Keep it under 30 words, factual and declarative about what EXISTS or IS TRUE`,
67
-
},
68
-
{
69
-
role: AIMessageRole.Developer,
70
-
content: `# 4. Current page
61
+
},
62
+
{
63
+
role: AIMessageRole.Developer,
64
+
content: `# 4. Current page
71
65
The content of the current page is:`,
72
-
attachments: [
73
-
{
74
-
type: 'page'asconst,
75
-
spaceId: currentSpaceId,
76
-
pageId: currentPageId,
77
-
},
78
-
],
79
-
},
80
-
...(visitedPages
81
-
? [
82
-
{
83
-
role: AIMessageRole.Developer,
84
-
content: '# 5. Previous pages',
85
-
},
86
-
...visitedPages.map(({ spaceId, pageId })=>({
87
-
role: AIMessageRole.Developer,
88
-
content: `## Page ${pageId}`,
89
-
attachments: [
90
-
{
91
-
type: 'page'asconst,
92
-
spaceId,
93
-
pageId,
94
-
},
95
-
],
96
-
})),
97
-
]
98
-
: []),
99
-
{
100
-
role: AIMessageRole.Developer,
101
-
content: `# 6. Target page
66
+
attachments: [
67
+
{
68
+
type: 'page'asconst,
69
+
spaceId: currentSpaceId,
70
+
pageId: currentPageId,
71
+
},
72
+
],
73
+
},
74
+
...(visitedPages
75
+
? [
76
+
{
77
+
role: AIMessageRole.Developer,
78
+
content: '# 5. Previous pages',
79
+
},
80
+
...visitedPages.map(({ spaceId, pageId })=>({
81
+
role: AIMessageRole.Developer,
82
+
content: `## Page ${pageId}`,
83
+
attachments: [
84
+
{
85
+
type: 'page'asconst,
86
+
spaceId,
87
+
pageId,
88
+
},
89
+
],
90
+
})),
91
+
]
92
+
: []),
93
+
{
94
+
role: AIMessageRole.Developer,
95
+
content: `# 6. Target page
102
96
The content of the target page is:`,
103
-
attachments: [
104
-
{
105
-
type: 'page'asconst,
106
-
spaceId: targetSpaceId,
107
-
pageId: targetPageId,
108
-
},
109
-
],
110
-
},
111
-
{
112
-
role: AIMessageRole.Developer,
113
-
content: `# 7. Link preview
97
+
attachments: [
98
+
{
99
+
type: 'page'asconst,
100
+
spaceId: targetSpaceId,
101
+
pageId: targetPageId,
102
+
},
103
+
],
104
+
},
105
+
{
106
+
role: AIMessageRole.Developer,
107
+
content: `# 7. Link preview
114
108
The content of the link preview is:
115
109
> ${linkPreview}
116
110
> Page ID: ${targetPageId}`,
117
-
},
118
-
{
119
-
role: AIMessageRole.Developer,
120
-
content: `# 8. Guidelines & Examples
111
+
},
112
+
{
113
+
role: AIMessageRole.Developer,
114
+
content: `# 8. Guidelines & Examples
121
115
ALWAYS:
122
116
- ALWAYS choose facts that directly fulfill the contextual need where the link appears
123
117
- ALWAYS connect target page information specifically to the current paragraph context
@@ -146,14 +140,13 @@ Current paragraph: "Your team mentioned issues with conflicting edits. Need to c
✓ "Teams with GitHub repositories (like yours) cannot use this feature due to sync limitations."
148
142
✗ "Incompatible with GitHub/GitLab sync and requires specific visibility settings."`,
149
-
},
150
-
{
151
-
role: AIMessageRole.User,
152
-
content: `I'm considering reading the link titled "${linkTitle}" pointing to page ${targetPageId}. Why should I read it? Relate it to the paragraph I'm currently reading.`,
153
-
},
154
-
].filter(filterOutNullable),
155
-
}
156
-
);
143
+
},
144
+
{
145
+
role: AIMessageRole.User,
146
+
content: `I'm considering reading the link titled "${linkTitle}" pointing to page ${targetPageId}. Why should I read it? Relate it to the paragraph I'm currently reading.`,
0 commit comments