From b9a7a0c814fc0480298fb19d6fbcd6db28cc9217 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Mon, 12 Aug 2024 19:48:12 +0000 Subject: [PATCH] chore(examples): minor formatting changes --- betaassistant_test.go | 2 +- betathread_test.go | 18 +++++++++--------- betathreadrun_test.go | 12 ++++++------ chatcompletion_test.go | 14 +++++++------- finetuningjob_test.go | 6 +++--- image_test.go | 6 +++--- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/betaassistant_test.go b/betaassistant_test.go index bf60a210..ce8e3e1f 100644 --- a/betaassistant_test.go +++ b/betaassistant_test.go @@ -39,10 +39,10 @@ func TestBetaAssistantNewWithOptionalParams(t *testing.T) { FileSearch: openai.F(openai.BetaAssistantNewParamsToolResourcesFileSearch{ VectorStoreIDs: openai.F([]string{"string"}), VectorStores: openai.F([]openai.BetaAssistantNewParamsToolResourcesFileSearchVectorStore{{ - FileIDs: openai.F([]string{"string", "string", "string"}), ChunkingStrategy: openai.F[openai.BetaAssistantNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyUnion](openai.BetaAssistantNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyAuto{ Type: openai.F(openai.BetaAssistantNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyAutoTypeAuto), }), + FileIDs: openai.F([]string{"string", "string", "string"}), Metadata: openai.F[any](map[string]interface{}{}), }}), }), diff --git a/betathread_test.go b/betathread_test.go index 413ecce3..c6b770b3 100644 --- a/betathread_test.go +++ b/betathread_test.go @@ -28,8 +28,8 @@ func TestBetaThreadNewWithOptionalParams(t *testing.T) { ) _, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{ Messages: openai.F([]openai.BetaThreadNewParamsMessage{{ - Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser), Content: openai.F[openai.BetaThreadNewParamsMessagesContentUnion](shared.UnionString("string")), + Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser), Attachments: openai.F([]openai.BetaThreadNewParamsMessagesAttachment{{ FileID: openai.F("file_id"), Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{ @@ -60,8 +60,8 @@ func TestBetaThreadNewWithOptionalParams(t *testing.T) { }}), Metadata: openai.F[any](map[string]interface{}{}), }, { - Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser), Content: openai.F[openai.BetaThreadNewParamsMessagesContentUnion](shared.UnionString("string")), + Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser), Attachments: openai.F([]openai.BetaThreadNewParamsMessagesAttachment{{ FileID: openai.F("file_id"), Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{ @@ -92,8 +92,8 @@ func TestBetaThreadNewWithOptionalParams(t *testing.T) { }}), Metadata: openai.F[any](map[string]interface{}{}), }, { - Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser), Content: openai.F[openai.BetaThreadNewParamsMessagesContentUnion](shared.UnionString("string")), + Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser), Attachments: openai.F([]openai.BetaThreadNewParamsMessagesAttachment{{ FileID: openai.F("file_id"), Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{ @@ -132,10 +132,10 @@ func TestBetaThreadNewWithOptionalParams(t *testing.T) { FileSearch: openai.F(openai.BetaThreadNewParamsToolResourcesFileSearch{ VectorStoreIDs: openai.F([]string{"string"}), VectorStores: openai.F([]openai.BetaThreadNewParamsToolResourcesFileSearchVectorStore{{ - FileIDs: openai.F([]string{"string", "string", "string"}), ChunkingStrategy: openai.F[openai.BetaThreadNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyUnion](openai.BetaThreadNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyAuto{ Type: openai.F(openai.BetaThreadNewParamsToolResourcesFileSearchVectorStoresChunkingStrategyAutoTypeAuto), }), + FileIDs: openai.F([]string{"string", "string", "string"}), Metadata: openai.F[any](map[string]interface{}{}), }}), }), @@ -253,8 +253,8 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) { Temperature: openai.F(1.000000), Thread: openai.F(openai.BetaThreadNewAndRunParamsThread{ Messages: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessage{{ - Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser), Content: openai.F[openai.BetaThreadNewAndRunParamsThreadMessagesContentUnion](shared.UnionString("string")), + Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser), Attachments: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachment{{ FileID: openai.F("file_id"), Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{ @@ -285,8 +285,8 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) { }}), Metadata: openai.F[any](map[string]interface{}{}), }, { - Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser), Content: openai.F[openai.BetaThreadNewAndRunParamsThreadMessagesContentUnion](shared.UnionString("string")), + Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser), Attachments: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachment{{ FileID: openai.F("file_id"), Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{ @@ -317,8 +317,8 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) { }}), Metadata: openai.F[any](map[string]interface{}{}), }, { - Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser), Content: openai.F[openai.BetaThreadNewAndRunParamsThreadMessagesContentUnion](shared.UnionString("string")), + Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser), Attachments: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachment{{ FileID: openai.F("file_id"), Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{ @@ -349,6 +349,7 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) { }}), Metadata: openai.F[any](map[string]interface{}{}), }}), + Metadata: openai.F[any](map[string]interface{}{}), ToolResources: openai.F(openai.BetaThreadNewAndRunParamsThreadToolResources{ CodeInterpreter: openai.F(openai.BetaThreadNewAndRunParamsThreadToolResourcesCodeInterpreter{ FileIDs: openai.F([]string{"string", "string", "string"}), @@ -356,15 +357,14 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) { FileSearch: openai.F(openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearch{ VectorStoreIDs: openai.F([]string{"string"}), VectorStores: openai.F([]openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStore{{ - FileIDs: openai.F([]string{"string", "string", "string"}), ChunkingStrategy: openai.F[openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoresChunkingStrategyUnion](openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoresChunkingStrategyAuto{ Type: openai.F(openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoresChunkingStrategyAutoTypeAuto), }), + FileIDs: openai.F([]string{"string", "string", "string"}), Metadata: openai.F[any](map[string]interface{}{}), }}), }), }), - Metadata: openai.F[any](map[string]interface{}{}), }), ToolChoice: openai.F[openai.AssistantToolChoiceOptionUnionParam](openai.AssistantToolChoiceOptionString(openai.AssistantToolChoiceOptionStringNone)), ToolResources: openai.F(openai.BetaThreadNewAndRunParamsToolResources{ diff --git a/betathreadrun_test.go b/betathreadrun_test.go index 636ded87..4d7b9f85 100644 --- a/betathreadrun_test.go +++ b/betathreadrun_test.go @@ -33,8 +33,8 @@ func TestBetaThreadRunNewWithOptionalParams(t *testing.T) { AssistantID: openai.F("assistant_id"), AdditionalInstructions: openai.F("additional_instructions"), AdditionalMessages: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessage{{ - Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser), Content: openai.F[openai.BetaThreadRunNewParamsAdditionalMessagesContentUnion](shared.UnionString("string")), + Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser), Attachments: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachment{{ FileID: openai.F("file_id"), Tools: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{ @@ -65,8 +65,8 @@ func TestBetaThreadRunNewWithOptionalParams(t *testing.T) { }}), Metadata: openai.F[any](map[string]interface{}{}), }, { - Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser), Content: openai.F[openai.BetaThreadRunNewParamsAdditionalMessagesContentUnion](shared.UnionString("string")), + Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser), Attachments: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachment{{ FileID: openai.F("file_id"), Tools: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{ @@ -97,8 +97,8 @@ func TestBetaThreadRunNewWithOptionalParams(t *testing.T) { }}), Metadata: openai.F[any](map[string]interface{}{}), }, { - Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser), Content: openai.F[openai.BetaThreadRunNewParamsAdditionalMessagesContentUnion](shared.UnionString("string")), + Role: openai.F(openai.BetaThreadRunNewParamsAdditionalMessagesRoleUser), Attachments: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachment{{ FileID: openai.F("file_id"), Tools: openai.F([]openai.BetaThreadRunNewParamsAdditionalMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{ @@ -290,14 +290,14 @@ func TestBetaThreadRunSubmitToolOutputsWithOptionalParams(t *testing.T) { "run_id", openai.BetaThreadRunSubmitToolOutputsParams{ ToolOutputs: openai.F([]openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{ - ToolCallID: openai.F("tool_call_id"), Output: openai.F("output"), - }, { ToolCallID: openai.F("tool_call_id"), - Output: openai.F("output"), }, { + Output: openai.F("output"), ToolCallID: openai.F("tool_call_id"), + }, { Output: openai.F("output"), + ToolCallID: openai.F("tool_call_id"), }}), }, ) diff --git a/chatcompletion_test.go b/chatcompletion_test.go index 6c0be39c..e477aa9d 100644 --- a/chatcompletion_test.go +++ b/chatcompletion_test.go @@ -36,8 +36,8 @@ func TestChatCompletionNewWithOptionalParams(t *testing.T) { FrequencyPenalty: openai.F(-2.000000), FunctionCall: openai.F[openai.ChatCompletionNewParamsFunctionCallUnion](openai.ChatCompletionNewParamsFunctionCallString(openai.ChatCompletionNewParamsFunctionCallStringNone)), Functions: openai.F([]openai.ChatCompletionNewParamsFunction{{ - Description: openai.F("description"), Name: openai.F("name"), + Description: openai.F("description"), Parameters: openai.F(shared.FunctionParameters{ "foo": "bar", }), @@ -62,35 +62,35 @@ func TestChatCompletionNewWithOptionalParams(t *testing.T) { Temperature: openai.F(1.000000), ToolChoice: openai.F[openai.ChatCompletionToolChoiceOptionUnionParam](openai.ChatCompletionToolChoiceOptionString(openai.ChatCompletionToolChoiceOptionStringNone)), Tools: openai.F([]openai.ChatCompletionToolParam{{ - Type: openai.F(openai.ChatCompletionToolTypeFunction), Function: openai.F(shared.FunctionDefinitionParam{ - Description: openai.F("description"), Name: openai.F("name"), + Description: openai.F("description"), Parameters: openai.F(shared.FunctionParameters{ "foo": "bar", }), Strict: openai.F(true), }), - }, { Type: openai.F(openai.ChatCompletionToolTypeFunction), + }, { Function: openai.F(shared.FunctionDefinitionParam{ - Description: openai.F("description"), Name: openai.F("name"), + Description: openai.F("description"), Parameters: openai.F(shared.FunctionParameters{ "foo": "bar", }), Strict: openai.F(true), }), - }, { Type: openai.F(openai.ChatCompletionToolTypeFunction), + }, { Function: openai.F(shared.FunctionDefinitionParam{ - Description: openai.F("description"), Name: openai.F("name"), + Description: openai.F("description"), Parameters: openai.F(shared.FunctionParameters{ "foo": "bar", }), Strict: openai.F(true), }), + Type: openai.F(openai.ChatCompletionToolTypeFunction), }}), TopLogprobs: openai.F(int64(0)), TopP: openai.F(1.000000), diff --git a/finetuningjob_test.go b/finetuningjob_test.go index 75e8c8a7..165b6fe7 100644 --- a/finetuningjob_test.go +++ b/finetuningjob_test.go @@ -37,24 +37,24 @@ func TestFineTuningJobNewWithOptionalParams(t *testing.T) { Type: openai.F(openai.FineTuningJobNewParamsIntegrationsTypeWandb), Wandb: openai.F(openai.FineTuningJobNewParamsIntegrationsWandb{ Project: openai.F("my-wandb-project"), - Name: openai.F("name"), Entity: openai.F("entity"), + Name: openai.F("name"), Tags: openai.F([]string{"custom-tag", "custom-tag", "custom-tag"}), }), }, { Type: openai.F(openai.FineTuningJobNewParamsIntegrationsTypeWandb), Wandb: openai.F(openai.FineTuningJobNewParamsIntegrationsWandb{ Project: openai.F("my-wandb-project"), - Name: openai.F("name"), Entity: openai.F("entity"), + Name: openai.F("name"), Tags: openai.F([]string{"custom-tag", "custom-tag", "custom-tag"}), }), }, { Type: openai.F(openai.FineTuningJobNewParamsIntegrationsTypeWandb), Wandb: openai.F(openai.FineTuningJobNewParamsIntegrationsWandb{ Project: openai.F("my-wandb-project"), - Name: openai.F("name"), Entity: openai.F("entity"), + Name: openai.F("name"), Tags: openai.F([]string{"custom-tag", "custom-tag", "custom-tag"}), }), }}), diff --git a/image_test.go b/image_test.go index 308a93d8..f4334ee2 100644 --- a/image_test.go +++ b/image_test.go @@ -32,7 +32,7 @@ func TestImageNewVariationWithOptionalParams(t *testing.T) { Model: openai.F(openai.ImageModelDallE2), N: openai.F(int64(1)), ResponseFormat: openai.F(openai.ImageNewVariationParamsResponseFormatURL), - Size: openai.F(openai.ImageNewVariationParamsSize1024x1024), + Size: openai.F(openai.ImageNewVariationParamsSize256x256), User: openai.F("user-1234"), }) if err != nil { @@ -63,7 +63,7 @@ func TestImageEditWithOptionalParams(t *testing.T) { Model: openai.F(openai.ImageModelDallE2), N: openai.F(int64(1)), ResponseFormat: openai.F(openai.ImageEditParamsResponseFormatURL), - Size: openai.F(openai.ImageEditParamsSize1024x1024), + Size: openai.F(openai.ImageEditParamsSize256x256), User: openai.F("user-1234"), }) if err != nil { @@ -93,7 +93,7 @@ func TestImageGenerateWithOptionalParams(t *testing.T) { N: openai.F(int64(1)), Quality: openai.F(openai.ImageGenerateParamsQualityStandard), ResponseFormat: openai.F(openai.ImageGenerateParamsResponseFormatURL), - Size: openai.F(openai.ImageGenerateParamsSize1024x1024), + Size: openai.F(openai.ImageGenerateParamsSize256x256), Style: openai.F(openai.ImageGenerateParamsStyleVivid), User: openai.F("user-1234"), })