From 7977a70ac94b6bdca158bc3c3afd201fe3530e73 Mon Sep 17 00:00:00 2001 From: vvatanabe Date: Thu, 1 Jun 2023 05:52:37 +0900 Subject: [PATCH] remove omitempty tag from temperature fields (#333) --- chat.go | 2 +- completion.go | 2 +- edits.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chat.go b/chat.go index a7ce5486a..cbd3554c9 100644 --- a/chat.go +++ b/chat.go @@ -34,7 +34,7 @@ type ChatCompletionRequest struct { Model string `json:"model"` Messages []ChatCompletionMessage `json:"messages"` MaxTokens int `json:"max_tokens,omitempty"` - Temperature float32 `json:"temperature,omitempty"` + Temperature float32 `json:"temperature"` TopP float32 `json:"top_p,omitempty"` N int `json:"n,omitempty"` Stream bool `json:"stream,omitempty"` diff --git a/completion.go b/completion.go index de1360fd9..a2dbebb37 100644 --- a/completion.go +++ b/completion.go @@ -90,7 +90,7 @@ type CompletionRequest struct { Prompt any `json:"prompt,omitempty"` Suffix string `json:"suffix,omitempty"` MaxTokens int `json:"max_tokens,omitempty"` - Temperature float32 `json:"temperature,omitempty"` + Temperature float32 `json:"temperature"` TopP float32 `json:"top_p,omitempty"` N int `json:"n,omitempty"` Stream bool `json:"stream,omitempty"` diff --git a/edits.go b/edits.go index 23b1a64f0..033af126e 100644 --- a/edits.go +++ b/edits.go @@ -12,7 +12,7 @@ type EditsRequest struct { Input string `json:"input,omitempty"` Instruction string `json:"instruction,omitempty"` N int `json:"n,omitempty"` - Temperature float32 `json:"temperature,omitempty"` + Temperature float32 `json:"temperature"` TopP float32 `json:"top_p,omitempty"` }