Skip to content

Commit

Permalink
Completion - seed (optional) added to the settings and system_fingerp…
Browse files Browse the repository at this point in the history
…rint (optional) to the response
  • Loading branch information
peterbanda committed Nov 13, 2023
1 parent 24b314a commit 217a2d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ object Param {
case object function_call extends Param
case object after extends Param
case object limit extends Param
case object seed extends Param
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ private trait OpenAICoreServiceImpl extends OpenAICoreService with WSRequestHelp
Param.logit_bias -> {
if (settings.logit_bias.isEmpty) None else Some(settings.logit_bias)
},
Param.user -> settings.user
Param.user -> settings.user,
Param.seed -> settings.seed
)

override def createChatCompletion(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ case class TextCompletionResponse(
id: String,
created: ju.Date,
model: String,
system_fingerprint: Option[String], // NEW
choices: Seq[TextCompletionChoiceInfo],
usage: Option[UsageInfo]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ case class CreateCompletionSettings(

// Up to 4 sequences where the API will stop generating further tokens.
// The returned text will not contain the stop sequence.
stop: Seq[String] = Nil, // Option[String or Array],
stop: Seq[String] = Nil, // Option[String or Array]

// Number between -2.0 and 2.0.
// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
Expand Down Expand Up @@ -66,5 +66,9 @@ case class CreateCompletionSettings(
logit_bias: Map[String, Int] = Map(),

// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
user: Option[String] = None
user: Option[String] = None,

// If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
// Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.
seed: Option[Int] = None // NEW
)

0 comments on commit 217a2d0

Please sign in to comment.