@twai/tool-http
v0.0.7
Published
HTTP tool for TWAI (Test With AI) testing framework
Readme
@twai/tool-http
HTTP request tool for the TWAI (Test With AI) testing framework.
Installation
pnpm add @twai/tool-httpUsage
import { HttpTool, createHttpTools } from "@twai/tool-http";
const http = new HttpTool({
baseUrl: "https://api.example.com",
headers: { Authorization: "Bearer token" },
});
// Direct usage
const response = await http.get("/users");
const created = await http.post("/users", { name: "John" });
// As AI tool definitions
const tools = createHttpTools(http);Exports
HttpTool- HTTP client classcreateHttpTools- Create AI tool definitions- Types:
HttpRequest,HttpResponse
