Test agents before publishing
You can test your agents as you build them with th run. This command helps you test and validate the output of your agents before deploying them to production.
Using th run
th runThe command syntax is as follows:
th run [agent_file]If there is only one configuration file in the current working directory, you can simply run:
th runThe command will automatically detect and execute the single configuration file.
If there are multiple configuration files in the directory, you'll need to specify the file to run:
th run product-description-generator.yamlWhen you run th run, Toolhouse's CLI sends a request to our agent streaming service with the configuration specified in the YAML file. The agent is executed with the specified configuration, and the results are streamed back to your terminal.
Output and Streaming
The th run command streams the output as it comes from the agent. This output includes:
Calls to MCP servers
Responses from the agent
Example Use Case
Let's consider an example agent configuration file:
id: product-description-generator
title: Product Description Generator
prompt: "Write a product description for {product_name} based on its features and benefits. To do so, look up the product on the internet, then use the results you find to inform your response."
vars:
product_name: "Apple iPhone 14"
system_prompt: "You are a skilled product description writer. Use the results from the web search to generate a compelling product description."
bundle: "default"
public: trueTo test this agent, navigate to the directory containing the configuration file and run:
th runThe th run command will execute the agent and stream the output, allowing you to verify that it generates the expected product description.
Important Notes
th rundoes not deploy your agent to production. To deploy your agent, use theth deploycommand.Make sure to test your agent thoroughly using
th runbefore deploying it to ensure it behaves as expected.
Last updated