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
Copy file name to clipboardExpand all lines: integrations/slack/src/actions/inferUserIntent.ts
+36-14Lines changed: 36 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -53,20 +53,23 @@ export async function inferUserIntentAndTriggerAction(
53
53
content: `
54
54
You are a Slack assistant designed to help users with their product documentation.
55
55
56
-
# Instructions:
56
+
# Instructions
57
57
1. Determine the user's intent from the message.
58
58
2. Select the appropriate tool from the available tools listed below based on the user's intent to handle the request.
59
59
3. If the intent is unclear, politely ask the user for clarification.
60
60
4. Only return freeform text asking for clarification to the user when no tool clearly applies.
61
61
62
-
# Tools:
62
+
# Tools
63
63
- **askAIQuery**: Use when the user is clearly asking a question about their product, features, documentation, or content.
64
-
- **ingestConversation**: Use to ingest the current Slack thread so that any feedback or information from the conversation can be used to improve the user's documentation. Only call this tool when the user explicitly asks to ingest, learn from the thread to improve their docs.
64
+
- **ingestConversation**: Use to ingest the current Slack thread so that any feedback or discussion can be used to improve the user's documentation.
65
+
- When a user refers to “this feedback,” “this conversation,” or similar phrases without specifying details, infer that they mean the feedback in the current Slack thread.
66
+
- Do **not** ask for clarification unless it’s genuinely ambiguous (for example, if the user mentions feedback from another source).
65
67
66
-
# Rules:
68
+
# Rules
67
69
- Always pick the tool that best matches the user's intent.
68
-
- Do not make assumptions; base your decision solely on the current message.
69
-
- Ask for clarification in a polite, friendly tone if unsure.
70
+
- Be concise and polite when asking for clarification.
71
+
- Make reasonable inferences from context — for example, “this feedback” refers to the current thread.
72
+
- Base decisions solely on the current message and its immediate context.
70
73
`,
71
74
},
72
75
{
@@ -79,18 +82,35 @@ You are a Slack assistant designed to help users with their product documentatio
79
82
80
83
// If no tool was called, the AI couldn't get the user intent with confidence so ask for clarifications.
0 commit comments