版本发布 8
## What's Changed RLMs * feat(rlm): Add RLM Module and improve PythonInterpreter by @isaacbmiller in https://github.com/stanfordnlp/dspy/pull/9193 * Use `language` in system instructions for `dspy.Code` fields by @mariusarvinte in https://github.com/stanfordnlp/dspy/pull/9106 * Update dspy.RLM to improve reliability and avoid pydantic warnings by @okhat in https://github.com/stanfordnlp/dspy/pull/9210 * fix(RLM): Change FinalAnswerResult to FinalOutput and remove RLM __call__ by @isaacbmiller in https://github.com/stanfordnlp/dspy/pull/9212 GEPA * Fix GEPAFeedbackMetric Protocol missing 'self' parameter by @Copilot in https://github.com/stanfordnlp/dspy/pull/9111 * feat(gepa): add tool description optimization for multi-agent systems by @Ju-usc in https://github.com/stanfordnlp/dspy/pull/8928 * Update pyproject.toml to update gepa from 0.0.22 -> 0.0.24 by @LakshyAAAgrawal in https://github.com/stanfordnlp/dspy/pull/9161 * Patch `dspy.gepa` to handle `list[dict]` output from a `dspy.LM` by @mariusarvinte in https://github.com/stanfordnlp/dspy/pull/9169 Adapters * Upgrade json_repair to fix parsing issue of underscore-style float number by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/9088 * Properly yield the last chunk in streaming by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/9089 * Avoid unwanted exception chaining when running async tool in sync context by @stevapple in https://github.com/stanfordnlp/dspy/pull/9092 * Enhance StreamListener to support generic type annotations for output by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/9112 * FIX: streamify was appending StatusStreamingCallback directly to the shared settings.callbacks list by @glesperance in https://github.com/stanfordnlp/dspy/pull/9073 * fix(BAMLAdapter): Use docstrings to describe BaseModels by @BenMcH in https://github.com/stanfordnlp/dspy/pull/9125 * Fix Responses API structured outputs by @Olocool17 in https://github.com/stanfordnlp/dspy/pull/9130 Maintenance * Fix UsageTracker AttributeError when using ParallelExecutor with dspy.context by @Copilot in https://github.com/stanfordnlp/dspy/pull/9095 * Update uv.lock dspy version to match the latest release by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/9067 * [docs] Add Google-style docstrings for dspy/adapters/chat_adapter.py ChatAdapter class #9063 by @azai91 in https://github.com/stanfordnlp/dspy/pull/9072 * Fix ContextWindowExceededError after 3 retries in react loop by @Copilot in https://github.com/stanfordnlp/dspy/pull/9110 * fix: skip merging when both usage entry values are None by @chizukicn in https://github.com/stanfordnlp/dspy/pull/9121 * Fix: enforce positive `memory_max_entries` for in-memory cache by @mshr-h in https://github.com/stanfordnlp/dspy/pull/9128 * Add typing to `dspy.datasets.dataset` by @max-muoto in https://github.com/stanfordnlp/dspy/pull/9143 * Increase max_iters for dspy.ReAct by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/9162 * fix(dspy): prevent argument injection in LocalProvider subprocess calls by @Copilot in https://github.com/stanfordnlp/dspy/pull/9160 * fix(dspy): populate InputField default values in Predict by @ritsuki1227 in https://github.com/stanfordnlp/dspy/pull/9167 * fix(PythonInterpreter): Remove overly permissive read permissions and add strict allow by @isaacbmiller in https://github.com/stanfordnlp/dspy/pull/9081 * Add save / load methods for DSpy settings by @WeichenXu123 in https://github.com/stanfordnlp/dspy/pull/9165 Docs * [doc] Correct conversation history tutorial example by @zhiyanliu in https://github.com/stanfordnlp/dspy/pull/9071 * fix: Resolve broken hover-nlp/hover dataset by @vincentkoc in https://github.com/stanfordnlp/dspy/pull/9069 * Fix missing Real-World Examples and Experimental RL Optimization sections on tutorials page by @0xRaduan in https://github.com/stanfordnlp/dspy/pull/8982 * Refactor ReflectiveExample TypedDict documentation by @LakshyAAAgrawal in https://github.com/stanfordnlp/dspy/pull/9133 * [Automatic] Update api reference by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/9135 * Replace ujson with orjson in docs by @togimoto in https://github.com/stanfordnlp/dspy/pull/9148 ## New Contributors * @zhiyanliu made their first contribution in https://github.com/stanfordnlp/dspy/pull/9071 * @azai91 made their first contribution in https://github.com/stanfordnlp/dspy/pull/9072 * @0xRaduan made their first contribution in https://github.com/stanfordnlp/dspy/pull/8982 * @Ju-usc made their first contribution in https://github.com/stanfordnlp/dspy/pull/8928 * @mariusarvinte made their first contribution in https://github.com/stanfordnlp/dspy/pull/9106 * @Olocool17 made their first contribution in https://github.com/stanfordnlp/dspy/pull/9130 * @chizukicn made their first contribution in https://github.com/stanfordnlp/dspy/pull/9121 * @mshr-h made their first contribution in https://github.com/stanfordnlp/dspy/pull/9128 * @max-muoto made their first contribution in https://github.com/stanfordnlp/dspy/pull/9143 * @togimoto made their first contribution in https://github.com/stanfordnlp/dspy/pull/9148 * @ritsuki1227 made their first contribution in https://github.com/stanfordnlp/dspy/pull/9167 * @WeichenXu123 made their first contribution in https://github.com/stanfordnlp/dspy/pull/9165 **Full Changelog**: https://github.com/stanfordnlp/dspy/compare/3.1.0...3.1.1
## What's Changed ### Features & Enhancements * **Tooling / APIs** * Add `ToolCall.execute` for smoother tool execution (#8825, @TomeHirata) * **Networking / Headers** * Add DSPy User-Agent header (#8887, @TomeHirata) * Update headers when specified (#8893, @TomeHirata) * **Arbor / RL** * Arbor GRPO Sync Update (#8939, @Ziems) ### Bug Fixes & Reliability * **Streaming / Buffers** * Fix chunk loss in long streaming with native response field (#8881, @TomeHirata) * Make the buffer condition more precise (#8907, @TomeHirata) * fix: add fallback on missing end marker during streaming (#8890, @enitrat) * **Adapters** * fix(JSONAdapter): escape logic when JSON mode but no structured outputs (#8871, @isaacbmiller) * fix: XML adapter markers (#8876, @enitrat) * Fix `test_xml_adapter_full_prompt` (#8904, @TomeHirata) * **Responses / APIs** * Fix responses API (#8880, @chenmoneygithub) * Fix response_format handling for responses API (#8911, @TomeHirata) * **Core / LM** * Fix error handling in dspy parallel (#8860, @TomeHirata) * fix(LM): default `temperature` and `max_tokens` to `None` (#8908, @isaacbmiller) * **MIPRO** * fix(MIPROv2): select between `task_model` and `prompt_model` (#8877, @isaacbmiller) ### Security & Privacy * Exclude API keys from saved programs (#8941, @Copilot) ### Refactors & Maintenance * Refactor URL construction in `ArborReinforceJob` to use `urljoin` (#8951, @Ziems) * Update type hint of `ClientSession` (#8894, @TomeHirata) * Long line in function signature (style) (#8914, @chenmoneygithub) * Fix lint of LM (#8884, @chenmoneygithub) ### Documentation * Add Learn MCP page (#8903, @TomeHirata) * Fix MIPRO paper link in RAG tutorial (#8937, @TomeHirata) * [Docstring] Add docstring for Adapter (#8915, @chenmoneygithub) * [Docs] Google-style docstrings for `dspy/primitives/example` Example class (#8949, @Davshiv20) * [Docs] Google-style docstrings for `Signature.prepend/append/insert/delete` (#8945, @gnetsanet) * Better tutorial sidebar—do not auto-expand all tutorials (#8912, @chenmoneygithub) ### Tests & Stability * Deflake the real LM test (#8924, @chenmoneygithub) ## New Contributors * @enitrat made their first contribution in https://github.com/stanfordnlp/dspy/pull/8890 * @Copilot made their first contribution in https://github.com/stanfordnlp/dspy/pull/8941 * @Davshiv20 made their first contribution in https://github.com/stanfordnlp/dspy/pull/8949 * @gnetsanet made their first contribution in https://github.com/stanfordnlp/dspy/pull/8945 **Full Changelog**: https://github.com/stanfordnlp/dspy/compare/3.0.4b1...3.0.4b2
## What's Changed ### GEPA + Other Optimizers - Fix GEPA usage tracking with tuple outputs by @smec-cgint in #8739 - Add custom instruction_proposer support to GEPA with multimodal (dspy.Image) handling by @andressrg in #8737 - Enhance logging for valset usage in GEPA by @LakshyAAAgrawal in #8770 - [Feature] GEPA: Add custom component selection logic support by @andressrg in #8765 - Add MLFLow <> GEPA support by @TomeHirata in #8763 - Update optimization overview with data split guidance by @LakshyAAAgrawal in #8792 - docs: Add comprehensive instruction_proposer documentation and examples for GEPA by @andressrg in #8775 - Introduce gepa_kwargs for passing custom kwargs to gepa.optimize by @LakshyAAAgrawal in #8850 - Propagate callback metadata during GEPA minibatch eval by @TomeHirata in #8835 - Fix typo in GEPA warning by @TomeHirata in #8840 - Update gepa[dspy] dependency version to 0.0.17; Potential fix for load from state not working in GEPA by @LakshyAAAgrawal in #8859 - SIMBA Improvements by @klopsahlong in #8766 ### Custom Type - Add Anthropic Citation API support by @TomeHirata in #8721 - Add api reference for citations and document by @TomeHirata in #8801 - Allow custom type to be streamed and use native response by @TomeHirata in #8778 - Fix example code for Citations by @TomeHirata in #8868 ### Image & Multimodal Support - Deprecate Image from_* helpers in favor of flexible constructor by @isaacbmiller in #8771 - Cache Image.format for better throughput by @TomeHirata in #8842 - test(dspy.Image): Adds a test with ReAct that has an Image tool by @isaacbmiller in #8855 ### Bug Fixes & Type Handling - Fix #8703 - fixing module and feedback mismatch by @Lucas-Fernandes-Martins in #8777 - Fix value parsing and add tests by @chenmoneygithub in #8774 - Parse doubly-encoded base type in json.parse by @TomeHirata in #8814 - Fix unexpected parsing of Optional[str] fields when string has brackets or braces by @sontanon in #8805 - Use mcp.ClientSession for type hint by @TomeHirata in #8826 - Fix type hint for callpreprocess by @TomeHirata in #8827 - fix: Allow DummyLM answers dict values to be of any type to work with a wider range of signatures by @BenMcH in #8803 - Fix the crash when usage tracker is enabled with non-prediction output by @TomeHirata in #8831 - Fallback to memory cache when disk is not available by @TomeHirata in #8718 - bug(lm): Avoid unnecessary cache key computation by @isaacbmiller in #8862 - Display metric=0 in eval table by @TomeHirata in #8817 - Add save/load to Embeddings by @TomeHirata in #8818 ### Documentation & Tutorials - Minor document changes by @Navanit-git in #8722 - Add doc page to learn tool usage in DSPy by @TomeHirata in #8709 - Style fix for tool page by @TomeHirata in #8781 - Add tracing banner in new tutorials by @B-Step62 in #8772 - docs: fix link to the sglang installation/getting started page by @tomsanbear in #8776 - Guide on using native tool calling by @chenmoneygithub in #8788 - fix: removed duplicate cell from GEPA information extraction tutorial by @vacmar01 in #8806 - Remove EmailInsight class from email extraction tutorial by @TomeHirata in #8790 - Update documentation to include responses api by @chenmoneygithub in #8780 - [Feature] Add automatic llms.txt generation via mkdocs-llmstxt plugin by @aberoham in #8562 - Guide on using native tool calling by @chenmoneygithub in #8788 - Update HotPotQA in light of #8591 by @okhat in #8751 ### Minor Fixes & Maintenance - Use developer role in response API by @TomeHirata in #8727 - 8688 csv output by @crawftv in #8725 - Add header link by @TomeHirata in #8773 - Add experimental annotation by @TomeHirata in #8712 - Update LICENSE error by @TomeHirata in #8783 - Fixed Spelling error in DatasetDescriptor Prompt by @PoeAudits in #8812 - Update API reference by @TomeHirata in #8844 - Expose EvaluationResult as dspy.evaluate.EvaluationResult by @TomeHirata in #8843 - Include built-in types in DSPy api references by @chenmoneygithub in #8810 - Change DummyLM to take an adapter at init by @isaacbmiller in #8802 - Infinitus AI agents by @suman-subash-infinitusai in #8708 - [WIP] Arbor Interface Update by @Ziems in #8837 ## New Contributors * @crawftv made their first contribution in https://github.com/stanfordnlp/dspy/pull/8725 * @Navanit-git made their first contribution in https://github.com/stanfordnlp/dspy/pull/8722 * @smec-cgint made their first contribution in https://github.com/stanfordnlp/dspy/pull/8739 * @suman-subash-infinitusai made their first contribution in https://github.com/stanfordnlp/dspy/pull/8708 * @andressrg made their first contribution in https://github.com/stanfordnlp/dspy/pull/8737 * @tomsanbear made their first contribution in https://github.com/stanfordnlp/dspy/pull/8776 * @Lucas-Fernandes-Martins made their first contribution in https://github.com/stanfordnlp/dspy/pull/8777 * @aberoham made their first contribution in https://github.com/stanfordnlp/dspy/pull/8562 * @PoeAudits made their first contribution in https://github.com/stanfordnlp/dspy/pull/8812 * @sontanon made their first contribution in https://github.com/stanfordnlp/dspy/pull/8805 **Full Changelog**: https://github.com/stanfordnlp/dspy/compare/3.0.3...3.0.4b1
## What's Changed New Functionality * Introduce `rollout_id` for bypassing LM cache in a namespaced way by @okhat in https://github.com/stanfordnlp/dspy/pull/8745 * Raise temperature when doing multiple rollouts (and warn otherwise) by @okhat in https://github.com/stanfordnlp/dspy/pull/8748 Optimizers * Bump gepa version - Fix dependencies, Add progress bar, Ensure failing metrics do not continue running by @LakshyAAAgrawal in https://github.com/stanfordnlp/dspy/pull/8701 * Fix __call__ to forward in dspy.GEPA tutorial by @LakshyAAAgrawal in https://github.com/stanfordnlp/dspy/pull/8719 Maintenance * Replace ujson by orjson by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8655 * Change how `forward` is patched to avoid warning on explicit `forward` call by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8700 * Add type hints and fix doc string of SIMBA by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8707 * Remove deprecated LiteLLM caching from LM by @okhat in https://github.com/stanfordnlp/dspy/pull/8742 * Fix Predict config merging and document rollout_id usage by @okhat in https://github.com/stanfordnlp/dspy/pull/8746 * Lower max_tokens requirement for reasoning LMs by @okhat in https://github.com/stanfordnlp/dspy/pull/8750 **Full Changelog**: https://github.com/stanfordnlp/dspy/compare/3.0.2...3.0.3
## What's Changed Optimizers * Fix Evaluate call bug in GEPA by @LakshyAAAgrawal in https://github.com/stanfordnlp/dspy/pull/8647 * Lazy import of gepa package by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8638 LMs & Adapters * Use pydantic's `ConfigDict` for config; filter litellm warnings by @kurtmckee in https://github.com/stanfordnlp/dspy/pull/8659 * Remove hardcoded model list from OpenAIProvider file by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8649 * Raise explicit error on not meeting reasoning model's requirement by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8650 * Flexible handling of `dspy.ToolCalls` parsing by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8563 Maintenance * fix(evaluate): Raise TypeError on return_outputs in evaluate kwargs by @isaacbmiller in https://github.com/stanfordnlp/dspy/pull/8644 * Add type hints for UsageTracker by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8636 ## New Contributors * @bogireddytejareddy made their first contribution in https://github.com/stanfordnlp/dspy/pull/8646 **Full Changelog**: https://github.com/stanfordnlp/dspy/compare/3.0.0...3.0.1
Major changes since 2.6 (hundreds of PRs) will be updated here in the future. For now, the changes below are relative to 3.0.0b4 from yesterday. ## What's Changed, relative 3.0.0b4 Optimizers * Add GEPA (Genetic-Pareto) Optimizer by @LakshyAAAgrawal in https://github.com/stanfordnlp/dspy/pull/8624, https://github.com/stanfordnlp/dspy/pull/8628, and https://github.com/stanfordnlp/dspy/pull/8633 Maintenance * Migrate from `set-output` to `$GITHUB_OUTPUT` usage by @kurtmckee in https://github.com/stanfordnlp/dspy/pull/8557 ## New Contributors * @LakshyAAAgrawal made their first contribution in https://github.com/stanfordnlp/dspy/pull/8624 **Full Changelog**: https://github.com/stanfordnlp/dspy/compare/3.0.0b4...3.0.0
## What's Changed Optimizers * Fixes for MIPRO: Don't fail silently on bootstrapping! by @okhat in https://github.com/stanfordnlp/dspy/pull/8548 * skip unhashable module histories for mipro program proposer by @arnavsinghvi11 in https://github.com/stanfordnlp/dspy/pull/8572 * Update Arbor GRPO Integration by @Ziems in https://github.com/stanfordnlp/dspy/pull/8609 * Remove user confirmation from MiproV2 by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8552 Adapters & Tools * fix(dspy): Fix MCP tool conversion when schema has no input params by @tvdaptible in https://github.com/stanfordnlp/dspy/pull/8566 * Explicitly mark the end of streaming by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8587 * faster json parsing for images in chatadapter by @jmhb0 in https://github.com/stanfordnlp/dspy/pull/8596 * Use json mode for serialization by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8605 * Custom BAMLAdapter to improve structured outputs by @prrao87 in https://github.com/stanfordnlp/dspy/pull/8614 LMs & Modules * Mark gpt-5 as reasoning model by @olesyash in https://github.com/stanfordnlp/dspy/pull/8620 * Fix infinite growing trace and add tests by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8607 * Litellm logging management by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8619 * nit: fix "poorly-design" by @danielsparing in https://github.com/stanfordnlp/dspy/pull/8622 * remove history and callbacks from module saving by @arnavsinghvi11 in https://github.com/stanfordnlp/dspy/pull/8599 * update deduplicate by @apieum in https://github.com/stanfordnlp/dspy/pull/8623 Maintenance * Increment python version for pre-commit by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8602 * Run the `typos` tool against the codebase by @kurtmckee in https://github.com/stanfordnlp/dspy/pull/8560 * Fix incorrect `build-system` requirements by @kurtmckee in https://github.com/stanfordnlp/dspy/pull/8558 * Vendor Hasher class from datasets library in order to remove larger dependency by @BenMcH in https://github.com/stanfordnlp/dspy/pull/8621 ## New Contributors * @weklund made their first contribution in https://github.com/stanfordnlp/dspy/pull/8554 * @vakinapalli made their first contribution in https://github.com/stanfordnlp/dspy/pull/8569 * @tvdaptible made their first contribution in https://github.com/stanfordnlp/dspy/pull/8566 * @jmhb0 made their first contribution in https://github.com/stanfordnlp/dspy/pull/8596 * @olesyash made their first contribution in https://github.com/stanfordnlp/dspy/pull/8620 * @kurtmckee made their first contribution in https://github.com/stanfordnlp/dspy/pull/8560 * @prrao87 made their first contribution in https://github.com/stanfordnlp/dspy/pull/8614 * @danielsparing made their first contribution in https://github.com/stanfordnlp/dspy/pull/8622 * @apieum made their first contribution in https://github.com/stanfordnlp/dspy/pull/8623 **Full Changelog**: https://github.com/stanfordnlp/dspy/compare/3.0.0b3...3.0.0b4
## What's Changed Key bugfix: The removal of `datasets` from the default dependencies in 3.0.0b1 meant that if the user didn't have `datasets` installed, the bootstrapping of MIPROv2 would fail silently, leading to worse optimization. Added `datasets` back in commit [8aa065945](https://github.com/stanfordnlp/dspy/commit/8aa0659451a1f44c60b213b7321563a1f677db1e). Signatures, Adapters, & Types * add dspy.Code by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8511 * Provide language to dspy.Code by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8519 * Use collections for type hints by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8513 * Add testing for PEP604 union types by @erandeutsch in https://github.com/stanfordnlp/dspy/pull/8475 * Fix type annotation for ensure_signature by @grisaitis in https://github.com/stanfordnlp/dspy/pull/8496 * Use model_dump instead of dict by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8493 * Fix native function calling in adapters by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8479 * Rename dspy.BaseType to dspy.Type by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8510 * Resolve "$def" for nested tool arg type by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8534 * Add token streaming support for XMLAdapter by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8478 Modules * Update python_interpreter.py by @nillwyc in https://github.com/stanfordnlp/dspy/pull/8501 * unwrap pyodide object correctly by @arnavsinghvi11 in https://github.com/stanfordnlp/dspy/pull/8466 * Provide a `dspy.syncify` so that users can run optimizer on async dspy programs by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8509 * fix UnicodeDecodeError: 'gbk' codec can't decode by @nillwyc in https://github.com/stanfordnlp/dspy/pull/8522 Other * Support MIPROv2 user confirmation in windows by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8485 * Run unit tests with real LLM calls by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8486 ## New Contributors * @LukasMurdock made their first contribution in https://github.com/stanfordnlp/dspy/pull/8477 * @ken-dwyer made their first contribution in https://github.com/stanfordnlp/dspy/pull/8474 * @grisaitis made their first contribution in https://github.com/stanfordnlp/dspy/pull/8496 * @vacmar01 made their first contribution in https://github.com/stanfordnlp/dspy/pull/8499 * @fswair made their first contribution in https://github.com/stanfordnlp/dspy/pull/8498 * @nillwyc made their first contribution in https://github.com/stanfordnlp/dspy/pull/8501 * @asad-aali made their first contribution in https://github.com/stanfordnlp/dspy/pull/8512 * @niklovescoding made their first contribution in https://github.com/stanfordnlp/dspy/pull/8515 * @MaximeRivest made their first contribution in https://github.com/stanfordnlp/dspy/pull/8527 * @brenorb made their first contribution in https://github.com/stanfordnlp/dspy/pull/8542 **Full Changelog**: https://github.com/stanfordnlp/dspy/compare/3.0.0b2...3.0.0b3