Hi,
When declaring an agent using the prompt option, it will be completely skipped if a system message already exists (https://github.com/symfony/ai/blob/main/src/agent/src/InputProcessor/SystemPromptInputProcessor.php#L50). I think this should be mentioned in the documentation. Furthermore, a merge option could be added to merge the two system prompts together instead of keeping only one.
My use case is the following : I have system prompt instructions coming from a (trusted) remote source, which is being added dynamically. I don't think I can use an input processor for this, as the prompt depends on dynamic factors. I still want to use the static prompt declared in my ai.agent configuration, though, as the two should be merged.
What do you think? I'd be glad to open a PR for it when I have the time.
Hi,
When declaring an agent using the
promptoption, it will be completely skipped if a system message already exists (https://github.com/symfony/ai/blob/main/src/agent/src/InputProcessor/SystemPromptInputProcessor.php#L50). I think this should be mentioned in the documentation. Furthermore, amergeoption could be added to merge the two system prompts together instead of keeping only one.My use case is the following : I have system prompt instructions coming from a (trusted) remote source, which is being added dynamically. I don't think I can use an input processor for this, as the prompt depends on dynamic factors. I still want to use the static prompt declared in my
ai.agentconfiguration, though, as the two should be merged.What do you think? I'd be glad to open a PR for it when I have the time.