@@ -12,9 +12,9 @@ import (
12
12
"testing"
13
13
"time"
14
14
15
- "github.com/sashabaranov /go-openai"
16
- "github.com/sashabaranov /go-openai/internal/test/checks"
17
- "github.com/sashabaranov /go-openai/jsonschema"
15
+ "github.com/meguminnnnnnnnn /go-openai"
16
+ "github.com/meguminnnnnnnnn /go-openai/internal/test/checks"
17
+ "github.com/meguminnnnnnnnn /go-openai/jsonschema"
18
18
)
19
19
20
20
const (
@@ -91,6 +91,10 @@ func TestO1ModelsChatCompletionsDeprecatedFields(t *testing.T) {
91
91
}
92
92
}
93
93
94
+ func ptrOf [T any ](v T ) * T {
95
+ return & v
96
+ }
97
+
94
98
func TestO1ModelsChatCompletionsBetaLimitations (t * testing.T ) {
95
99
tests := []struct {
96
100
name string
@@ -119,7 +123,7 @@ func TestO1ModelsChatCompletionsBetaLimitations(t *testing.T) {
119
123
Role : openai .ChatMessageRoleAssistant ,
120
124
},
121
125
},
122
- Temperature : float32 (2 ),
126
+ Temperature : ptrOf ( float32 (2 ) ),
123
127
},
124
128
expectedError : openai .ErrReasoningModelLimitationsOther ,
125
129
},
@@ -136,7 +140,7 @@ func TestO1ModelsChatCompletionsBetaLimitations(t *testing.T) {
136
140
Role : openai .ChatMessageRoleAssistant ,
137
141
},
138
142
},
139
- Temperature : float32 (1 ),
143
+ Temperature : ptrOf ( float32 (1 ) ),
140
144
TopP : float32 (0.1 ),
141
145
},
142
146
expectedError : openai .ErrReasoningModelLimitationsOther ,
@@ -154,7 +158,7 @@ func TestO1ModelsChatCompletionsBetaLimitations(t *testing.T) {
154
158
Role : openai .ChatMessageRoleAssistant ,
155
159
},
156
160
},
157
- Temperature : float32 (1 ),
161
+ Temperature : ptrOf ( float32 (1 ) ),
158
162
TopP : float32 (1 ),
159
163
N : 2 ,
160
164
},
@@ -239,7 +243,7 @@ func TestO3ModelsChatCompletionsBetaLimitations(t *testing.T) {
239
243
Role : openai .ChatMessageRoleAssistant ,
240
244
},
241
245
},
242
- Temperature : float32 (2 ),
246
+ Temperature : ptrOf ( float32 (2 ) ),
243
247
},
244
248
expectedError : openai .ErrReasoningModelLimitationsOther ,
245
249
},
@@ -256,7 +260,7 @@ func TestO3ModelsChatCompletionsBetaLimitations(t *testing.T) {
256
260
Role : openai .ChatMessageRoleAssistant ,
257
261
},
258
262
},
259
- Temperature : float32 (1 ),
263
+ Temperature : ptrOf ( float32 (1 ) ),
260
264
TopP : float32 (0.1 ),
261
265
},
262
266
expectedError : openai .ErrReasoningModelLimitationsOther ,
@@ -274,7 +278,7 @@ func TestO3ModelsChatCompletionsBetaLimitations(t *testing.T) {
274
278
Role : openai .ChatMessageRoleAssistant ,
275
279
},
276
280
},
277
- Temperature : float32 (1 ),
281
+ Temperature : ptrOf ( float32 (1 ) ),
278
282
TopP : float32 (1 ),
279
283
N : 2 ,
280
284
},
0 commit comments