Skip to content
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

[Feature] Ability to build docstrings (prompts) dynamically #7784

Open
1 of 2 tasks
denisergashbaev opened this issue Feb 8, 2025 · 1 comment
Open
1 of 2 tasks
Labels
enhancement New feature or request

Comments

@denisergashbaev
Copy link

What feature would you like to see?

Hello! It would be very useful, if DSPy would allow loading prompts from external sources (such as databases, files, etc). It would be also useful if we could construct docstrings (that are converted to prompts) dynamically: ie, referencing variables in the module file (for example, to build a list of instructions for different entities, or specifying a particular language).

Right now, the static nature of docsrings limit quite a good number of potential use cases.

Thank you

Would you like to contribute?

  • Yes, I'd like to help implement this.
  • No, I just want to request it.

Additional Context

No response

@denisergashbaev denisergashbaev added the enhancement New feature or request label Feb 8, 2025
@okhat
Copy link
Collaborator

okhat commented Feb 9, 2025

Hey @denisergashbaev !

They're not static. You have two good options.

You can either pass an updated signature to your dspy.Predict or you can write a custom dspy.Adapter.

The latter is probably more versatile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants