Skip to main content

Function: userTurns()

Function: userTurns()

function userTurns(input: Record<string, unknown>): string[];

Extract every user-message content, in order, from an MLflow {"messages":[{"role":"user","content":"..."}]} input. A dataset row can carry a full multi-turn conversation; replaying these against one thread (one t.send per returned string) lets the agent see the accumulating history.

Only role === "user" turns are returned — any interleaved assistant/ system messages in the row are ignored, since the agent generates its own responses; you never inject the dataset's assistant turns. A single-user-turn row yields a one-element array (backward compatible); a row with no messages yields [].

Parameters

ParameterType
inputRecord<string, unknown>

Returns

string[]

Databricks Developer Hub

Ready to ship your next agentic app in minutes?

Read docs