-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make Tool.from_function
more configurable
#155
Conversation
@@ -106,7 +106,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "Tool": | |||
return cls(**data) | |||
|
|||
@classmethod | |||
def from_function(cls, function: Callable, docstring_as_desc: bool = True) -> "Tool": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've decided to remove docstring_as_desc
since the new parameters allow for more configurability.
We can do that because we are in experimental.
Pull Request Test Coverage Report for Build 12354141486Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks quite good to me already. The new description
that defaults to the docstring is a nice simplification compared to the previous docstring_as_desc
.
I have one suggestion to simplify one of the test cases. Let me know what you think and if you see any reason to keep that test case as is. Otherwise the PR is ready to be merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
Related Issues
name
anddescription
configurable inTool.from_function
haystack#8629Proposed Changes:
name
anddescription
inTool.from_function
class methodHow did you test it?
CI, adapted tests and new tests
Notes for the reviewer
Unit tests are failing for reasons unrelated to this PR. I'm trying to fix them in #156
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.