haystack icon indicating copy to clipboard operation
haystack copied to clipboard

feat: support rest-style docstrings when loading tools from function

Open LastRemote opened this issue 10 months ago • 3 comments

Related Issues

#9023

Proposed Changes:

Supports ReST-style docstrings when loading a tool from function. The docstring will be automatically parsed for function-level descriptions and parameter descriptions. It's a small feature due to the fact that I was too lazy to write parameter annotations in class and instance methods.

How did you test it?

Added a new unit test for it.

Notes for the reviewer

N/A

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

LastRemote avatar Mar 10 '25 07:03 LastRemote

P.S. Parameter and return type definitions in ReST docstrings are currently ignored to avoid things being too complicated.

LastRemote avatar Mar 10 '25 08:03 LastRemote

Pull Request Test Coverage Report for Build 13759572106

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 89.965%

Totals Coverage Status
Change from base Build 13718432299: 0.03%
Covered Lines: 9718
Relevant Lines: 10802

💛 - Coveralls

coveralls avatar Mar 10 '25 08:03 coveralls

@anakin87 Sure thing, here is the GH issue: https://github.com/deepset-ai/haystack/issues/9023

LastRemote avatar Mar 12 '25 06:03 LastRemote