🏠
Toolhouse
DiscordGithubSign upGo to App
  • 🏠Toolhouse
  • Quick start: deploy your first agent
  • Build agents with the th file
  • Test agents before deploying
  • Deploy and run your agents
  • Agent workers
    • Running Agents asynchronously
      • API Reference
    • Schedule autonomous runs
      • API Reference
  • Toolhouse SDK
    • ✨Quick start (Python)
    • ✨Quick start (TypeScript)
    • Using LlamaIndex
    • Using Vercel AI
  • Choose MCP servers for your agent
  • Customize agents for your end users
  • 💬Execution logs
  • Go to app
Powered by GitBook
On this page
  • Using th run
  • Output and Streaming
  • Example Use Case
  • Important Notes

Test agents before deploying

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

The 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 run

The 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.yaml

When 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 iPhone14"
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: true

To test this agent, navigate to the directory containing the configuration file and run:

th run

The 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 run does not deploy your agent to production. To deploy your agent, use the th deploy command.

  • Make sure to test your agent thoroughly using th run before deploying it to ensure it behaves as expected.

PreviousBuild agents with the th fileNextDeploy and run your agents

Last updated 5 days ago