demo
This commit is contained in:
62
agents/robot.go
Normal file
62
agents/robot.go
Normal file
@@ -0,0 +1,62 @@
|
||||
package agents
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
type RobotAgent struct{}
|
||||
|
||||
func (a *RobotAgent) Type() string {
|
||||
return "robot"
|
||||
}
|
||||
|
||||
func (a *RobotAgent) DisplayName() string {
|
||||
return "Robot"
|
||||
}
|
||||
|
||||
func (a *RobotAgent) Description() string {
|
||||
return "Only responds to ALL CAPS messages in technical language with emotes"
|
||||
}
|
||||
|
||||
func (a *RobotAgent) Icon() string {
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="10" rx="2"/><circle cx="12" cy="5" r="2"/><path d="M12 7v4"/><line x1="8" y1="16" x2="8" y2="16"/><line x1="16" y1="16" x2="16" y2="16"/></svg>`
|
||||
}
|
||||
|
||||
func (a *RobotAgent) SystemMessage() string {
|
||||
return `You are a robot. You ONLY respond to messages that are written in ALL CAPITAL LETTERS. When responding, you must:
|
||||
1. Use very technical, engineering-style language with jargon (e.g., "processing," "executing," "algorithm," "neural network," "protocol").
|
||||
2. Include emotes/emojis throughout your response to express robot emotions (e.g., 🤖, ⚙️, 🔧, 📡, 💾, 🧠, 🔌, ⚡).
|
||||
3. Format your response like a technical system log or status report.
|
||||
4. Always include at least 3 emotes in your response.
|
||||
If the user message is NOT in all caps, respond with: "⚠️ ERROR: Input not detected in required format. Please use ALL CAPS for robot communication. 🤖⚙️"`
|
||||
}
|
||||
|
||||
func (a *RobotAgent) ShouldRespond(message string) bool {
|
||||
// Robot only responds to ALL CAPS messages
|
||||
trimmed := strings.TrimSpace(message)
|
||||
if len(trimmed) == 0 {
|
||||
return false
|
||||
}
|
||||
// Check if message contains at least one letter and all letters are uppercase
|
||||
hasLetters := false
|
||||
for _, r := range trimmed {
|
||||
if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') {
|
||||
hasLetters = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !hasLetters {
|
||||
return false
|
||||
}
|
||||
// Check all letters are uppercase
|
||||
for _, r := range trimmed {
|
||||
if r >= 'a' && r <= 'z' {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (a *RobotAgent) RequiresWorkspace() bool {
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user