Agent API examples
List available models
id values as the model in chat requests.
Chat with tools
Request:Sending tool results back
After executing the tool (e.g. reading the file), send the result as a message and call the API again:Interacting with files
- read_file — Client reads the file at the given path and sends the contents in the
toolmessage. - write_file — Client writes the given contents to the path and can confirm success in the
toolmessage. - list_directory — Client lists the directory and returns the listing as the tool result.