stanfordnlp / dspy

DSPy: The framework for programming—not prompting—foundation models
https://dspy-docs.vercel.app/
MIT License
16.65k stars 1.28k forks source link

BootstrapFewShotWithRandomSearch, fewshot for specific parts of the pipeline. #346

Closed rhabraken closed 7 months ago

rhabraken commented 7 months ago

Hello. is it possible to use BootstrapFewShotWithRandomSearch in a pipeline with a summarizer and a classification step where the few shot is not activated for the summarize part, only for the classification part of the pipeline? The reason I want to summarise first is because the text input can be really long, and BootstrapFewShotWithRandomSearch would lead to going over the context window.

okhat commented 7 months ago

Ah that’s a good feature to make easy to use.

The answer is yes this is doable but not too easy at the moment. I think you can set summarization._compiled = True and then compile the whole program. Then it will be left untouched.

rhabraken commented 7 months ago

Thanks for the fast response!