ModelStep

org.llm4s.agent.graph.toolloop.ModelStep
See theModelStep companion trait
object ModelStep

Attributes

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

Members list

Value members

Concrete methods

def fromClient(client: LLMClient, options: CompletionOptions, streaming: Boolean, output: Option[ResponseFormat]): ModelStep

Calls client with options, its tools replaced by the loop's org.llm4s.agent.graph.tool.ToolSet.toolFunctions. With streaming, it calls streamComplete, sending each chunk's text as a TextDelta and its thinking as a ThinkingDelta, and returns the accumulated completion; otherwise complete.

Calls client with options, its tools replaced by the loop's org.llm4s.agent.graph.tool.ToolSet.toolFunctions. With streaming, it calls streamComplete, sending each chunk's text as a TextDelta and its thinking as a ThinkingDelta, and returns the accumulated completion; otherwise complete.

output, an agent's response format (design 4.26), replaces options' responseFormat: it is sent on a request that offers no tools, and no format is sent on one that does. A format on a tool-calling request conflicts with tool use for several providers - Gemini refuses a JSON response type with function declarations, and Anthropic's fallback tells the model to answer only in JSON - so the loop never sends one there; the prompt states the schema and the model step validates the answer either way.

Attributes