Agentic.Loop.Helpers (agentic v0.2.2)

Copy Markdown

Shared utility functions for pipeline stages.

Summary

Functions

Extract plain text from a content block list.

Extract tool_use blocks from a content block list.

Join two text fragments with a double newline separator.

Build a result map from a context struct.

Functions

extract_text(content)

@spec extract_text(term()) :: String.t()

Extract plain text from a content block list.

extract_tool_calls(content)

@spec extract_tool_calls(term()) :: [map()]

Extract tool_use blocks from a content block list.

join_text(acc, text)

@spec join_text(String.t(), String.t()) :: String.t()

Join two text fragments with a double newline separator.

result_from_context(ctx)

@spec result_from_context(Agentic.Loop.Context.t()) :: map()

Build a result map from a context struct.