Method: Anthropic::Models::MessageCreateParams#stop_sequences

Defined in:
lib/anthropic/models/message_create_params.rb

#stop_sequencesArray<String>?

Custom text sequences that will cause the model to stop generating.

Our models will normally stop when they have naturally completed their turn, which will result in a response stop_reason of "end_turn".

If you want the model to stop generating when it encounters custom strings of text, you can use the stop_sequences parameter. If the model encounters one of the custom sequences, the response stop_reason value will be "stop_sequence" and the response stop_sequence value will contain the matched stop sequence.

Returns:

  • (Array<String>, nil)


156
# File 'lib/anthropic/models/message_create_params.rb', line 156

optional :stop_sequences, Anthropic::Internal::Type::ArrayOf[String]