Lesson 3: loops and goals - the agent that stops on purpose
Lesson 2's loop ended when the model stopped asking for tools. Lesson 3: loops and goals - the agent that stops on purpose. Now your program will decide when the agent stops. You'll add a turn counter, a goal check, and a timeout on every tool, plus a report_status tool with an enum your code can test. In this example, the counter cuts a runaway bill from $2.40 to $0.22. The loop takes about forty lines in JavaScript or Python. Most of the remaining code defines the tools.
4 views


Replies
Be the first to reply
Have a question or a thought to share? Add a comment above to start the conversation.