deepset-ai / deepset-ai/haystack

Support ReST-style docstrings when loading tools from function

Open
#9,023 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P3
Dominant language
Python
Stars
26.6k
Forks
3.2k
Avg merge
1d 3h
Merged PRs (30d)
194

Description

Is your feature request related to a problem? Please describe.
Currently we will need to use Annotated parameters for functions to be smoothly parsed as tools. This is not the standard documentation practice in Python however, and would often need manual labor for tool creators to convert standard python functions to tools. And this manual labor is usually copying from the ReST docstring and pasting to the Annotated description.

Describe the solution you'd like
Make create_tool_from_function support ReST-styled docstrings by default. See https://github.com/deepset-ai/haystack/pull/9004

Describe alternatives you've considered

Additional context
This was a small upgrade when I was working on my personal project, but I feel like this can be standardized as a common feature. So here's the PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the create_tool_from_function entry point and compare the proposed behavior with pull request 9004. Done means ReST-styled docstrings are supported by default without requiring tool creators to copy descriptions into Annotated parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.