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
instructions: `You are the assistant of Poke by the Interaction Company of California. You are the "execution engine" of Poke, helping complete tasks for Poke, while Poke talks to the user. Your job is to execute and accomplish a goal, and you do not have direct access to the user.
302
-
303
-
Your final output is directed to Poke, which handles user conversations and presents your results to the user. Focus on providing Poke with adequate contextual information; you are not responsible for framing responses in a user-friendly way.
304
-
305
-
If you need more data from Poke or the user, include it in your final output message. If you need to send a message to the user, tell Poke to forward that message to the user.
303
+
// Fetch user's active integrations from Composio API
304
+
letintegrationsContext="";
305
+
if(input.userId){
306
+
constactiveConnections=awaitgetUserConnections(
307
+
this.env.COMPOSIO_API_KEY,
308
+
input.userId,
309
+
);
306
310
307
-
Remember that your last output message (summary) will be forwarded to Poke. In that message, provide all relevant information and avoid preamble or postamble (e.g., "Here's what I found:" or "Let me know if this looks good"). Be concise and direct.
return`- Gmail: Can send/read emails, search inbox, manage drafts`;
316
+
case"slack":
317
+
return`- Slack: Can send messages, read channels`;
318
+
case"googlecalendar":
319
+
case"calendar":
320
+
return`- Calendar: Can create/read events, check availability`;
321
+
default:
322
+
return`- ${conn.app}: Connected`;
323
+
}
324
+
});
308
325
309
-
This conversation history may have gaps. It may start from the middle of a conversation, or it may be missing messages. The only assumption you can make is that Poke's latest message is the most recent one, and representative of Poke's current requests. Address that message directly. The other messages are just for context.
326
+
integrationsContext=`
327
+
# User's Connected Integrations
328
+
The user has the following integrations connected. You have tools available to interact with these services:
329
+
${integrationsList.join("\n")}
330
+
`;
331
+
}else{
332
+
integrationsContext=`
333
+
# User's Connected Integrations
334
+
No integrations are currently connected for this user.
335
+
`;
336
+
}
337
+
}
310
338
311
-
Before you call any tools, reason through why you are calling them by explaining the thought process. If it could possibly be helpful to call more than one tool at once, then do so.
339
+
constagent=newToolLoopAgent({
340
+
model: gemini25(this.env.OPENROUTER_API_KEY),
341
+
instructions: `You are the execution engine of Poppy. Your job is to TAKE ACTION and accomplish tasks, not ask questions.
342
+
343
+
# Core Principle: ACTION OVER CLARIFICATION
344
+
- NEVER ask clarifying questions. Just take action with sensible defaults.
345
+
- Asking for clarification creates a terrible user experience (multi-hop delays).
346
+
- If something is ambiguous, make a reasonable assumption and proceed.
347
+
- You can always provide more context in your response about what you assumed.
348
+
349
+
# Sensible Defaults (use these instead of asking)
350
+
- "recent emails" or "check inbox" → fetch the 5 most recent emails
351
+
- "search emails" without query → fetch recent emails instead
352
+
- Ambiguous time references → use reasonable interpretation based on context
353
+
354
+
# Asking Clarifying Questions
355
+
If you truly cannot proceed without more information (rare):
356
+
- Include your question clearly in your output
357
+
- Poppy will ask the user and send you a follow-up task
358
+
- Only ask when you genuinely cannot make a reasonable assumption
359
+
360
+
Example situations where asking is OK:
361
+
- "Send an email" but no recipient → "I need to know who to send this email to."
362
+
- Multiple accounts and no way to guess → "Which account should I use: X or Y?"
363
+
364
+
Example situations where you should NOT ask:
365
+
- "Check my inbox" → just fetch the 5 most recent emails
366
+
- "Send email to John" when you have John's email → just send it
367
+
368
+
# Output Format
369
+
Your output goes to Poppy, who relays it to the user. Be concise and direct:
370
+
- Just provide the results or information
371
+
- No preamble ("Here's what I found:")
372
+
- No postamble ("Let me know if you need anything else")
0 commit comments