fromAiSdkResult
fromAiSdkResult(
result):ModelResponse
Parses the AI SDK V3 LanguageModelV3GenerateResult into Agent Express’s
internal ModelResponse format.
Extracts text and tool calls from the content array, flattens token
usage from the nested V3 structure, and normalizes the finish reason.
Parameters
Section titled “Parameters”result
Section titled “result”LanguageModelV3GenerateResult
Raw result from model.doGenerate()
Returns
Section titled “Returns”Normalized ModelResponse