https://promptfoo.dev/ logo
Using python globals in a provider
# ❓|questions
a
I have a python provider used in a multi-turn conversation and want to preserve state between turns. However I noticed that any globals I have in the provider are reset after each turn. How can I preserve some state between turns? (The reason I want to do this is the provider is generating code that needs that state across turns).
p
Are you able to post the provider script (nerfed, of course)?
Is this too complex? I can try to reduce it if that would help
2 Views