ManagedResource

org.llm4s.resource.ManagedResource
See theManagedResource companion object
trait ManagedResource[R]

A resource acquired and released around a computation, returning Result throughout. Used by llm4s-speech's audio I/O.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def acquire(): Result[R]

Acquire the resource

Acquire the resource

Attributes

def release(resource: R): Result[Unit]

Release the resource safely

Release the resource safely

Attributes

Concrete methods

def use[A](f: R => Result[A]): Result[A]

Use the resource with automatic cleanup

Use the resource with automatic cleanup

Attributes