Skip to content

Dynamic System prompts not being included on fresh runs with message_history #1646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
strunov opened this issue May 5, 2025 · 2 comments
Open
2 tasks done
Assignees
Labels
question Further information is requested

Comments

@strunov
Copy link

strunov commented May 5, 2025

Initial Checks

Description

As mentioned in the title, the documentation implies that dynamic prompts are always evaluated even if message_history is present. So far, logging all_messages() and putting a bunch of print statemetns all over the place seems to imply that they don't get included

The LLM model responses also suggest that the content from dynamic system prompts is not being included
(I use Gemini models)

Example Code

Python, Pydantic AI & LLM client version

pydantic-ai 0.1.9
Gemini 2.0
@Kludex
Copy link
Member

Kludex commented May 6, 2025

Did you try instructions?

@Kludex Kludex added question Further information is requested and removed need confirmation labels May 6, 2025
@Kludex Kludex self-assigned this May 6, 2025
@strunov
Copy link
Author

strunov commented May 7, 2025

Yes, instructions work, though my understanding was that system prompts were the main mechanism to provide initial LLM role steering and dynamic context, particularly if this is the kind of context you cannot emit to the client side app as part of the message history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants