Skip to content
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

Improve Docs of Custom Tools and Agents #23255

Merged
merged 10 commits into from
May 10, 2023
Merged

Improve Docs of Custom Tools and Agents #23255

merged 10 commits into from
May 10, 2023

Conversation

patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented May 10, 2023

What does this PR do?

This PR improves the docs explaining how to customize prompts and corrects some grammar, spelling, code snippets of both transformers_agent.mdx and custom_tools.mdx. Also agent.toolbox is made a get method / property which should help both with documentation and forbid the user to overwrite the attribute completely.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@patrickvonplaten patrickvonplaten changed the title Improve agent docs Improve Docs of Custom Tools and Agents May 10, 2023
Comment on lines +223 to +227
@property
def toolbox(self) -> Dict[str, Tool]:
"""Get all tool currently available to the agent"""
return self._toolbox

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the benefit of this design?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid the user changing agent.toolbox. They can still change a key, but not replace (and accidentally eras) the whole variable.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@sgugger sgugger merged commit 996f127 into main May 10, 2023
@sgugger sgugger deleted the Improve-agent-docs branch May 10, 2023 12:55
sgugger pushed a commit that referenced this pull request May 10, 2023
* Improve docs

* correct tip format

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Correct grammer & spelling

* Improve code style

* make style ruff

* make style final
gojiteji pushed a commit to gojiteji/transformers that referenced this pull request Jun 5, 2023
* Improve docs

* correct tip format

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Correct grammer & spelling

* Improve code style

* make style ruff

* make style final
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
* Improve docs

* correct tip format

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Correct grammer & spelling

* Improve code style

* make style ruff

* make style final
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.

None yet

4 participants