Skip to content

Conversation

@mediix
Copy link

@mediix mediix commented Nov 29, 2025

resolve #9086

Summary

This PR adds comprehensive Google-style docstrings to the Audio class in dspy/adapters/types/audio.py, covering 6 public APIs.

Changes

  • Added class docstring for Audio with description, attributes, and usage examples
  • Added method docstrings for:
    • format() - Formats audio data for LM consumption
    • from_url() - Creates Audio from URL
    • from_file() - Creates Audio from file path
    • from_array() - Creates Audio from numpy array
  • Added function docstring for:
    • encode_audio() - Encodes audio from various sources
  • Included usage examples in all docstrings
  • All docstrings follow Google Python Style Guide

Checklist

  • All public classes have docstrings
  • All public methods/functions have docstrings
  • Docstrings follow Google style format
  • Included Args:, Returns:, Raises: sections where applicable
  • Added Examples: showing typical usage
  • Docstrings are technically accurate
  • Pre-commit hooks pass (ruff check + format)

Testing

# Validated with ruff
uv tool run ruff check dspy/adapters/types/audio.py
# All checks passed!

uv tool run ruff format dspy/adapters/types/audio.py
# 1 file reformatted

@chenmoneygithub - Ready for review!

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 Google-style docstrings for dspy/adapters/types/audio.py Audio class

1 participant