HTTPTool

org.llm4s.toolapi.builtin.http.HTTPTool
object HTTPTool

Tool for making HTTP requests.

Features:

  • Support for GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
  • Request headers and body
  • Domain allowlist/blocklist for security
  • Response size limits
  • Configurable timeout

Attributes

Example
{
import org.llm4s.toolapi.builtin.http._
val httpTool = HTTPTool.create(HttpConfig(
 allowedDomains = Some(Seq("api.example.com")),
 allowedMethods = Seq("GET", "POST")
))
val tools = new ToolRegistry(Seq(httpTool))
agent.run("Fetch data from https://api.example.com/data", tools)

}

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
HTTPTool.type

Members list

Value members

Concrete methods

def create(config: HttpConfig): ToolFunction[Map[String, Any], HTTPResult]

Create an HTTP tool with the given configuration.

Create an HTTP tool with the given configuration.

Attributes

Concrete fields

val tool: ToolFunction[Map[String, Any], HTTPResult]

Default HTTP tool with standard configuration.

Default HTTP tool with standard configuration.

Attributes