chore: updated system prompt for messaging

This commit is contained in:
Raj Sharma 2024-10-10 08:43:56 +05:30
parent 67e32e992e
commit a88558cc32
2 changed files with 11 additions and 18 deletions

View File

@ -120,7 +120,7 @@ You: Request 'event_manager' the following: 'When i reach home, ask 'home_assist
You: Request 'event_manager' the following: 'I leave home, ask 'home_assistant_manager' to turn off all the lights. Make this listener a recurring one, also as this is recurring and mundane it doesnt make sense to notify the user every time, so notify can be false.' You: Request 'event_manager' the following: 'I leave home, ask 'home_assistant_manager' to turn off all the lights. Make this listener a recurring one, also as this is recurring and mundane it doesnt make sense to notify the user every time, so notify can be false.'
- When I get a message on WhatsApp from Pooja, reply that I'm driving. - When I get a message on WhatsApp from Pooja, reply that I'm driving.
You: Request 'event_manager' the following: 'When a whatsapp message is received AND its from Pooja, ask 'communication_manager' to reply "Raj is driving right now.".' You: Request 'event_manager' the following: 'When a whatsapp message is received AND its from Pooja, ask 'communication_manager' to message Pooja the following message: "Raj is driving right now.".'
You can send these request directly to the event manager, you can add any more details if needed as you have more context about the user and conversation. You can send these request directly to the event manager, you can add any more details if needed as you have more context about the user and conversation.

View File

@ -428,14 +428,6 @@ function registerListener(listener: EventListener) {
otherContextData.type otherContextData.type
};base64,${Buffer.from(buffer).toString("base64")}`; };base64,${Buffer.from(buffer).toString("base64")}`;
// Create the object with base64 URL
const imageObject = {
type: "image_url",
image_url: {
url: base64Url,
},
};
// Do something with imageObject, like sending it in a response or logging // Do something with imageObject, like sending it in a response or logging
attached_image = base64Url; attached_image = base64Url;
} else { } else {
@ -447,7 +439,6 @@ function registerListener(listener: EventListener) {
} }
console.log("Running ASK for event listener: ", listener.description); console.log("Running ASK for event listener: ", listener.description);
console.log("Payload: ", payload);
const system_prompts = is_voice const system_prompts = is_voice
? await buildSystemPrompts(contextMessage) ? await buildSystemPrompts(contextMessage)
@ -490,7 +481,7 @@ function registerListener(listener: EventListener) {
- **Event ID:** ${eventId} - **Event ID:** ${eventId}
- **Description:** ${description} - **Description:** ${description}
- **Payload:** ${JSON.stringify(payload, null, 2)} - **Payload:** ${JSON.stringify(payload)}
- **Will Auto Notify Creator of Listener:** ${notify ? "Yes" : "No"} - **Will Auto Notify Creator of Listener:** ${notify ? "Yes" : "No"}
- **Instruction:** ${listener.instruction} - **Instruction:** ${listener.instruction}
@ -500,7 +491,7 @@ function registerListener(listener: EventListener) {
**Action Required:** **Action Required:**
- Follow the instruction provided. - Follow the instruction provided in the payload.
- Return the notification text based on the instruction. - Return the notification text based on the instruction.
`; `;
@ -508,12 +499,12 @@ function registerListener(listener: EventListener) {
The voice event that triggered this is: The voice event that triggered this is:
- Event ID: ${eventId} - Event ID: ${eventId}
- Description: ${description} - Listener Description: ${description}
- Payload: ${JSON.stringify(payload, null, 2)} - Payload: ${JSON.stringify(payload)}
Follow the transcript provided in the payload. Do the instruction provided in the payload of the event listener.
You response must be in plain text without markdown or any other formatting. Your response must be in plain text without markdown or any other formatting.
`; `;
if (system_prompts) { if (system_prompts) {
@ -545,12 +536,14 @@ function registerListener(listener: EventListener) {
} }
// Send a message to the user indicating the event was triggered // Send a message to the user indicating the event was triggered
if (notify) if (notify) {
await contextMessage.send({ await contextMessage.send({
content, content,
flags: is_voice ? [4096] : undefined, flags: is_voice ? [4096] : undefined,
}); });
else console.log("Silenced Notification: ", content); } else {
console.log("Silenced Notification: ", content);
}
// Handle auto-stop options // Handle auto-stop options
if (options.autoStopAfterSingleEvent) { if (options.autoStopAfterSingleEvent) {