Quick Start Guide
Basic Usage
-
Create a Toolbox:
-
Define and Add Tools:
-
Set up your system prompt:
-
Parse the response:
-
(optional) Use async streaming for calling tools ASAP:
# Stream the response async for chunk in anthropic_stream(system, prompt): for event in parser.parse_chunk(chunk): toolbox.use_async(event) # Make sure to reset the parser and handle any unclosed tool tags events = parser.flush() # Optionally you can handle unclosed tool tags, or just ignore them for event in events: toolbox.use_async(event)