Skip to content

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.

LanguageModelV3GenerateResult

Raw result from model.doGenerate()

ModelResponse

Normalized ModelResponse