ToolsConfigLoader

org.llm4s.config.ToolsConfigLoader

Loads the search tools' configuration from llm4s.tools.*.

This follows the "config at the edge" pattern used throughout llm4s: the application loads a tool's config here and passes it to the tool's create(), so the tools themselves never read configuration.

for
 config <- ToolsConfigLoader.loadBraveSearchTool()
 tool   <- BraveSearchTool.create(config)
yield tool

It replaces Llm4sConfig.loadBraveSearchTool(), loadDuckDuckGoSearchTool() and loadExaSearchTool(), which left llm4s-core with the tools (#1242): the calls are the same, on this object. The llm4s.tools block and its BRAVE_SEARCH_* / EXA_* bindings ship in llm4s-agent-tools' reference.conf.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def loadBraveSearchTool(source: ConfigSource): Result[BraveSearchToolConfig]

Load Brave Search tool configuration from llm4s.tools.brave.

Load Brave Search tool configuration from llm4s.tools.brave.

Value parameters

source

The configuration source

Attributes

Returns

BraveSearchToolConfig or error

loadBraveSearchTool(source) against the current environment: system properties, application.conf and every reference.conf.

loadBraveSearchTool(source) against the current environment: system properties, application.conf and every reference.conf.

Attributes

Load DuckDuckGo Search tool configuration from llm4s.tools.duckduckgo.

Load DuckDuckGo Search tool configuration from llm4s.tools.duckduckgo.

Value parameters

source

The configuration source

Attributes

Returns

DuckDuckGoSearchToolConfig or error

loadDuckDuckGoSearchTool(source) against the current environment.

loadDuckDuckGoSearchTool(source) against the current environment.

Attributes

def loadExaSearchTool(source: ConfigSource): Result[ExaSearchToolConfig]

Load Exa Search tool configuration from llm4s.tools.exa. Validates config-specific fields: numResults, maxCharacters, searchType.

Load Exa Search tool configuration from llm4s.tools.exa. Validates config-specific fields: numResults, maxCharacters, searchType.

Value parameters

source

The configuration source

Attributes

Returns

ExaSearchToolConfig or error

loadExaSearchTool(source) against the current environment.

loadExaSearchTool(source) against the current environment.

Attributes