github stanfordnlp/dspy 3.1.1

7 hours ago

What's Changed

RLMs

  • feat(rlm): Add RLM Module and improve PythonInterpreter by @isaacbmiller in #9193
  • Use language in system instructions for dspy.Code fields by @mariusarvinte in #9106
  • Update dspy.RLM to improve reliability and avoid pydantic warnings by @okhat in #9210
  • fix(RLM): Change FinalAnswerResult to FinalOutput and remove RLM call by @isaacbmiller in #9212

GEPA

  • Fix GEPAFeedbackMetric Protocol missing 'self' parameter by @Copilot in #9111
  • feat(gepa): add tool description optimization for multi-agent systems by @Ju-usc in #8928
  • Update pyproject.toml to update gepa from 0.0.22 -> 0.0.24 by @LakshyAAAgrawal in #9161
  • Patch dspy.gepa to handle list[dict] output from a dspy.LM by @mariusarvinte in #9169

Adapters

  • Upgrade json_repair to fix parsing issue of underscore-style float number by @chenmoneygithub in #9088
  • Properly yield the last chunk in streaming by @chenmoneygithub in #9089
  • Avoid unwanted exception chaining when running async tool in sync context by @stevapple in #9092
  • Enhance StreamListener to support generic type annotations for output by @TomeHirata in #9112
  • FIX: streamify was appending StatusStreamingCallback directly to the shared settings.callbacks list by @glesperance in #9073
  • fix(BAMLAdapter): Use docstrings to describe BaseModels by @BenMcH in #9125
  • Fix Responses API structured outputs by @Olocool17 in #9130

Maintenance

  • Fix UsageTracker AttributeError when using ParallelExecutor with dspy.context by @Copilot in #9095
  • Update uv.lock dspy version to match the latest release by @chenmoneygithub in #9067
  • [docs] Add Google-style docstrings for dspy/adapters/chat_adapter.py ChatAdapter class #9063 by @azai91 in #9072
  • Fix ContextWindowExceededError after 3 retries in react loop by @Copilot in #9110
  • fix: skip merging when both usage entry values are None by @chizukicn in #9121
  • Fix: enforce positive memory_max_entries for in-memory cache by @mshr-h in #9128
  • Add typing to dspy.datasets.dataset by @max-muoto in #9143
  • Increase max_iters for dspy.ReAct by @chenmoneygithub in #9162
  • fix(dspy): prevent argument injection in LocalProvider subprocess calls by @Copilot in #9160
  • fix(dspy): populate InputField default values in Predict by @ritsuki1227 in #9167
  • fix(PythonInterpreter): Remove overly permissive read permissions and add strict allow by @isaacbmiller in #9081
  • Add save / load methods for DSpy settings by @WeichenXu123 in #9165

Docs

New Contributors

Full Changelog: 3.1.0...3.1.1

Don't miss a new dspy release

NewReleases is sending notifications on new releases.