text
Transformers v4.45.0 released: includes a lightning-fast method to build tools! ⚡️
Transformers v4.45.0 released: includes a lightning-fast method to build tools! ⚡️
new_line
new_line
text
During user research with colleagues 
During user research with colleagues 
mention
@MoritzLaurer
MoritzLaurer
text
 and 
 and 
mention
@Jofthomas
Jofthomas
text
 , we discovered that the class definition currently in used to define a Tool in 
 , we discovered that the class definition currently in used to define a Tool in 
new_line
inline_code
`transformers.agents`
transformers.agents
text
 is a bit tedious to use, because it goes in great detail.
 is a bit tedious to use, because it goes in great detail.
new_line
new_line
text
➡️  So I’ve made an easier way to build tools: just make a function with type hints + a docstring, and add a 
➡️  So I’ve made an easier way to build tools: just make a function with type hints + a docstring, and add a 
mention
@tool
tool
text
 decorator in front.
 decorator in front.
new_line
new_line
text
✅ Voilà, you’re good to go!
✅ Voilà, you’re good to go!
new_line
new_line
text
Read all about it in the new doc here: 
Read all about it in the new doc here: 
link
https://huggingface.co/docs/transformers/main/en/agents#create-a-new-tool
https://huggingface.co/docs/transformers/main/en/agents#create-a-new-tool
new_line
new_line
text
And don’t hesitate to give feedback, I’m all ears! 🤗
And don’t hesitate to give feedback, I’m all ears! 🤗
Transformers v4.45.0 released: includes a lightning-fast method to build tools! ⚡️

During user research with colleagues @MoritzLaurer and @Jofthomas , we discovered that the class definition currently in used to define a Tool in 
`transformers.agents` is a bit tedious to use, because it goes in great detail.

➡️  So I’ve made an easier way to build tools: just make a function with type hints + a docstring, and add a @tool decorator in front.

✅ Voilà, you’re good to go!

Read all about it in the new doc here: https://huggingface.co/docs/transformers/main/en/agents#create-a-new-tool

And don’t hesitate to give feedback, I’m all ears! 🤗
🔥
Jofthomas John6666 alielfilali01 AtAndDev davidrd123 MoritzLaurer
❤️
louisbrulenaudet