DSPy: The framework for programming—not prompting—language models
Python
fix mkdoc warnings (#8480)
TomuHiratab74b387c99b1
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 5e1d02ad2..4cc863a14 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -89,7 +89,7 @@ Once the pull request is approved, a team member will take care of merging.## Environment Setup-Python 3.9 or later is required.+Python 3.10 or later is required.Setting up your DSPy development environment requires you to fork the DSPy repository and clone it locally.If you are not familiar with the GitHub fork process, please refer to [Fork a repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo). After creating the fork, clonediff --git a/docs/docs/api/adapters/Adapter.md b/docs/docs/api/adapters/Adapter.mdindex 3d2666331..7fa2fd960 100644--- a/docs/docs/api/adapters/Adapter.md+++ b/docs/docs/api/adapters/Adapter.md@@ -24,4 +24,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/adapters/ChatAdapter.md b/docs/docs/api/adapters/ChatAdapter.mdindex e76eeec05..fa5e6a4d2 100644--- a/docs/docs/api/adapters/ChatAdapter.md+++ b/docs/docs/api/adapters/ChatAdapter.md@@ -27,4 +27,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/adapters/JSONAdapter.md b/docs/docs/api/adapters/JSONAdapter.mdindex 0043c95ea..718264b6e 100644--- a/docs/docs/api/adapters/JSONAdapter.md+++ b/docs/docs/api/adapters/JSONAdapter.md@@ -27,4 +27,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/adapters/TwoStepAdapter.md b/docs/docs/api/adapters/TwoStepAdapter.mdindex aea44e4b3..ec14b4711 100644--- a/docs/docs/api/adapters/TwoStepAdapter.md+++ b/docs/docs/api/adapters/TwoStepAdapter.md@@ -24,4 +24,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/evaluation/CompleteAndGrounded.md b/docs/docs/api/evaluation/CompleteAndGrounded.mdindex 5c3c47288..20bdb1d42 100644--- a/docs/docs/api/evaluation/CompleteAndGrounded.md+++ b/docs/docs/api/evaluation/CompleteAndGrounded.md@@ -32,4 +32,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/evaluation/Evaluate.md b/docs/docs/api/evaluation/Evaluate.mdindex 17d369d72..2c7c4451c 100644--- a/docs/docs/api/evaluation/Evaluate.md+++ b/docs/docs/api/evaluation/Evaluate.md@@ -14,4 +14,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/evaluation/SemanticF1.md b/docs/docs/api/evaluation/SemanticF1.mdindex aa419648f..537a657db 100644--- a/docs/docs/api/evaluation/SemanticF1.md+++ b/docs/docs/api/evaluation/SemanticF1.md@@ -32,4 +32,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/evaluation/answer_exact_match.md b/docs/docs/api/evaluation/answer_exact_match.mdindex f3faa5f6a..3ee483879 100644--- a/docs/docs/api/evaluation/answer_exact_match.md+++ b/docs/docs/api/evaluation/answer_exact_match.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/evaluation/answer_passage_match.md b/docs/docs/api/evaluation/answer_passage_match.mdindex 2fcbaf524..7a571bcff 100644--- a/docs/docs/api/evaluation/answer_passage_match.md+++ b/docs/docs/api/evaluation/answer_passage_match.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/models/Embedder.md b/docs/docs/api/models/Embedder.mdindex 48a2459ab..510a749a2 100644--- a/docs/docs/api/models/Embedder.md+++ b/docs/docs/api/models/Embedder.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/models/LM.md b/docs/docs/api/models/LM.mdindex cb9a7442f..20429c00f 100644--- a/docs/docs/api/models/LM.md+++ b/docs/docs/api/models/LM.md@@ -26,4 +26,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/modules/BestOfN.md b/docs/docs/api/modules/BestOfN.mdindex 225efff90..ae778a6cb 100644--- a/docs/docs/api/modules/BestOfN.md+++ b/docs/docs/api/modules/BestOfN.md@@ -32,4 +32,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/modules/ChainOfThought.md b/docs/docs/api/modules/ChainOfThought.mdindex 21a1fad94..978ffae3d 100644--- a/docs/docs/api/modules/ChainOfThought.md+++ b/docs/docs/api/modules/ChainOfThought.md@@ -33,4 +33,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/modules/Module.md b/docs/docs/api/modules/Module.mdindex dbce6fb2a..c192fc707 100644--- a/docs/docs/api/modules/Module.md+++ b/docs/docs/api/modules/Module.md@@ -31,4 +31,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/modules/MultiChainComparison.md b/docs/docs/api/modules/MultiChainComparison.mdindex 90f0a9501..364b66329 100644--- a/docs/docs/api/modules/MultiChainComparison.md+++ b/docs/docs/api/modules/MultiChainComparison.md@@ -32,4 +32,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/modules/Parallel.md b/docs/docs/api/modules/Parallel.mdindex f935c2dbf..5c7985270 100644--- a/docs/docs/api/modules/Parallel.md+++ b/docs/docs/api/modules/Parallel.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/modules/Predict.md b/docs/docs/api/modules/Predict.mdindex 161ff3720..6ae87aa1b 100644--- a/docs/docs/api/modules/Predict.md+++ b/docs/docs/api/modules/Predict.md@@ -36,4 +36,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/modules/ProgramOfThought.md b/docs/docs/api/modules/ProgramOfThought.mdindex 91efe7194..b8e76b509 100644--- a/docs/docs/api/modules/ProgramOfThought.md+++ b/docs/docs/api/modules/ProgramOfThought.md@@ -32,4 +32,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/modules/ReAct.md b/docs/docs/api/modules/ReAct.mdindex b06dcf926..bf108aac8 100644--- a/docs/docs/api/modules/ReAct.md+++ b/docs/docs/api/modules/ReAct.md@@ -34,4 +34,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/modules/Refine.md b/docs/docs/api/modules/Refine.mdindex 152b1fcca..19d7f759f 100644--- a/docs/docs/api/modules/Refine.md+++ b/docs/docs/api/modules/Refine.md@@ -32,4 +32,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/BetterTogether.md b/docs/docs/api/optimizers/BetterTogether.mdindex 430639246..33029b476 100644--- a/docs/docs/api/optimizers/BetterTogether.md+++ b/docs/docs/api/optimizers/BetterTogether.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/BootstrapFewShot.md b/docs/docs/api/optimizers/BootstrapFewShot.mdindex 3dace8195..a02c14a63 100644--- a/docs/docs/api/optimizers/BootstrapFewShot.md+++ b/docs/docs/api/optimizers/BootstrapFewShot.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/BootstrapFewShotWithRandomSearch.md b/docs/docs/api/optimizers/BootstrapFewShotWithRandomSearch.mdindex f2df1530b..24593f4ae 100644--- a/docs/docs/api/optimizers/BootstrapFewShotWithRandomSearch.md+++ b/docs/docs/api/optimizers/BootstrapFewShotWithRandomSearch.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/BootstrapFinetune.md b/docs/docs/api/optimizers/BootstrapFinetune.mdindex 8f1d3a337..7e149fa16 100644--- a/docs/docs/api/optimizers/BootstrapFinetune.md+++ b/docs/docs/api/optimizers/BootstrapFinetune.md@@ -17,4 +17,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/BootstrapRS.md b/docs/docs/api/optimizers/BootstrapRS.mdindex df523b4e7..013356ed4 100644--- a/docs/docs/api/optimizers/BootstrapRS.md+++ b/docs/docs/api/optimizers/BootstrapRS.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/COPRO.md b/docs/docs/api/optimizers/COPRO.mdindex 89926b407..9f92e68cf 100644--- a/docs/docs/api/optimizers/COPRO.md+++ b/docs/docs/api/optimizers/COPRO.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/Ensemble.md b/docs/docs/api/optimizers/Ensemble.mdindex 58aef770f..9cd5e00e0 100644--- a/docs/docs/api/optimizers/Ensemble.md+++ b/docs/docs/api/optimizers/Ensemble.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/InferRules.md b/docs/docs/api/optimizers/InferRules.mdindex 035c0b138..b8af99a26 100644--- a/docs/docs/api/optimizers/InferRules.md+++ b/docs/docs/api/optimizers/InferRules.md@@ -20,4 +20,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/KNN.md b/docs/docs/api/optimizers/KNN.mdindex d8c3fcf94..dcf4c7a24 100644--- a/docs/docs/api/optimizers/KNN.md+++ b/docs/docs/api/optimizers/KNN.md@@ -14,4 +14,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/KNNFewShot.md b/docs/docs/api/optimizers/KNNFewShot.mdindex 758a6f819..edcc54ea2 100644--- a/docs/docs/api/optimizers/KNNFewShot.md+++ b/docs/docs/api/optimizers/KNNFewShot.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/LabeledFewShot.md b/docs/docs/api/optimizers/LabeledFewShot.mdindex f1d96313e..55d7773c4 100644--- a/docs/docs/api/optimizers/LabeledFewShot.md+++ b/docs/docs/api/optimizers/LabeledFewShot.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/optimizers/MIPROv2.md b/docs/docs/api/optimizers/MIPROv2.mdindex 34a6f2eaa..c8669e9ed 100644--- a/docs/docs/api/optimizers/MIPROv2.md+++ b/docs/docs/api/optimizers/MIPROv2.md@@ -17,6 +17,7 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->## Example Usagediff --git a/docs/docs/api/primitives/Example.md b/docs/docs/api/primitives/Example.mdindex 1cfecea07..b312c581e 100644--- a/docs/docs/api/primitives/Example.md+++ b/docs/docs/api/primitives/Example.md@@ -23,4 +23,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/primitives/History.md b/docs/docs/api/primitives/History.mdindex 3b5b717d0..1be9232b7 100644--- a/docs/docs/api/primitives/History.md+++ b/docs/docs/api/primitives/History.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/primitives/Image.md b/docs/docs/api/primitives/Image.mdindex 463937c2b..c90298421 100644--- a/docs/docs/api/primitives/Image.md+++ b/docs/docs/api/primitives/Image.md@@ -21,4 +21,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/primitives/Prediction.md b/docs/docs/api/primitives/Prediction.mdindex 9f78b2b2c..9060950f4 100644--- a/docs/docs/api/primitives/Prediction.md+++ b/docs/docs/api/primitives/Prediction.md@@ -26,4 +26,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/primitives/Tool.md b/docs/docs/api/primitives/Tool.mdindex aa71ba2ed..441e8bca7 100644--- a/docs/docs/api/primitives/Tool.md+++ b/docs/docs/api/primitives/Tool.md@@ -22,4 +22,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/signatures/InputField.md b/docs/docs/api/signatures/InputField.mdindex f9b679d71..534b3740d 100644--- a/docs/docs/api/signatures/InputField.md+++ b/docs/docs/api/signatures/InputField.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/signatures/OutputField.md b/docs/docs/api/signatures/OutputField.mdindex 16a096ca2..ca9f48584 100644--- a/docs/docs/api/signatures/OutputField.md+++ b/docs/docs/api/signatures/OutputField.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/signatures/Signature.md b/docs/docs/api/signatures/Signature.mdindex 14e7db8ad..7272acd55 100644--- a/docs/docs/api/signatures/Signature.md+++ b/docs/docs/api/signatures/Signature.md@@ -22,4 +22,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/tools/ColBERTv2.md b/docs/docs/api/tools/ColBERTv2.mdindex 9cfc13277..1743b07ad 100644--- a/docs/docs/api/tools/ColBERTv2.md+++ b/docs/docs/api/tools/ColBERTv2.md@@ -14,4 +14,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/tools/Embeddings.md b/docs/docs/api/tools/Embeddings.mdindex ca1939a62..36b5553e7 100644--- a/docs/docs/api/tools/Embeddings.md+++ b/docs/docs/api/tools/Embeddings.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/tools/PythonInterpreter.md b/docs/docs/api/tools/PythonInterpreter.mdindex baf6af1cf..bfc304d05 100644--- a/docs/docs/api/tools/PythonInterpreter.md+++ b/docs/docs/api/tools/PythonInterpreter.md@@ -16,4 +16,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/StatusMessage.md b/docs/docs/api/utils/StatusMessage.mdindex 161b7a13d..cab18fb3c 100644--- a/docs/docs/api/utils/StatusMessage.md+++ b/docs/docs/api/utils/StatusMessage.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/StatusMessageProvider.md b/docs/docs/api/utils/StatusMessageProvider.mdindex 19fac23ae..e22db0ddd 100644--- a/docs/docs/api/utils/StatusMessageProvider.md+++ b/docs/docs/api/utils/StatusMessageProvider.md@@ -19,4 +19,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/StreamListener.md b/docs/docs/api/utils/StreamListener.mdindex 5785c6f12..517c398fd 100644--- a/docs/docs/api/utils/StreamListener.md+++ b/docs/docs/api/utils/StreamListener.md@@ -15,4 +15,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/asyncify.md b/docs/docs/api/utils/asyncify.mdindex b1fa70a88..e42be0aa7 100644--- a/docs/docs/api/utils/asyncify.md+++ b/docs/docs/api/utils/asyncify.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/configure_cache.md b/docs/docs/api/utils/configure_cache.mdindex 87516a942..a13ae7b40 100644--- a/docs/docs/api/utils/configure_cache.md+++ b/docs/docs/api/utils/configure_cache.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/disable_litellm_logging.md b/docs/docs/api/utils/disable_litellm_logging.mdindex 2d7b2a074..6280e7960 100644--- a/docs/docs/api/utils/disable_litellm_logging.md+++ b/docs/docs/api/utils/disable_litellm_logging.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/disable_logging.md b/docs/docs/api/utils/disable_logging.mdindex 6bb9debbe..f2517325d 100644--- a/docs/docs/api/utils/disable_logging.md+++ b/docs/docs/api/utils/disable_logging.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/enable_litellm_logging.md b/docs/docs/api/utils/enable_litellm_logging.mdindex fa7f73705..3bd6f89d7 100644--- a/docs/docs/api/utils/enable_litellm_logging.md+++ b/docs/docs/api/utils/enable_litellm_logging.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/enable_logging.md b/docs/docs/api/utils/enable_logging.mdindex 55ae12b02..5fd3e7720 100644--- a/docs/docs/api/utils/enable_logging.md+++ b/docs/docs/api/utils/enable_logging.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/inspect_history.md b/docs/docs/api/utils/inspect_history.mdindex 81357c6d7..1de813af1 100644--- a/docs/docs/api/utils/inspect_history.md+++ b/docs/docs/api/utils/inspect_history.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/load.md b/docs/docs/api/utils/load.mdindex dec1eaa57..00fdd2c5a 100644--- a/docs/docs/api/utils/load.md+++ b/docs/docs/api/utils/load.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/api/utils/streamify.md b/docs/docs/api/utils/streamify.mdindex 57e1f7ede..22fb7951a 100644--- a/docs/docs/api/utils/streamify.md+++ b/docs/docs/api/utils/streamify.md@@ -12,4 +12,5 @@show_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->diff --git a/docs/docs/faqs.md b/docs/docs/faqs.mdindex c75063ae7..3a5616fee 100644--- a/docs/docs/faqs.md+++ b/docs/docs/faqs.md@@ -19,7 +19,7 @@ The **DSPy** philosophy and abstraction differ significantly from other librarie## Basic Usage-**How should I use DSPy for my task?** We wrote a [eight-step guide](/building-blocks/solving_your_task) on this. In short, using DSPy is an iterative process. You first define your task and the metrics you want to maximize, and prepare a few example inputs — typically without labels (or only with labels for the final outputs, if your metric requires them). Then, you build your pipeline by selecting built-in layers (`modules`) to use, giving each layer a `signature` (input/output spec), and then calling your modules freely in your Python code. Lastly, you use a DSPy `optimizer` to compile your code into high-quality instructions, automatic few-shot examples, or updated LM weights for your LM.+**How should I use DSPy for my task?** We wrote a [eight-step guide](learn/index.md) on this. In short, using DSPy is an iterative process. You first define your task and the metrics you want to maximize, and prepare a few example inputs — typically without labels (or only with labels for the final outputs, if your metric requires them). Then, you build your pipeline by selecting built-in layers (`modules`) to use, giving each layer a `signature` (input/output spec), and then calling your modules freely in your Python code. Lastly, you use a DSPy `optimizer` to compile your code into high-quality instructions, automatic few-shot examples, or updated LM weights for your LM.**How do I convert my complex prompt into a DSPy pipeline?** See the same answer above.@@ -34,11 +34,11 @@ You can specify multiple output fields. For the short-form signature, you can li- **How do I define my own metrics? Can metrics return a float?**-You can define metrics as simply Python functions that process model generations and evaluate them based on user-defined requirements. Metrics can compare existent data (e.g. gold labels) to model predictions or they can be used to assess various components of an output using validation feedback from LMs (e.g. LLMs-as-Judges). Metrics can return `bool`, `int`, and `float` types scores. Check out the official [Metrics docs](/building-blocks/5-metrics) to learn more about defining custom metrics and advanced evaluations using AI feedback and/or DSPy programs.+You can define metrics as simply Python functions that process model generations and evaluate them based on user-defined requirements. Metrics can compare existent data (e.g. gold labels) to model predictions or they can be used to assess various components of an output using validation feedback from LMs (e.g. LLMs-as-Judges). Metrics can return `bool`, `int`, and `float` types scores. Check out the official [Metrics docs](learn/evaluation/metrics.md) to learn more about defining custom metrics and advanced evaluations using AI feedback and/or DSPy programs.- **How expensive or slow is compiling??**-To reflect compiling metrics, we highlight an experiment for reference, compiling the [`SimplifiedBaleen`](/tutorials/simplified-baleen) using the [`dspy.BootstrapFewShotWithRandomSearch`](/deep-dive/teleprompter/bootstrap-fewshot) optimizer on the `gpt-3.5-turbo-1106` model over 7 candidate programs and 10 threads. We report that compiling this program takes around 6 minutes with 3200 API calls, 2.7 million input tokens and 156,000 output tokens, reporting a total cost of $3 USD (at the current pricing of the OpenAI model).+To reflect compiling metrics, we highlight an experiment for reference, compiling a program using the [BootstrapFewShotWithRandomSearch](api/optimizers/BootstrapFewShotWithRandomSearch.md) optimizer on the `gpt-3.5-turbo-1106` model over 7 candidate programs and 10 threads. We report that compiling this program takes around 6 minutes with 3200 API calls, 2.7 million input tokens and 156,000 output tokens, reporting a total cost of $3 USD (at the current pricing of the OpenAI model).Compiling DSPy `optimizers` naturally will incur additional LM calls, but we substantiate this overhead with minimalistic executions with the goal of maximizing performance. This invites avenues to enhance performance of smaller models by compiling DSPy programs with larger models to learn enhanced behavior during compile-time and propagate such behavior to the tested smaller model during inference-time.diff --git a/docs/docs/index.md b/docs/docs/index.mdindex de041ce8e..943f83678 100644--- a/docs/docs/index.md+++ b/docs/docs/index.md@@ -374,7 +374,7 @@ Given a few tens or hundreds of representative _inputs_ of your task and a _metroptimized_rag = tp.compile(RAG(), trainset=trainset, max_bootstrapped_demos=2, max_labeled_demos=2)```- For a complete RAG example that you can run, start this [tutorial](/tutorials/rag/). It improves the quality of a RAG system over a subset of StackExchange communities by 10% relative gain.+ For a complete RAG example that you can run, start this [tutorial](tutorials/rag/index.ipynb). It improves the quality of a RAG system over a subset of StackExchange communities by 10% relative gain.=== "Optimizing weights for Classification"<details><summary>Click to show dataset setup code.</summary>@@ -447,4 +447,4 @@ Compared to monolithic LMs, DSPy's modular paradigm enables a large community toThe DSPy research effort started at Stanford NLP in Feb 2022, building on what we had learned from developing early [compound LM systems](https://bair.berkeley.edu/blog/2024/02/18/compound-ai-systems/) like [ColBERT-QA](https://arxiv.org/abs/2007.00814), [Baleen](https://arxiv.org/abs/2101.00436), and [Hindsight](https://arxiv.org/abs/2110.07752). The first version was released as [DSP](https://arxiv.org/abs/2212.14024) in Dec 2022 and evolved by Oct 2023 into [DSPy](https://arxiv.org/abs/2310.03714). Thanks to [250 contributors](https://github.com/stanfordnlp/dspy/graphs/contributors), DSPy has introduced tens of thousands of people to building and optimizing modular LM programs.-Since then, DSPy's community has produced a large body of work on optimizers, like [MIPROv2](https://arxiv.org/abs/2406.11695), [BetterTogether](https://arxiv.org/abs/2407.10930), and [LeReT](https://arxiv.org/abs/2410.23214), on program architectures, like [STORM](https://arxiv.org/abs/2402.14207), [IReRa](https://arxiv.org/abs/2401.12178), and [DSPy Assertions](https://arxiv.org/abs/2312.13382), and on successful applications to new problems, like [PAPILLON](https://arxiv.org/abs/2410.17127), [PATH](https://arxiv.org/abs/2406.11706), [WangLab@MEDIQA](https://arxiv.org/abs/2404.14544), [UMD's Prompting Case Study](https://arxiv.org/abs/2406.06608), and [Haize's Red-Teaming Program](https://blog.haizelabs.com/posts/dspy/), in addition to many open-source projects, production applications, and other [use cases](/community/use-cases).+Since then, DSPy's community has produced a large body of work on optimizers, like [MIPROv2](https://arxiv.org/abs/2406.11695), [BetterTogether](https://arxiv.org/abs/2407.10930), and [LeReT](https://arxiv.org/abs/2410.23214), on program architectures, like [STORM](https://arxiv.org/abs/2402.14207), [IReRa](https://arxiv.org/abs/2401.12178), and [DSPy Assertions](https://arxiv.org/abs/2312.13382), and on successful applications to new problems, like [PAPILLON](https://arxiv.org/abs/2410.17127), [PATH](https://arxiv.org/abs/2406.11706), [WangLab@MEDIQA](https://arxiv.org/abs/2404.14544), [UMD's Prompting Case Study](https://arxiv.org/abs/2406.06608), and [Haize's Red-Teaming Program](https://blog.haizelabs.com/posts/dspy/), in addition to many open-source projects, production applications, and other [use cases](community/use-cases.md).diff --git a/docs/docs/learn/optimization/optimizers.md b/docs/docs/learn/optimization/optimizers.mdindex cb428c815..6cf9ffe6c 100644--- a/docs/docs/learn/optimization/optimizers.md+++ b/docs/docs/learn/optimization/optimizers.md@@ -41,34 +41,34 @@ Optimizers can be accessed via `from dspy.teleprompt import *`.These optimizers extend the signature by automatically generating and including **optimized** examples within the prompt sent to the model, implementing few-shot learning.-1. [**`LabeledFewShot`**](/api/optimizers/LabeledFewShot): Simply constructs few-shot examples (demos) from provided labeled input and output data points. Requires `k` (number of examples for the prompt) and `trainset` to randomly select `k` examples from.+1. [**`LabeledFewShot`**](../../api/optimizers/LabeledFewShot.md): Simply constructs few-shot examples (demos) from provided labeled input and output data points. Requires `k` (number of examples for the prompt) and `trainset` to randomly select `k` examples from.-2. [**`BootstrapFewShot`**](/api/optimizers/BootstrapFewshot): Uses a `teacher` module (which defaults to your program) to generate complete demonstrations for every stage of your program, along with labeled examples in `trainset`. Parameters include `max_labeled_demos` (the number of demonstrations randomly selected from the `trainset`) and `max_bootstrapped_demos` (the number of additional examples generated by the `teacher`). The bootstrapping process employs the metric to validate demonstrations, including only those that pass the metric in the "compiled" prompt. Advanced: Supports using a `teacher` program that is a *different* DSPy program that has compatible structure, for harder tasks.+2. [**`BootstrapFewShot`**](../../api/optimizers/BootstrapFewShot.md): Uses a `teacher` module (which defaults to your program) to generate complete demonstrations for every stage of your program, along with labeled examples in `trainset`. Parameters include `max_labeled_demos` (the number of demonstrations randomly selected from the `trainset`) and `max_bootstrapped_demos` (the number of additional examples generated by the `teacher`). The bootstrapping process employs the metric to validate demonstrations, including only those that pass the metric in the "compiled" prompt. Advanced: Supports using a `teacher` program that is a *different* DSPy program that has compatible structure, for harder tasks.-3. [**`BootstrapFewShotWithRandomSearch`**](/api/optimizers/BootstrapFewshotWithRandomSearch): Applies `BootstrapFewShot` several times with random search over generated demonstrations, and selects the best program over the optimization. Parameters mirror those of `BootstrapFewShot`, with the addition of `num_candidate_programs`, which specifies the number of random programs evaluated over the optimization, including candidates of the uncompiled program, `LabeledFewShot` optimized program, `BootstrapFewShot` compiled program with unshuffled examples and `num_candidate_programs` of `BootstrapFewShot` compiled programs with randomized example sets.+3. [**`BootstrapFewShotWithRandomSearch`**](../../api/optimizers/BootstrapFewShotWithRandomSearch.md): Applies `BootstrapFewShot` several times with random search over generated demonstrations, and selects the best program over the optimization. Parameters mirror those of `BootstrapFewShot`, with the addition of `num_candidate_programs`, which specifies the number of random programs evaluated over the optimization, including candidates of the uncompiled program, `LabeledFewShot` optimized program, `BootstrapFewShot` compiled program with unshuffled examples and `num_candidate_programs` of `BootstrapFewShot` compiled programs with randomized example sets.-4. [**`KNNFewShot`**](/api/optimizers/KNNFewShot/). Uses k-Nearest Neighbors algorithm to find the nearest training example demonstrations for a given input example. These nearest neighbor demonstrations are then used as the trainset for the BootstrapFewShot optimization process.+4. [**`KNNFewShot`**](../../api/optimizers/KNNFewShot.md). Uses k-Nearest Neighbors algorithm to find the nearest training example demonstrations for a given input example. These nearest neighbor demonstrations are then used as the trainset for the BootstrapFewShot optimization process.### Automatic Instruction OptimizationThese optimizers produce optimal instructions for the prompt and, in the case of MIPROv2 can also optimize the set of few-shot demonstrations.-5. [**`COPRO`**](/api/optimizers/COPRO): Generates and refines new instructions for each step, and optimizes them with coordinate ascent (hill-climbing using the metric function and the `trainset`). Parameters include `depth` which is the number of iterations of prompt improvement the optimizer runs over.+5. [**`COPRO`**](../../api/optimizers/COPRO.md): Generates and refines new instructions for each step, and optimizes them with coordinate ascent (hill-climbing using the metric function and the `trainset`). Parameters include `depth` which is the number of iterations of prompt improvement the optimizer runs over.-6. [**`MIPROv2`**](/api/optimizers/MIPROv2): Generates instructions *and* few-shot examples in each step. The instruction generation is data-aware and demonstration-aware. Uses Bayesian Optimization to effectively search over the space of generation instructions/demonstrations across your modules.+6. [**`MIPROv2`**](../../api/optimizers/MIPROv2.md): Generates instructions *and* few-shot examples in each step. The instruction generation is data-aware and demonstration-aware. Uses Bayesian Optimization to effectively search over the space of generation instructions/demonstrations across your modules.### Automatic FinetuningThis optimizer is used to fine-tune the underlying LLM(s).-7. [**`BootstrapFinetune`**](/api/optimizers/BootstrapFinetune): Distills a prompt-based DSPy program into weight updates. The output is a DSPy program that has the same steps, but where each step is conducted by a finetuned model instead of a prompted LM.+7. [**`BootstrapFinetune`**](../../api/optimizers/BootstrapFinetune.md): Distills a prompt-based DSPy program into weight updates. The output is a DSPy program that has the same steps, but where each step is conducted by a finetuned model instead of a prompted LM.### Program Transformations-8. [**`Ensemble`**](/api/optimizers/Ensemble): Ensembles a set of DSPy programs and either uses the full set or randomly samples a subset into a single program.+8. [**`Ensemble`**](../../api/optimizers/Ensemble.md): Ensembles a set of DSPy programs and either uses the full set or randomly samples a subset into a single program.## Which optimizer should I use?@@ -79,13 +79,13 @@ That being said, here's the general guidance on getting started:- If you have **very few examples** (around 10), start with `BootstrapFewShot`.- If you have **more data** (50 examples or more), try `BootstrapFewShotWithRandomSearch`.-- If you prefer to do **instruction optimization only** (i.e. you want to keep your prompt 0-shot), use `MIPROv2` [configured for 0-shot optimization to optimize](/api/optimizers/MIPROv2#optimizing-instructions-only-with-miprov2-0-shot).+- If you prefer to do **instruction optimization only** (i.e. you want to keep your prompt 0-shot), use `MIPROv2` [configured for 0-shot optimization](../../api/optimizers/MIPROv2.md).- If you’re willing to use more inference calls to perform **longer optimization runs** (e.g. 40 trials or more), and have enough data (e.g. 200 examples or more to prevent overfitting) then try `MIPROv2`.- If you have been able to use one of these with a large LM (e.g., 7B parameters or above) and need a very **efficient program**, finetune a small LM for your task with `BootstrapFinetune`.## How do I use an optimizer?-They all share this general interface, with some differences in the keyword arguments (hyperparameters). Detailed documentation for key optimizers can be found [here](/api/optimizers/vfrs), and a full list can be found [here](https://dspy.ai/api/optimizers/BetterTogether/).+They all share this general interface, with some differences in the keyword arguments (hyperparameters). A full list can be found in the [API reference](../../api/optimizers/BetterTogether.md).Let's see this with the most common one, `BootstrapFewShotWithRandomSearch`.@@ -147,7 +147,7 @@ optimized_program = teleprompter.compile(YOUR_PROGRAM_HERE, trainset=YOUR_TRAINSoptimized_rag = tp.compile(RAG(), trainset=trainset, max_bootstrapped_demos=2, max_labeled_demos=2)```- For a complete RAG example that you can run, start this [tutorial](/tutorials/rag/). It improves the quality of a RAG system over a subset of StackExchange communities from 53% to 61%.+ For a complete RAG example that you can run, start this [tutorial](../../tutorials/rag/index.ipynb). It improves the quality of a RAG system over a subset of StackExchange communities from 53% to 61%.=== "Optimizing weights for Classification"<details><summary>Click to show dataset setup code.</summary>diff --git a/docs/docs/learn/programming/modules.md b/docs/docs/learn/programming/modules.mdindex a52f2bc4f..2f3fff2d9 100644--- a/docs/docs/learn/programming/modules.md+++ b/docs/docs/learn/programming/modules.md@@ -15,7 +15,7 @@ A **DSPy module** is a building block for programs that use LMs.## How do I use a built-in module, like `dspy.Predict` or `dspy.ChainOfThought`?-Let's start with the most fundamental module, `dspy.Predict`. Internally, all other DSPy modules are built using `dspy.Predict`. We'll assume you are already at least a little familiar with [DSPy signatures](/learn/programming/signatures), which are declarative specs for defining the behavior of any module we use in DSPy.+Let's start with the most fundamental module, `dspy.Predict`. Internally, all other DSPy modules are built using `dspy.Predict`. We'll assume you are already at least a little familiar with [DSPy signatures](signatures.md), which are declarative specs for defining the behavior of any module we use in DSPy.To use a module, we first **declare** it by giving it a signature. Then we **call** the module with the input arguments, and extract the output fields!diff --git a/docs/docs/production/index.md b/docs/docs/production/index.mdindex 0aa80065d..bd8d6c64d 100644--- a/docs/docs/production/index.md+++ b/docs/docs/production/index.md@@ -8,7 +8,7 @@DSPy is deployed in production by many enterprises and startups. Explore real-world case studies.- [:octicons-arrow-right-24: Use Cases](../community/use-cases)+ [:octicons-arrow-right-24: Use Cases](../community/use-cases.md)- :material-magnify-expand:{ .lg .middle } __Monitoring & Observability__@@ -16,7 +16,7 @@Monitor your DSPy programs using **MLflow Tracing**, based on OpenTelemetry.- [:octicons-arrow-right-24: Set Up Observability](../tutorials/observability/#tracing)+ [:octicons-arrow-right-24: Set Up Observability](../tutorials/observability/index.md#tracing)- :material-ab-testing: __Reproducibility__@@ -32,7 +32,7 @@When it's time to productionize, deploy your application easily with DSPy's integration with MLflow Model Serving.- [:octicons-arrow-right-24: Deployment Guide](../tutorials/deployment)+ [:octicons-arrow-right-24: Deployment Guide](../tutorials/deployment/index.md)- :material-arrow-up-right-bold: __Scalability__diff --git a/docs/docs/roadmap.md b/docs/docs/roadmap.mdindex cf39fda69..209ba55d1 100644--- a/docs/docs/roadmap.md+++ b/docs/docs/roadmap.md@@ -111,7 +111,7 @@ Over the next six months, our goal is to dramatically improve each angle of thesUsing DSPy well for solving a new task is just doing good machine learning with LMs, but teaching this is hard. On the one hand, it's an iterative process: you make some initial choices, which will be sub-optimal, and then you refine them incrementally. It's highly exploratory: it's often the case that no one knows yet how to best solve a problem in a DSPy-esque way. One the other hand, DSPy offers many emerging lessons from several years of building LM systems, in which the design space, the data regime, and many other factors are new both to ML experts and to the very large fraction of users that have no ML experience.-Though current docs do address [a bunch of this](/building-blocks/solving_your_task) in isolated ways, one thing we've learned is that we should separate teaching the core DSPy language (which is ultimately pretty small) from teaching the emerging ML workflow that works well in a DSPy-esque setting. As a natural extension of this, we need to place more emphasis on steps prior and after to the explicit coding in DSPy, from data collection to deployment that serves and monitors the optimized DSPy program in practice. This is just starting but efforts will be ramping up led by Omar Khattab, Isaac Miller, and Herumb Shandilya.+Though current docs do address [a bunch of this](learn/index.md) in isolated ways, one thing we've learned is that we should separate teaching the core DSPy language (which is ultimately pretty small) from teaching the emerging ML workflow that works well in a DSPy-esque setting. As a natural extension of this, we need to place more emphasis on steps prior and after to the explicit coding in DSPy, from data collection to deployment that serves and monitors the optimized DSPy program in practice. This is just starting but efforts will be ramping up led by Omar Khattab, Isaac Miller, and Herumb Shandilya.## 4) Shifting towards more interactive optimization & tracking.diff --git a/docs/docs/tutorials/build_ai_program/index.md b/docs/docs/tutorials/build_ai_program/index.mdindex 729b9fd1e..c06d30cd2 100644--- a/docs/docs/tutorials/build_ai_program/index.md+++ b/docs/docs/tutorials/build_ai_program/index.md@@ -1,11 +1,11 @@-- [Building AI Agents with DSPy](/tutorials/customer_service_agent/)-- [Building AI Applications by Customizing DSPy Modules](/tutorials/custom_module/)-- [Retrieval-Augmented Generation (RAG)](/tutorials/rag/)-- [Building RAG as Agent](/tutorials/agents/)-- [Entity Extraction](/tutorials/entity_extraction/)-- [Classification](/tutorials/classification/)-- [Multi-Hop RAG](/tutorials/multihop_search/)-- [Privacy-Conscious Delegation](/tutorials/papillon/)-- [Program Of Thought](/tutorials/program_of_thought/)-- [Image Generation Prompt iteration](/tutorials/image_generation_prompting/)-- [Audio](/tutorials/audio/)+- [Building AI Agents with DSPy](../customer_service_agent/index.ipynb)+- [Building AI Applications by Customizing DSPy Modules](../custom_module/index.ipynb)+- [Retrieval-Augmented Generation (RAG)](../rag/index.ipynb)+- [Building RAG as Agent](../agents/index.ipynb)+- [Entity Extraction](../entity_extraction/index.ipynb)+- [Classification](../classification/index.md)+- [Multi-Hop RAG](../multihop_search/index.ipynb)+- [Privacy-Conscious Delegation](../papillon/index.md)+- [Program Of Thought](../program_of_thought/index.ipynb)+- [Image Generation Prompt iteration](../image_generation_prompting/index.ipynb)+- [Audio](../audio/index.ipynb)diff --git a/docs/docs/tutorials/core_development/index.md b/docs/docs/tutorials/core_development/index.mdindex 906cd0cfc..f194eb806 100644--- a/docs/docs/tutorials/core_development/index.md+++ b/docs/docs/tutorials/core_development/index.md@@ -1,9 +1,9 @@-- [Use MCP in DSPy](/tutorials/mcp/)-- [Output Refinement](/tutorials/output_refinement/best-of-n-and-refine/)-- [Saving and Loading](/tutorials/saving/)-- [Cache](/tutorials/cache/)-- [Deployment](/tutorials/deployment/)-- [Debugging & Observability](/tutorials/observability/)-- [Tracking DSPy Optimizers](/tutorials/optimizer_tracking/)-- [Streaming](/tutorials/streaming/)-- [Async](/tutorials/async/)\ No newline at end of file+- [Use MCP in DSPy](../mcp/index.md)+- [Output Refinement](../output_refinement/best-of-n-and-refine.md)+- [Saving and Loading](../saving/index.md)+- [Cache](../cache/index.md)+- [Deployment](../deployment/index.md)+- [Debugging & Observability](../observability/index.md)+- [Tracking DSPy Optimizers](../optimizer_tracking/index.md)+- [Streaming](../streaming/index.md)+- [Async](../async/index.md)\ No newline at end of filediff --git a/docs/docs/tutorials/index.md b/docs/docs/tutorials/index.mdindex f253c924c..90e0d226e 100644--- a/docs/docs/tutorials/index.md+++ b/docs/docs/tutorials/index.md@@ -13,34 +13,34 @@ Welcome to DSPy tutorials! We've organized our tutorials into three main categor- Build AI Programs with DSPy- - [Building AI Agents with DSPy](/tutorials/customer_service_agent/)- - [Building AI Applications by Customizing DSPy Modules](/tutorials/custom_module/)- - [Retrieval-Augmented Generation (RAG)](/tutorials/rag/)- - [Building RAG as Agent](/tutorials/agents/)- - [Entity Extraction](/tutorials/entity_extraction/)- - [Classification](/tutorials/classification/)- - [Multi-Hop RAG](/tutorials/multihop_search/)- - [Privacy-Conscious Delegation](/tutorials/papillon/)- - [Program Of Thought](/tutorials/program_of_thought/)- - [Image Generation Prompt iteration](/tutorials/image_generation_prompting/)- - [Audio](/tutorials/audio/)+ - [Building AI Agents with DSPy](customer_service_agent/index.ipynb)+ - [Building AI Applications by Customizing DSPy Modules](custom_module/index.ipynb)+ - [Retrieval-Augmented Generation (RAG)](rag/index.ipynb)+ - [Building RAG as Agent](agents/index.ipynb)+ - [Entity Extraction](entity_extraction/index.ipynb)+ - [Classification](classification/index.md)+ - [Multi-Hop RAG](multihop_search/index.ipynb)+ - [Privacy-Conscious Delegation](papillon/index.md)+ - [Program Of Thought](program_of_thought/index.ipynb)+ - [Image Generation Prompt iteration](image_generation_prompting/index.ipynb)+ - [Audio](audio/index.ipynb)- Optimize AI Programs with DSPy- - [Math Reasoning](/tutorials/math/)- - [Classification Finetuning](/tutorials/classification_finetuning/)- - [Advanced Tool Use](/tutorials/tool_use/)- - [Finetuning Agents](/tutorials/games/)+ - [Math Reasoning](math/index.ipynb)+ - [Classification Finetuning](classification_finetuning/index.ipynb)+ - [Advanced Tool Use](tool_use/index.ipynb)+ - [Finetuning Agents](games/index.ipynb)- Tools, Development, and Deployment- - [Use MCP in DSPy](/tutorials/mcp/)- - [Output Refinement](/tutorials/output_refinement/best-of-n-and-refine/)- - [Saving and Loading](/tutorials/saving/)- - [Cache](/tutorials/cache/)- - [Deployment](/tutorials/deployment/)- - [Debugging & Observability](/tutorials/observability/)- - [Tracking DSPy Optimizers](/tutorials/optimizer_tracking/)- - [Streaming](/tutorials/streaming/)- - [Async](/tutorials/async/)+ - [Use MCP in DSPy](mcp/index.md)+ - [Output Refinement](output_refinement/best-of-n-and-refine.md)+ - [Saving and Loading](saving/index.md)+ - [Cache](cache/index.md)+ - [Deployment](deployment/index.md)+ - [Debugging & Observability](observability/index.md)+ - [Tracking DSPy Optimizers](optimizer_tracking/index.md)+ - [Streaming](streaming/index.md)+ - [Async](async/index.md)diff --git a/docs/docs/tutorials/observability/index.md b/docs/docs/tutorials/observability/index.mdindex 1e3389364..488bed258 100644--- a/docs/docs/tutorials/observability/index.md+++ b/docs/docs/tutorials/observability/index.md@@ -190,7 +190,7 @@ the [MLflow Tracing Guide](https://mlflow.org/docs/3.0.0rc0/tracing).!!! info Learn more about MLflow- MLflow is an end-to-end LLMOps platform that offers extensive features like experiment tracking, evaluation, and deployment. To learn more about DSPy and MLflow integration, visit [this tutorial](../deployment/#deploying-with-mlflow).+ MLflow is an end-to-end LLMOps platform that offers extensive features like experiment tracking, evaluation, and deployment. To learn more about DSPy and MLflow integration, visit [this tutorial](../deployment/index.md#deploying-with-mlflow).## Building a Custom Logging Solutiondiff --git a/docs/docs/tutorials/optimize_ai_program/index.md b/docs/docs/tutorials/optimize_ai_program/index.mdindex 19c369e30..80f8dedb8 100644--- a/docs/docs/tutorials/optimize_ai_program/index.md+++ b/docs/docs/tutorials/optimize_ai_program/index.md@@ -1,4 +1,4 @@-- [Math Reasoning](/tutorials/math/)-- [Classification Finetuning](/tutorials/classification_finetuning/)-- [Advanced Tool Use](/tutorials/tool_use/)-- [Finetuning Agents](/tutorials/games/)\ No newline at end of file+- [Math Reasoning](../math/index.ipynb)+- [Classification Finetuning](../classification_finetuning/index.ipynb)+- [Advanced Tool Use](../tool_use/index.ipynb)+- [Finetuning Agents](../games/index.ipynb)\ No newline at end of filediff --git a/docs/mkdocs.yml b/docs/mkdocs.ymlindex 1f77f071d..364f93726 100644--- a/docs/mkdocs.yml+++ b/docs/mkdocs.yml@@ -7,6 +7,7 @@ repo_name: stanfordnlp/dspyedit_uri: blob/main/docs/docs/docs_dir: "docs/"+nav:- Get Started: index.md- Learn DSPy:@@ -216,7 +217,7 @@ plugins:show_warnings: falsehtml_meta: false- mkdocs-jupyter:- ignore_h1_titles: True+ ignore_h1_titles: true- redirects:redirect_maps:# Redirect /intro/ to the main pagediff --git a/docs/scripts/generate_api_docs.py b/docs/scripts/generate_api_docs.pyindex 10c33fe51..38e378e2a 100644--- a/docs/scripts/generate_api_docs.py+++ b/docs/scripts/generate_api_docs.py@@ -134,6 +134,7 @@ def generate_doc_page(name: str, module_path: str, obj: Any, is_root: bool = Falmembers:{methods_list}"""+ # We need to put ::: at last to avoid unclosed div. See https://github.com/danielfrg/mkdocs-jupyter/issues/231 for more details.return f"""<!-- START_API_REF -->::: {module_path}.{name}handler: python@@ -146,6 +147,7 @@ def generate_doc_page(name: str, module_path: str, obj: Any, is_root: bool = Falshow_object_full_path: falseseparate_signature: falseinherited_members: true+:::<!-- END_API_REF -->"""diff --git a/dspy/primitives/base_module.py b/dspy/primitives/base_module.pyindex d70051426..54bb024ee 100644--- a/dspy/primitives/base_module.py+++ b/dspy/primitives/base_module.py@@ -69,8 +69,8 @@ class BaseModule:def named_sub_modules(self, type_=None, skip_compiled=False) -> Generator[tuple[str, "BaseModule"], None, None]:"""Find all sub-modules in the module, as well as their names.- Say self.children[4]['key'].sub_module is a sub-module. Then the name will be- 'children[4][key].sub_module'. But if the sub-module is accessible at different+ Say `self.children[4]['key'].sub_module` is a sub-module. Then the name will be+ `children[4]['key'].sub_module`. But if the sub-module is accessible at differentpaths, only one of the paths will be returned."""if type_ is None:diff --git a/dspy/primitives/module.py b/dspy/primitives/module.pyindex e29281650..c95a60211 100644--- a/dspy/primitives/module.py+++ b/dspy/primitives/module.py@@ -123,7 +123,7 @@ class Module(BaseModule, metaclass=ProgramMeta):return_failed_examples: bool = False,provide_traceback: bool | None = None,disable_progress_bar: bool = False,- ):+ ) -> list[Example] | tuple[list[Example], list[Example], list[Exception]]:"""Processes a list of dspy.Example instances in parallel using the Parallel module.