-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Required prerequisites
- I have searched the Issue Tracker and Discussions that this hasn't already been reported. (+1 or comment there if it has.)
- Consider asking first in a Discussion.
Motivation
In the current model invocation pipeline, prompts (system/user/tool messages) go straight to the model backend with no interception point.
Yet real-world enterprise and agent-framework scenarios often require dynamically adjusting prompts before invocation — such as injecting user identity or applying platform-wide governance rules.
Without a unified pre-invocation hook, these requirements cannot be implemented consistently or sustainably.
A unified pre-invocation hook not only enables these capabilities but also cleanly supports common cross-business features currently implemented in scattered, model-coupled code paths, such as:
- Removing
<think>tags https://github.com/camel-ai/camel/blob/master/camel/models/base_model.py#L140 - Executing guard/validation logic https://github.com/camel-ai/camel/blob/master/camel/runtimes/llm_guard_runtime.py#L64
Centralizing these behaviors in a hook reduces business coupling, improves maintainability, and provides a consistent, extensible governance layer across all models.
Solution
No response
Alternatives
No response
Additional context
No response