View Notebook on GithubDocumentation Index
Fetch the complete documentation index at: https://docs.agentops.ai/llms.txt
Use this file to discover all available pages before exploring further.
Anthropic Example for understanding Tools
Anthropic’s tool returns are not as simple as getting a few strings! While this system is more complex than those before it, it’s also simple enough to be used without problem once you understand how it works! To get started, we will import Agentops and Anthropic.Installation
Setup
Setup our generic default statements:Creating a Dummy Tool
Now to create a simple dummy tool! We are going to make a tool that will tell us about the demon infestation levels for 3 areas. From there, we will have VEGA, our AI determine the best place for the Doom Slayer to attack.Constructing the Message Stream
Now to the real core of this; making our message stream! We create this as a function we can call later! I create examples since the LLM’s context size can handle it (and it’s generally good practice)! We are also going to take several steps here; we must create an example of the tool being used as context. Next, we must add the generated lines to the messages list once done being generated. Finally, we will parse the text for the format we want and request another line. Now we make a message! This time around we will skip making an initial message that has too much context, unlike in the past!response.content[0].text to get the AI’s text! Let’s try it below.
initial_messages!
initial_messages from before actually! However let’s change the context.

