Skip to content

Commit

Permalink
fix(chat completion): add to the existing messages instead of overwri…
Browse files Browse the repository at this point in the history
…ting the variable each time
  • Loading branch information
vyfor committed Nov 11, 2024
1 parent f914c1d commit a5e23fe
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ data class ChatCompletionRequest(
}

fun messages(block: ChatCompletionMessageBuilder.() -> Unit) {
messages = ChatCompletionMessageBuilder().apply(block).messages
ChatCompletionMessageBuilder().apply(block).messages.apply {
messages?.addAll(this) ?: run { messages = this }
}
}

fun stops(vararg sequences: String) {
Expand Down

0 comments on commit a5e23fe

Please sign in to comment.