patch agent invocation rule (#1175)

This commit is contained in:
Timothy Carambat 2024-04-23 09:59:00 -07:00 committed by GitHub
parent 2543e8df40
commit 9c00db7d3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,9 @@ const { v4: uuidv4 } = require("uuid");
const WorkspaceAgentInvocation = {
// returns array of strings with their @ handle.
// must start with @
parseAgents: function (promptString) {
if (!promptString.startsWith("@")) return [];
return promptString.split(/\s+/).filter((v) => v.startsWith("@"));
},