Llm4sConfig

org.llm4s.config.Llm4sConfig
object Llm4sConfig

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class EmbeddingsChunkingSettings(enabled: Boolean, size: Int, overlap: Int)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class EmbeddingsInputSettings(inputPath: Option[String], inputPaths: Option[String], query: Option[String])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class EmbeddingsUiSettings(maxRowsPerFile: Int, topDimsPerRow: Int, globalTopK: Int, showGlobalTop: Boolean, colorEnabled: Boolean, tableWidth: Int)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class TextEmbeddingModelSettings(provider: String, modelName: String, dimensions: Int)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show 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])

def modelMetadataOverridePath: Option[String]