Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion betaassistant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}{}),
}}),
}),
Expand Down
18 changes: 9 additions & 9 deletions betathread_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{}{}),
}}),
}),
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -349,22 +349,22 @@ 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"}),
}),
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{
Expand Down
12 changes: 6 additions & 6 deletions betathreadrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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"),
}}),
},
)
Expand Down
14 changes: 7 additions & 7 deletions chatcompletion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}),
Expand All @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions finetuningjob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}),
}),
}}),
Expand Down
6 changes: 3 additions & 3 deletions image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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"),
})
Expand Down