Skip to content

docs: add docstrings to Predict, ReAct, and BaseLM public methods#9486

Closed
GopalGB wants to merge 1 commit intostanfordnlp:mainfrom
GopalGB:docs-add-docstrings-predict-react-baselm
Closed

docs: add docstrings to Predict, ReAct, and BaseLM public methods#9486
GopalGB wants to merge 1 commit intostanfordnlp:mainfrom
GopalGB:docs-add-docstrings-predict-react-baselm

Conversation

@GopalGB
Copy link
Copy Markdown

@GopalGB GopalGB commented Mar 21, 2026

Summary

Add Google-style docstrings with code examples to public methods across three core files. All follow the Google Python Style Guide and match the conventions established in #9444.

Files changed

File Methods documented
dspy/predict/predict.py reset, dump_state, forward, aforward, update_config, get_config
dspy/predict/react.py forward, aforward
dspy/clients/base_lm.py acall, inspect_history, update_history

What each docstring includes

  • One-line summary describing what the method does
  • Explanation of behavior in context (when to use sync vs async, where history is recorded, etc.)
  • Args section for every parameter
  • Returns section where applicable
  • Code examples using >>> doctest format where helpful

Resolves #9485, ref #8926

Add Google-style docstrings with code examples to public methods that
were missing documentation:

- Predict: reset, dump_state, forward, aforward, update_config, get_config
- ReAct: forward, aforward
- BaseLM: acall, inspect_history, update_history

Resolves stanfordnlp#9485, ref stanfordnlp#8926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: add docstrings to Predict, ReAct, and BaseLM public methods

2 participants