Skip to content

Commit 85aaaa5

Browse files
chore(examples): minor formatting changes (#14)
1 parent 6417cd7 commit 85aaaa5

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

betaassistant_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ func TestBetaAssistantNewWithOptionalParams(t *testing.T) {
3939
FileSearch: openai.F(openai.BetaAssistantNewParamsToolResourcesFileSearch{
4040
VectorStoreIDs: openai.F([]string{"string"}),
4141
VectorStores: openai.F([]openai.BetaAssistantNewParamsToolResourcesFileSearchVectorStore{{
42-
FileIDs: openai.F([]string{"string", "string", "string"}),
4342
ChunkingStrategy: openai.F[openai.BetaAssistantNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyUnion](openai.BetaAssistantNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyAuto{
4443
Type: openai.F(openai.BetaAssistantNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyAutoTypeAuto),
4544
}),
45+
FileIDs: openai.F([]string{"string", "string", "string"}),
4646
Metadata: openai.F[any](map[string]interface{}{}),
4747
}}),
4848
}),

betathread_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ func TestBetaThreadNewWithOptionalParams(t *testing.T) {
2828
)
2929
_, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{
3030
Messages: openai.F([]openai.BetaThreadNewParamsMessage{{
31-
Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser),
3231
Content: openai.F[openai.BetaThreadNewParamsMessagesContentUnion](shared.UnionString("string")),
32+
Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser),
3333
Attachments: openai.F([]openai.BetaThreadNewParamsMessagesAttachment{{
3434
FileID: openai.F("file_id"),
3535
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
@@ -60,8 +60,8 @@ func TestBetaThreadNewWithOptionalParams(t *testing.T) {
6060
}}),
6161
Metadata: openai.F[any](map[string]interface{}{}),
6262
}, {
63-
Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser),
6463
Content: openai.F[openai.BetaThreadNewParamsMessagesContentUnion](shared.UnionString("string")),
64+
Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser),
6565
Attachments: openai.F([]openai.BetaThreadNewParamsMessagesAttachment{{
6666
FileID: openai.F("file_id"),
6767
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
@@ -92,8 +92,8 @@ func TestBetaThreadNewWithOptionalParams(t *testing.T) {
9292
}}),
9393
Metadata: openai.F[any](map[string]interface{}{}),
9494
}, {
95-
Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser),
9695
Content: openai.F[openai.BetaThreadNewParamsMessagesContentUnion](shared.UnionString("string")),
96+
Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser),
9797
Attachments: openai.F([]openai.BetaThreadNewParamsMessagesAttachment{{
9898
FileID: openai.F("file_id"),
9999
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
@@ -132,10 +132,10 @@ func TestBetaThreadNewWithOptionalParams(t *testing.T) {
132132
FileSearch: openai.F(openai.BetaThreadNewParamsToolResourcesFileSearch{
133133
VectorStoreIDs: openai.F([]string{"string"}),
134134
VectorStores: openai.F([]openai.BetaThreadNewParamsToolResourcesFileSearchVectorStore{{
135-
FileIDs: openai.F([]string{"string", "string", "string"}),
136135
ChunkingStrategy: openai.F[openai.BetaThreadNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyUnion](openai.BetaThreadNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyAuto{
137136
Type: openai.F(openai.BetaThreadNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyAutoTypeAuto),
138137
}),
138+
FileIDs: openai.F([]string{"string", "string", "string"}),
139139
Metadata: openai.F[any](map[string]interface{}{}),
140140
}}),
141141
}),
@@ -253,8 +253,8 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) {
253253
Temperature: openai.F(1.000000),
254254
Thread: openai.F(openai.BetaThreadNewAndRunParamsThread{
255255
Messages: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessage{{
256-
Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser),
257256
Content: openai.F[openai.BetaThreadNewAndRunParamsThreadMessagesContentUnion](shared.UnionString("string")),
257+
Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser),
258258
Attachments: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachment{{
259259
FileID: openai.F("file_id"),
260260
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
@@ -285,8 +285,8 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) {
285285
}}),
286286
Metadata: openai.F[any](map[string]interface{}{}),
287287
}, {
288-
Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser),
289288
Content: openai.F[openai.BetaThreadNewAndRunParamsThreadMessagesContentUnion](shared.UnionString("string")),
289+
Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser),
290290
Attachments: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachment{{
291291
FileID: openai.F("file_id"),
292292
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
@@ -317,8 +317,8 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) {
317317
}}),
318318
Metadata: openai.F[any](map[string]interface{}{}),
319319
}, {
320-
Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser),
321320
Content: openai.F[openai.BetaThreadNewAndRunParamsThreadMessagesContentUnion](shared.UnionString("string")),
321+
Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser),
322322
Attachments: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachment{{
323323
FileID: openai.F("file_id"),
324324
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
@@ -349,22 +349,22 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) {
349349
}}),
350350
Metadata: openai.F[any](map[string]interface{}{}),
351351
}}),
352+
Metadata: openai.F[any](map[string]interface{}{}),
352353
ToolResources: openai.F(openai.BetaThreadNewAndRunParamsThreadToolResources{
353354
CodeInterpreter: openai.F(openai.BetaThreadNewAndRunParamsThreadToolResourcesCodeInterpreter{
354355
FileIDs: openai.F([]string{"string", "string", "string"}),
355356
}),
356357
FileSearch: openai.F(openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearch{
357358
VectorStoreIDs: openai.F([]string{"string"}),
358359
VectorStores: openai.F([]openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStore{{
359-
FileIDs: openai.F([]string{"string", "string", "string"}),
360360
ChunkingStrategy: openai.F[openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoresChunkingStrategyUnion](openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoresChunkingStrategyAuto{
361361
Type: openai.F(openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoresChunkingStrategyAutoTypeAuto),
362362
}),
363+
FileIDs: openai.F([]string{"string", "string", "string"}),
363364
Metadata: openai.F[any](map[string]interface{}{}),
364365
}}),
365366
}),
366367
}),
367-
Metadata: openai.F[any](map[string]interface{}{}),
368368
}),
369369
ToolChoice: openai.F[openai.AssistantToolChoiceOptionUnionParam](openai.AssistantToolChoiceOptionString(openai.AssistantToolChoiceOptionStringNone)),
370370
ToolResources: openai.F(openai.BetaThreadNewAndRunParamsToolResources{

betathreadrun_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ func TestBetaThreadRunNewWithOptionalParams(t *testing.T) {
3333
AssistantID: openai.F("assistant_id"),
3434
AdditionalInstructions: openai.F("additional_instructions"),
3535
AdditionalMessages: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessage{{
36-
Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser),
3736
Content: openai.F[openai.BetaThreadRunNewParamsAdditionalMessagesContentUnion](shared.UnionString("string")),
37+
Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser),
3838
Attachments: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachment{{
3939
FileID: openai.F("file_id"),
4040
Tools: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
@@ -65,8 +65,8 @@ func TestBetaThreadRunNewWithOptionalParams(t *testing.T) {
6565
}}),
6666
Metadata: openai.F[any](map[string]interface{}{}),
6767
}, {
68-
Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser),
6968
Content: openai.F[openai.BetaThreadRunNewParamsAdditionalMessagesContentUnion](shared.UnionString("string")),
69+
Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser),
7070
Attachments: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachment{{
7171
FileID: openai.F("file_id"),
7272
Tools: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
@@ -97,8 +97,8 @@ func TestBetaThreadRunNewWithOptionalParams(t *testing.T) {
9797
}}),
9898
Metadata: openai.F[any](map[string]interface{}{}),
9999
}, {
100-
Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser),
101100
Content: openai.F[openai.BetaThreadRunNewParamsAdditionalMessagesContentUnion](shared.UnionString("string")),
101+
Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser),
102102
Attachments: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachment{{
103103
FileID: openai.F("file_id"),
104104
Tools: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
@@ -290,14 +290,14 @@ func TestBetaThreadRunSubmitToolOutputsWithOptionalParams(t *testing.T) {
290290
"run_id",
291291
openai.BetaThreadRunSubmitToolOutputsParams{
292292
ToolOutputs: openai.F([]openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{
293-
ToolCallID: openai.F("tool_call_id"),
294293
Output: openai.F("output"),
295-
}, {
296294
ToolCallID: openai.F("tool_call_id"),
297-
Output: openai.F("output"),
298295
}, {
296+
Output: openai.F("output"),
299297
ToolCallID: openai.F("tool_call_id"),
298+
}, {
300299
Output: openai.F("output"),
300+
ToolCallID: openai.F("tool_call_id"),
301301
}}),
302302
},
303303
)

chatcompletion_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ func TestChatCompletionNewWithOptionalParams(t *testing.T) {
3636
FrequencyPenalty: openai.F(-2.000000),
3737
FunctionCall: openai.F[openai.ChatCompletionNewParamsFunctionCallUnion](openai.ChatCompletionNewParamsFunctionCallString(openai.ChatCompletionNewParamsFunctionCallStringNone)),
3838
Functions: openai.F([]openai.ChatCompletionNewParamsFunction{{
39-
Description: openai.F("description"),
4039
Name: openai.F("name"),
40+
Description: openai.F("description"),
4141
Parameters: openai.F(shared.FunctionParameters{
4242
"foo": "bar",
4343
}),
@@ -62,35 +62,35 @@ func TestChatCompletionNewWithOptionalParams(t *testing.T) {
6262
Temperature: openai.F(1.000000),
6363
ToolChoice: openai.F[openai.ChatCompletionToolChoiceOptionUnionParam](openai.ChatCompletionToolChoiceOptionString(openai.ChatCompletionToolChoiceOptionStringNone)),
6464
Tools: openai.F([]openai.ChatCompletionToolParam{{
65-
Type: openai.F(openai.ChatCompletionToolTypeFunction),
6665
Function: openai.F(shared.FunctionDefinitionParam{
67-
Description: openai.F("description"),
6866
Name: openai.F("name"),
67+
Description: openai.F("description"),
6968
Parameters: openai.F(shared.FunctionParameters{
7069
"foo": "bar",
7170
}),
7271
Strict: openai.F(true),
7372
}),
74-
}, {
7573
Type: openai.F(openai.ChatCompletionToolTypeFunction),
74+
}, {
7675
Function: openai.F(shared.FunctionDefinitionParam{
77-
Description: openai.F("description"),
7876
Name: openai.F("name"),
77+
Description: openai.F("description"),
7978
Parameters: openai.F(shared.FunctionParameters{
8079
"foo": "bar",
8180
}),
8281
Strict: openai.F(true),
8382
}),
84-
}, {
8583
Type: openai.F(openai.ChatCompletionToolTypeFunction),
84+
}, {
8685
Function: openai.F(shared.FunctionDefinitionParam{
87-
Description: openai.F("description"),
8886
Name: openai.F("name"),
87+
Description: openai.F("description"),
8988
Parameters: openai.F(shared.FunctionParameters{
9089
"foo": "bar",
9190
}),
9291
Strict: openai.F(true),
9392
}),
93+
Type: openai.F(openai.ChatCompletionToolTypeFunction),
9494
}}),
9595
TopLogprobs: openai.F(int64(0)),
9696
TopP: openai.F(1.000000),

finetuningjob_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ func TestFineTuningJobNewWithOptionalParams(t *testing.T) {
3737
Type: openai.F(openai.FineTuningJobNewParamsIntegrationsTypeWandb),
3838
Wandb: openai.F(openai.FineTuningJobNewParamsIntegrationsWandb{
3939
Project: openai.F("my-wandb-project"),
40-
Name: openai.F("name"),
4140
Entity: openai.F("entity"),
41+
Name: openai.F("name"),
4242
Tags: openai.F([]string{"custom-tag", "custom-tag", "custom-tag"}),
4343
}),
4444
}, {
4545
Type: openai.F(openai.FineTuningJobNewParamsIntegrationsTypeWandb),
4646
Wandb: openai.F(openai.FineTuningJobNewParamsIntegrationsWandb{
4747
Project: openai.F("my-wandb-project"),
48-
Name: openai.F("name"),
4948
Entity: openai.F("entity"),
49+
Name: openai.F("name"),
5050
Tags: openai.F([]string{"custom-tag", "custom-tag", "custom-tag"}),
5151
}),
5252
}, {
5353
Type: openai.F(openai.FineTuningJobNewParamsIntegrationsTypeWandb),
5454
Wandb: openai.F(openai.FineTuningJobNewParamsIntegrationsWandb{
5555
Project: openai.F("my-wandb-project"),
56-
Name: openai.F("name"),
5756
Entity: openai.F("entity"),
57+
Name: openai.F("name"),
5858
Tags: openai.F([]string{"custom-tag", "custom-tag", "custom-tag"}),
5959
}),
6060
}}),

image_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestImageNewVariationWithOptionalParams(t *testing.T) {
3232
Model: openai.F(openai.ImageModelDallE2),
3333
N: openai.F(int64(1)),
3434
ResponseFormat: openai.F(openai.ImageNewVariationParamsResponseFormatURL),
35-
Size: openai.F(openai.ImageNewVariationParamsSize1024x1024),
35+
Size: openai.F(openai.ImageNewVariationParamsSize256x256),
3636
User: openai.F("user-1234"),
3737
})
3838
if err != nil {
@@ -63,7 +63,7 @@ func TestImageEditWithOptionalParams(t *testing.T) {
6363
Model: openai.F(openai.ImageModelDallE2),
6464
N: openai.F(int64(1)),
6565
ResponseFormat: openai.F(openai.ImageEditParamsResponseFormatURL),
66-
Size: openai.F(openai.ImageEditParamsSize1024x1024),
66+
Size: openai.F(openai.ImageEditParamsSize256x256),
6767
User: openai.F("user-1234"),
6868
})
6969
if err != nil {
@@ -93,7 +93,7 @@ func TestImageGenerateWithOptionalParams(t *testing.T) {
9393
N: openai.F(int64(1)),
9494
Quality: openai.F(openai.ImageGenerateParamsQualityStandard),
9595
ResponseFormat: openai.F(openai.ImageGenerateParamsResponseFormatURL),
96-
Size: openai.F(openai.ImageGenerateParamsSize1024x1024),
96+
Size: openai.F(openai.ImageGenerateParamsSize256x256),
9797
Style: openai.F(openai.ImageGenerateParamsStyleVivid),
9898
User: openai.F("user-1234"),
9999
})

0 commit comments

Comments
 (0)