BraveSearchCategory

org.llm4s.toolapi.builtin.search.BraveSearchCategory
See theBraveSearchCategory companion object
sealed trait BraveSearchCategory[R]

Type-class describing a Brave Search category (Web, Image, Video, News).

Each case object encodes the API endpoint, the tool name exposed to the LLM, a human-readable description, result parsing logic, and how to map a SafeSearch level to the string the Brave API expects.

Type parameters

R

The Scala type that represents a search result for this category

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Image
object News
object Video
object Web

Members list

Value members

Abstract methods

def description: String

Natural-language description shown to the LLM.

Natural-language description shown to the LLM.

Attributes

def endpoint: String

API path segment appended to the Brave Search base URL.

API path segment appended to the Brave Search base URL.

Attributes

def mapSafeSearch(safeSearch: SafeSearch): String

Map a SafeSearch level to the string expected by this category's API endpoint.

Map a SafeSearch level to the string expected by this category's API endpoint.

Some categories (e.g. Image) do not support all levels and remap them.

Value parameters

safeSearch

The requested safe-search level

Attributes

def parseResults(json: Value, query: String): R

Parse the raw Brave API response JSON into a typed result.

Parse the raw Brave API response JSON into a typed result.

Value parameters

json

The parsed API response body

query

The original search query (included in the result for traceability)

Attributes

def toolName: String

Name used to register this tool with a org.llm4s.toolapi.ToolRegistry.

Name used to register this tool with a org.llm4s.toolapi.ToolRegistry.

Attributes