org.llm4s.util

package org.llm4s.util

Members list

Type members

Classlikes

trait LiftToResult[F[_]]

Evidence that values in effect F can be lifted into Result.

Evidence that values in effect F can be lifted into Result.

The canonical instance is for cats.Id, which wraps any value in Right. Future backends with richer effects (e.g. cats.effect.IO, scala.concurrent.Future) supply their own instance to bridge into the synchronous Result error channel.

Type parameters

F

the source effect

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object LiftToResult

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
final class RateLimitedLogger(logger: Logger, throttleSeconds: Long, throttleCount: Int)

Thread-safe rate-limited logger to prevent log spam. Logs at most once per time window OR once per count threshold, whichever comes first. Aggregates skipped count between log messages.

Thread-safe rate-limited logger to prevent log spam. Logs at most once per time window OR once per count threshold, whichever comes first. Aggregates skipped count between log messages.

Thread-safety via AtomicLong and AtomicInteger ensures visibility and atomic operations. Multiple threads may pass shouldLog check, but compareAndSet ensures only one logs. Minor event count drift is acceptable for best-effort logging.

SLF4J dependency provided transitively via logback-classic.

Value parameters

logger

SLF4J logger instance

throttleCount

Maximum events before forcing a log

throttleSeconds

Minimum seconds between log messages

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Library of credential-detection patterns used by org.llm4s.agent.guardrails.builtin.SecretLeakGuardrail and Redaction.

Library of credential-detection patterns used by org.llm4s.agent.guardrails.builtin.SecretLeakGuardrail and Redaction.

All regex matching is performed via SecretType instances. Each type knows its own pattern, human-readable name, and the placeholder text to use when redacting.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type