Llm4sConfig
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Llm4sConfig.type
Members list
Type members
Classlikes
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Value members
Concrete methods
Load Brave Search tool configuration from application.conf.
Load Brave Search tool configuration from application.conf.
This method loads the BraveSearchToolConfig which should be passed to BraveSearchTool.create() when instantiating the tool.
Configuration is expected at path: llm4s.tools.brave
Example application.conf:
llm4s {
tools {
brave {
apiKey = "your-api-key"
apiUrl = "https://api.search.brave.com/res/v1"
count = 10
safeSearch = "moderate"
}
}
}
Usage:
import org.llm4s.config.Llm4sConfig
import org.llm4s.toolapi.builtin.search.BraveSearchTool
val toolConfig = Llm4sConfig.loadBraveSearchTool().getOrElse(
throw new RuntimeException("Failed to load Brave Search config")
)
val searchTool = BraveSearchTool.create(toolConfig)
Attributes
- Returns
-
Right(BraveSearchToolConfig) if configuration is valid, Left(ConfigurationError) otherwise
Load DuckDuckGo Search tool configuration from application.conf.
Load DuckDuckGo Search tool configuration from application.conf.
This method loads the DuckDuckGoSearchToolConfig which should be passed to DuckDuckGoSearchTool.create() when instantiating the tool.
Configuration is expected at path: llm4s.tools.duckduckgo
Example application.conf:
llm4s {
tools {
duckduckgo {
apiUrl = "https://api.duckduckgo.com"
}
}
}
Usage:
import org.llm4s.config.Llm4sConfig
import org.llm4s.toolapi.builtin.search.DuckDuckGoSearchTool
val toolConfig = Llm4sConfig.loadDuckDuckGoSearchTool().getOrElse(
throw new RuntimeException("Failed to load DuckDuckGo config")
)
val searchTool = DuckDuckGoSearchTool.create(toolConfig)
Attributes
- Returns
-
Right(DuckDuckGoSearchToolConfig) if configuration is valid, Left(ConfigurationError) otherwise
Load the metrics configuration.
Load the metrics configuration.
Returns a MetricsCollector and optional PrometheusEndpoint if metrics are enabled. Use MetricsCollector.noop if you want to disable metrics programmatically.
Attributes
- Returns
-
Result containing (MetricsCollector, Option[PrometheusEndpoint])