org.llm4s.agent.graph.toolloop

Members list

Type members

Classlikes

A reviewer's answer. Edit runs the call with new arguments, recording them in the assistant message first.

A reviewer's answer. Edit runs the call with new arguments, recording them in the assistant message first.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ApprovalRequest(assistantMessageId: String, call: ToolCall, reason: String, source: ApprovalSource)

The question an approval interrupt asks: one tool call, from one assistant message.

The question an approval interrupt asks: one tool call, from one assistant message.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Who asked for an approval. Both kinds resume at the same approval node.

Who asked for an approval. Both kinds resume at the same approval node.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait LoopTool

A tool the loop can call. Stage 0 prototype of the agent-level tool contract: (#1271) replaces it with the typed, schema-validated AgentTool[A]. approved is true when a human approved this call, so a tool that asks for approval must not ask again.

A tool the loop can call. Stage 0 prototype of the agent-level tool contract: (#1271) replaces it with the typed, schema-validated AgentTool[A]. approved is true when a human approved this call, so a tool that asks for approval must not ask again.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object LoopTool

Attributes

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

An operation on the message history, applied to the committed value in commit order.

An operation on the message history, applied to the committed value in commit order.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Messages

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Messages.type
trait ModelStep

The model call: the conversation so far to the next assistant message.

The model call: the conversation so far to the next assistant message.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object ModelStep

Attributes

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

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class StoredMessage(id: String, message: Message)

A conversation message with a stable, graph-owned id. Core org.llm4s.llmconnect.model.Message stays id-free; ids exist so operations can name the message they change, and are derived from the task that wrote the message so a re-run produces the same ids.

A conversation message with a stable, graph-owned id. Core org.llm4s.llmconnect.model.Message stays id-free; ids exist so operations can name the message they change, and are derived from the task that wrote the message so a re-run produces the same ids.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Decides each call before it runs - the policy-middleware stand-in until (#1271)'s AgentMiddleware.

Decides each call before it runs - the policy-middleware stand-in until (#1271)'s AgentMiddleware.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
final class ToolLoop

The model/tool loop as a graph - the Stage 0 proof of runtime-owned tool results and resumable approval ((#1269)):

The model/tool loop as a graph - the Stage 0 proof of runtime-owned tool results and resumable approval ((#1269)):

input -> model --fan-out, one task per call--> call-tool --(dynamic join "tool-batch")--> collect -> model
                                                  \--suspend--> approval --/
  • Each call is its own task: policy first, then the tool. A policy RequireApproval and a tool's NeedsApproval both suspend the call with an ApprovalRequest and resume at the one approval node, whose continuation fills that call's slot in the batch barrier.
  • The loop, not the tool, records exactly one ToolResult per call - for success, failure, denial, rejection and unknown tools alike; the results key refuses a second one.
  • collect runs only when the barrier releases, checks every call of the batch has exactly one result, and appends the ToolMessages in call order. The model never sees a partial batch.
  • The model node re-checks the history with Message.validateConversation before every call.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object ToolLoop

Attributes

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

What a tool did. Tools return content, never ToolMessages: the loop writes every result message.

What a tool did. Tools return content, never ToolMessages: the loop writes every result message.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ToolResult(assistantMessageId: String, toolCallId: String, content: String, isError: Boolean)

The result the loop wrote for one call, waiting for the batch barrier.

The result the loop wrote for one call, waiting for the batch barrier.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ToolTask(assistantMessageId: String, call: ToolCall)

One model-issued tool call, scheduled as its own task.

One model-issued tool call, scheduled as its own task.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all