@@ -42,7 +42,7 @@ Private mlngMaxTokens As Long
42
42
Private mdblTopP As Double
43
43
Private mdblTemperature As Double
44
44
Private mdblFrequencyPenalty As Double
45
- Private mdlPresencePenalty As Double
45
+ Private mdblPresencePenalty As Double
46
46
Private mstrPrompt As String
47
47
Private mlngImageWidth As Long
48
48
Private mlngImageHeight As Long
@@ -115,7 +115,7 @@ Public Property Let FrequencyPenalty(ByVal value As Double)
115
115
End Property
116
116
117
117
Public Property Let PresencePenalty(ByVal value As Double )
118
- mdlPresencePenalty = value
118
+ mdblPresencePenalty = value
119
119
End Property
120
120
121
121
Public Property Get ImageHeight() As Long
@@ -168,7 +168,7 @@ End Property
168
168
169
169
170
170
Public Function GetChatSendToAPIJsonString () As String
171
- GetChatSendToAPIJsonString = "{""model"": """ & mstrModel & """, " & mobjMessages.GetAllMessages & ", ""max_tokens"": " & mlngMaxTokens & ", ""top_p"": " & mdblTopP & ", ""temperature"": " & mdblTemperature & ", ""frequency_penalty"": " & mdblFrequencyPenalty & ", ""presence_penalty"": " & mdlPresencePenalty & "}"
171
+ GetChatSendToAPIJsonString = "{""model"": """ & mstrModel & """, " & mobjMessages.GetAllMessages & ", ""max_tokens"": " & mlngMaxTokens & ", ""top_p"": " & DblToEnglishStr( mdblTopP) & ", ""temperature"": " & DblToEnglishStr( mdblTemperature) & ", ""frequency_penalty"": " & DblToEnglishStr( mdblFrequencyPenalty) & ", ""presence_penalty"": " & mdblPresencePenalty & "}"
172
172
End Function
173
173
174
174
@@ -182,3 +182,18 @@ End Function
182
182
Public Function GetImageDimensionLabel () As String
183
183
GetImageDimensionLabel = Chr(34 ) & CStr(mlngImageWidth) & "x" & CStr(mlngImageHeight) & Chr(34 )
184
184
End Function
185
+
186
+
187
+ Private Function DblToEnglishStr (dblNumber As Double ) As String
188
+ 'Purpose: Normalize formatting of number with decimals to English format
189
+
190
+ ' Convert the double to string using system's regional settings
191
+ Dim strNumber As String
192
+ strNumber = CStr(dblNumber)
193
+
194
+ ' Replace comma with period if system uses comma as decimal separator (eg. Italian format)
195
+ strNumber = Replace(strNumber, "," , "." )
196
+
197
+ ' Return the formatted string
198
+ DblToEnglishStr = strNumber
199
+ End Function
0 commit comments