org.llm4s.zio

package org.llm4s.zio

Members list

Type members

Classlikes

trait AgentZ

ZIO wrapper for Agent.

ZIO wrapper for Agent.

Lifts every Result[AgentState] return value into ZIO[Any, LLMError, AgentState]. The underlying blocking Agent methods are shifted to ZIO's blocking thread pool and run interruptibly: interrupting the fiber interrupts the running agent loop.

Intentionally a thin wrapper: run does not expose handoffs, and continueConversation does not expose contextWindowConfig; the underlying Agent defaults apply. Tracing, debug logging and the trace log path are still available through the context parameter. Use Agent directly (inside ZIO.attemptBlockingInterrupt) when you need handoffs or context-window pruning.

Tool calls are not a failure of the effect: Agent hands a call with invalid arguments back to the model as a structured error tool result and the run continues. The experimental schema-validated AgentTool contract and the graph runtime (org.llm4s.agent.graph) are not wrapped here.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object AgentZ

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
AgentZ.type
trait LLMClientZ

ZIO wrapper for LLMClient.

ZIO wrapper for LLMClient.

Blocking LLM calls are shifted to ZIO's blocking thread pool via ZIO.attemptBlockingInterrupt, keeping the fiber executor free. Interrupting the fiber (or a timeout) interrupts the provider thread, which is how llm4s providers are cancelled: they keep the interrupt and return Left(CancelledError). An exception thrown by a provider is a defect. LLMError is used directly as the error channel type — no wrapping needed.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object LLMClientZ

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
LLMClientZ.type