From 3044a2e01dcd4b4e39b9d9f902535b6ee24dc88a Mon Sep 17 00:00:00 2001 From: PinErh Chen Date: Thu, 2 Nov 2023 15:59:17 +0800 Subject: [PATCH] Update chat.go Change data type from float32 to float64 so that when reading MongoDB `Double` won't arise truncate precision issue. --- chat.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chat.go b/chat.go index df0e5f970..405156e46 100644 --- a/chat.go +++ b/chat.go @@ -74,13 +74,13 @@ type ChatCompletionRequest struct { Model string `json:"model"` Messages []ChatCompletionMessage `json:"messages"` MaxTokens int `json:"max_tokens,omitempty"` - Temperature float32 `json:"temperature,omitempty"` - TopP float32 `json:"top_p,omitempty"` + Temperature float64 `json:"temperature"` + TopP float64 `json:"top_p"` N int `json:"n,omitempty"` Stream bool `json:"stream,omitempty"` Stop []string `json:"stop,omitempty"` - PresencePenalty float32 `json:"presence_penalty,omitempty"` - FrequencyPenalty float32 `json:"frequency_penalty,omitempty"` + PresencePenalty float64 `json:"presence_penalty,omitempty"` + FrequencyPenalty float64 `json:"frequency_penalty,omitempty"` // LogitBias is must be a token id string (specified by their token ID in the tokenizer), not a word string. // incorrect: `"logit_bias":{"You": 6}`, correct: `"logit_bias":{"1639": 6}` // refs: https://platform.openai.com/docs/api-reference/chat/create#chat/create-logit_bias