Skip to content

Commit

Permalink
feat: add builder method to add stop sequences to completion task
Browse files Browse the repository at this point in the history
  • Loading branch information
moldhouse committed Aug 12, 2024
1 parent 3614154 commit 81604c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ impl<'a> TaskCompletion<'a> {
self.stopping.maximum_tokens = Some(maximum_tokens);
self
}

pub fn with_stop_sequences(mut self, stop_sequences: &'a [&str]) -> Self {
self.stopping.stop_sequences = stop_sequences;
self
}
}

/// Sampling controls how the tokens ("words") are selected for the completion.
Expand Down

0 comments on commit 81604c1

Please sign in to comment.