Skip to content

Add __name__ and __doc__ from wrapped function in partial function initialized via functools.partial #138493

@akhil14shukla

Description

@akhil14shukla

Feature or enhancement

Proposal:

With the latest coming use of agents and tools they heavily depend on name and docstring of the function to decide whether to use the tool or not. When using partially initialized function, it doesn’t maitain the name and docstring of the original function that might lead to incorrect response.
And in general as well since the partial function represents the wrapped function it should have characteristic attributes of that function.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions