-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ValueError on second iteration of loop - dspy.Predict #2006
Comments
Thanks for opening the issue! This seems like an LLM refusal. It doesn’t like your question. You can wrap it in a try/except. |
Thanks. Yes, I now have some nested try/except going to manage it through staged questioning. The text I am feeding is quite fuzzy and unusual at times (like a project document's footer with obscure IDs and labels). Seems to be working okay at the moment, but still running into classic prompt "engineering" struggles. Will keep going as this is only day 1 with DSPy. |
Awesome! Q: why are you concatenating a project document's footer into a string? You can pass multiple fields into a module, by adjusting your signature. instruction = "Is the supplied task something that this user can perform?"
module = dspy.Predict(dspy.Signature('task, user -> validity: bool', instruction))
module(task=..., user=...) |
Thanks for replying. That stacking of modules looks interesting. I may try to incorporate that. I'll explain my use case but disclaimer: I am not a trained coder and I am more or less 'winging' it; so I am sure there are better ways to do everything I am trying to do. My code is set up to : |
This code loops through the first 's', returns a correct bool, but then fails on the next iteration:
With error handling I was able to check the history and the response it provides is:
The text was updated successfully, but these errors were encountered: