Reconstruct native ellmer turns from conversation history
Value
A fresh unnamed list of ellmer UserTurn and AssistantTurn objects for empty or ReAct histories. RLM histories contain observed invocation exchanges and cannot be reconstructed as ellmer turns. Assistant JSON and finish reason are retained. Usage, cost, and duration metadata use ellmer defaults.
Examples
history <- conversation_history(list(
ellmer::UserTurn(list(ellmer::ContentText("Hello"))),
ellmer::AssistantTurn(list(ellmer::ContentText("Hi!")))
))
turns <- history_turns(history)
length(turns)
#> [1] 2