Plug In Your Own Functions
Plug In Your Own Functions
Plug In Your Own Functions
What are we building?
Up until now, your assistant could talk, read documents, search the web, and remember things. But what if you want it to actually do something – like check the weather, look up a database, or call an external service? That is what tool calls are for.
A tool call lets you define a custom function and hand it to your assistant. When your assistant decides it needs that function to answer a question, it pauses, tells you exactly what it wants to call and with what inputs, and waits for you to run the function and send back the result. Then it continues the conversation using that result.
Think of it like this: your assistant is the brain, and tools are its hands. You define what those hands can do.
How it works:
1) You define a tool – you describe a function (its name, what it does, what inputs it needs)
2) Your assistant recognizes when to use it – based on the user’s message, it decides if it needs your tool
3) It pauses and asks you to run it – it returns a REQUIRES_ACTION status with the function name and arguments
4) You run the function yourself – this is your code, your logic, your data source
5) You send back the result – your assistant picks up where it left off and responds using your function’s output
Use these helpful resources to complete this challenge:
Submit a link to your GitHub Repository to submit this challenge