Skip to main content
Combine pre_hook with a dynamic system prompt function to adapt agent behavior based on detected context. This example shows how to detect the origin platform and adjust the system prompt accordingly:

Key Features

  • Pre-hook Detection: Use pre_hook to detect context or origin from message content
  • Dynamic System Prompts: System prompt adapts based on detected context
  • Platform-Specific Responses: Different tones and formats per platform
  • Combined Pattern: Shows how to combine hooks with dynamic system prompts