AI Open SDKfor Business Central
API

AIOS Generate Result

Read generated text, usage, and tool-call information.

"AIOS Generate Result" contains the result of a text generation call.

Common accessors

MethodPurpose
Output()Final text or validated JSON
HasToolCalls() / GetToolCalls()Tool calls returned by the model
StoppedAtStepLimit()Whether a tool loop stopped before the model returned a final answer
GetStepCount()Number of generation steps
GetTotalInputTokens() / GetTotalOutputTokens()Total token usage across every model call in the generation
GetInputTokens() / GetOutputTokens()Token usage of the last model call
GetFinishReason()Why the model stopped, as reported by the provider
GetProviderName()Name of the provider that answered, such as anthropic
GetWarnings()Options the SDK adjusted or dropped for this provider. See Request options
HttpStatusCode()HTTP status returned by the provider

Body() and Headers() return the raw provider reply of the last call. Use them while diagnosing an integration, not as a stable contract.

When tools are enabled, inspect HasToolCalls() and StoppedAtStepLimit() before treating the output as a final answer.

See Tools for multi-step behavior.

On this page