StopReason
type StopReason = | "cancelled" | "contentFiltered" | "endTurn" | "guardrailIntervened" | "interrupt" | "maxTokens" | "stopSequence" | "toolUse" | "modelContextWindowExceeded" | string & {};Defined in: src/types/messages.ts:646
Reason why the model stopped generating content.
cancelled- Agent invocation was cancelled viaagent.cancel()contentFiltered- Content was filtered by safety mechanismsendTurn- Natural end of the model’s turnguardrailIntervened- A guardrail policy stopped generationinterrupt- Agent execution was interrupted for human inputmaxTokens- Maximum token limit was reachedstopSequence- A stop sequence was encounteredtoolUse- Model wants to use a toolmodelContextWindowExceeded- Input exceeded the model’s context window