StopReason
type StopReason = | "contentFiltered" | "endTurn" | "guardrailIntervened" | "maxTokens" | "stopSequence" | "toolUse" | "modelContextWindowExceeded" | string & {};Defined in: src/types/messages.ts:410
Reason why the model stopped generating content.
contentFiltered- Content was filtered by safety mechanismsendTurn- Natural end of the model’s turnguardrailIntervened- A guardrail policy stopped generationmaxTokens- Maximum token limit was reachedstopSequence- A stop sequence was encounteredtoolUse- Model wants to use a toolmodelContextWindowExceeded- Input exceeded the model’s context window