Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 0.1.0-alpha.38 #129

Merged
merged 4 commits into from
Nov 20, 2024
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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.37"
".": "0.1.0-alpha.38"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 68
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-2f8ca92b9b1879fd535b685e4767338413fcd533d42f3baac13a9c41da3fce35.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-aa9b01fc0c17eb0cbc200533fc20d6a49c5e764ceaf8049e08b294532be6e9ff.yml
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.1.0-alpha.38 (2024-11-20)

Full Changelog: [v0.1.0-alpha.37...v0.1.0-alpha.38](https://github.com/openai/openai-go/compare/v0.1.0-alpha.37...v0.1.0-alpha.38)

### Features

* **api:** add gpt-4o-2024-11-20 model ([#131](https://github.com/openai/openai-go/issues/131)) ([8dabbd3](https://github.com/openai/openai-go/commit/8dabbd3d3f338986470049c1a3842e47a7194c1e))


### Chores

* **internal:** spec update ([#130](https://github.com/openai/openai-go/issues/130)) ([23476d8](https://github.com/openai/openai-go/commit/23476d8131b009e38f7f22024d925fd7fe76e4db))
* **tests:** limit array example length ([#128](https://github.com/openai/openai-go/issues/128)) ([5560e6b](https://github.com/openai/openai-go/commit/5560e6ba5f77e774d6be40e71628c1b62f8b3005))

## 0.1.0-alpha.37 (2024-11-12)

Full Changelog: [v0.1.0-alpha.36...v0.1.0-alpha.37](https://github.com/openai/openai-go/compare/v0.1.0-alpha.36...v0.1.0-alpha.37)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/openai/openai-go@v0.1.0-alpha.37'
go get -u 'github.com/openai/openai-go@v0.1.0-alpha.38'
```

<!-- x-release-please-end -->
Expand Down
2 changes: 1 addition & 1 deletion audiotranscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestAudioTranscriptionNewWithOptionalParams(t *testing.T) {
Prompt: openai.F("prompt"),
ResponseFormat: openai.F(openai.AudioResponseFormatJSON),
Temperature: openai.F(0.000000),
TimestampGranularities: openai.F([]openai.AudioTranscriptionNewParamsTimestampGranularity{openai.AudioTranscriptionNewParamsTimestampGranularityWord, openai.AudioTranscriptionNewParamsTimestampGranularitySegment}),
TimestampGranularities: openai.F([]openai.AudioTranscriptionNewParamsTimestampGranularity{openai.AudioTranscriptionNewParamsTimestampGranularityWord}),
})
if err != nil {
var apierr *openai.Error
Expand Down
2 changes: 1 addition & 1 deletion batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ type BatchNewParams struct {
// Your input file must be formatted as a
// [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input),
// and must be uploaded with the purpose `batch`. The file can contain up to 50,000
// requests, and can be up to 100 MB in size.
// requests, and can be up to 200 MB in size.
InputFileID param.Field[string] `json:"input_file_id,required"`
// Optional custom metadata for the batch.
Metadata param.Field[map[string]string] `json:"metadata"`
Expand Down
14 changes: 3 additions & 11 deletions betaassistant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,21 @@ func TestBetaAssistantNewWithOptionalParams(t *testing.T) {
Temperature: openai.F(1.000000),
ToolResources: openai.F(openai.BetaAssistantNewParamsToolResources{
CodeInterpreter: openai.F(openai.BetaAssistantNewParamsToolResourcesCodeInterpreter{
FileIDs: openai.F([]string{"string", "string", "string"}),
FileIDs: openai.F([]string{"string"}),
}),
FileSearch: openai.F(openai.BetaAssistantNewParamsToolResourcesFileSearch{
VectorStoreIDs: openai.F([]string{"string"}),
VectorStores: openai.F([]openai.BetaAssistantNewParamsToolResourcesFileSearchVectorStore{{
ChunkingStrategy: openai.F[openai.FileChunkingStrategyParamUnion](openai.AutoFileChunkingStrategyParam{
Type: openai.F(openai.AutoFileChunkingStrategyParamTypeAuto),
}),
FileIDs: openai.F([]string{"string", "string", "string"}),
FileIDs: openai.F([]string{"string"}),
Metadata: openai.F[any](map[string]interface{}{}),
}}),
}),
}),
Tools: openai.F([]openai.AssistantToolUnionParam{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
TopP: openai.F(1.000000),
})
Expand Down Expand Up @@ -111,18 +107,14 @@ func TestBetaAssistantUpdateWithOptionalParams(t *testing.T) {
Temperature: openai.F(1.000000),
ToolResources: openai.F(openai.BetaAssistantUpdateParamsToolResources{
CodeInterpreter: openai.F(openai.BetaAssistantUpdateParamsToolResourcesCodeInterpreter{
FileIDs: openai.F([]string{"string", "string", "string"}),
FileIDs: openai.F([]string{"string"}),
}),
FileSearch: openai.F(openai.BetaAssistantUpdateParamsToolResourcesFileSearch{
VectorStoreIDs: openai.F([]string{"string"}),
}),
}),
Tools: openai.F([]openai.AssistantToolUnionParam{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
TopP: openai.F(1.000000),
},
Expand Down
188 changes: 6 additions & 182 deletions betathread_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,108 +33,22 @@ func TestBetaThreadNewWithOptionalParams(t *testing.T) {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}}),
Metadata: openai.F[any](map[string]interface{}{}),
}, {
Content: openai.F([]openai.MessageContentPartParamUnion{openai.ImageFileContentBlockParam{ImageFile: openai.F(openai.ImageFileParam{FileID: openai.F("file_id"), Detail: openai.F(openai.ImageFileDetailAuto)}), Type: openai.F(openai.ImageFileContentBlockTypeImageFile)}}),
Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser),
Attachments: openai.F([]openai.BetaThreadNewParamsMessagesAttachment{{
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}}),
Metadata: openai.F[any](map[string]interface{}{}),
}, {
Content: openai.F([]openai.MessageContentPartParamUnion{openai.ImageFileContentBlockParam{ImageFile: openai.F(openai.ImageFileParam{FileID: openai.F("file_id"), Detail: openai.F(openai.ImageFileDetailAuto)}), Type: openai.F(openai.ImageFileContentBlockTypeImageFile)}}),
Role: openai.F(openai.BetaThreadNewParamsMessagesRoleUser),
Attachments: openai.F([]openai.BetaThreadNewParamsMessagesAttachment{{
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewParamsMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}}),
Metadata: openai.F[any](map[string]interface{}{}),
}}),
Metadata: openai.F[any](map[string]interface{}{}),
ToolResources: openai.F(openai.BetaThreadNewParamsToolResources{
CodeInterpreter: openai.F(openai.BetaThreadNewParamsToolResourcesCodeInterpreter{
FileIDs: openai.F([]string{"string", "string", "string"}),
FileIDs: openai.F([]string{"string"}),
}),
FileSearch: openai.F(openai.BetaThreadNewParamsToolResourcesFileSearch{
VectorStoreIDs: openai.F([]string{"string"}),
VectorStores: openai.F([]openai.BetaThreadNewParamsToolResourcesFileSearchVectorStore{{
ChunkingStrategy: openai.F[openai.FileChunkingStrategyParamUnion](openai.AutoFileChunkingStrategyParam{
Type: openai.F(openai.AutoFileChunkingStrategyParamTypeAuto),
}),
FileIDs: openai.F([]string{"string", "string", "string"}),
FileIDs: openai.F([]string{"string"}),
Metadata: openai.F[any](map[string]interface{}{}),
}}),
}),
Expand Down Expand Up @@ -190,7 +104,7 @@ func TestBetaThreadUpdateWithOptionalParams(t *testing.T) {
Metadata: openai.F[any](map[string]interface{}{}),
ToolResources: openai.F(openai.BetaThreadUpdateParamsToolResources{
CodeInterpreter: openai.F(openai.BetaThreadUpdateParamsToolResourcesCodeInterpreter{
FileIDs: openai.F([]string{"string", "string", "string"}),
FileIDs: openai.F([]string{"string"}),
}),
FileSearch: openai.F(openai.BetaThreadUpdateParamsToolResourcesFileSearch{
VectorStoreIDs: openai.F([]string{"string"}),
Expand Down Expand Up @@ -258,108 +172,22 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}}),
Metadata: openai.F[any](map[string]interface{}{}),
}, {
Content: openai.F([]openai.MessageContentPartParamUnion{openai.ImageFileContentBlockParam{ImageFile: openai.F(openai.ImageFileParam{FileID: openai.F("file_id"), Detail: openai.F(openai.ImageFileDetailAuto)}), Type: openai.F(openai.ImageFileContentBlockTypeImageFile)}}),
Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser),
Attachments: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachment{{
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}}),
Metadata: openai.F[any](map[string]interface{}{}),
}, {
Content: openai.F([]openai.MessageContentPartParamUnion{openai.ImageFileContentBlockParam{ImageFile: openai.F(openai.ImageFileParam{FileID: openai.F("file_id"), Detail: openai.F(openai.ImageFileDetailAuto)}), Type: openai.F(openai.ImageFileContentBlockTypeImageFile)}}),
Role: openai.F(openai.BetaThreadNewAndRunParamsThreadMessagesRoleUser),
Attachments: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachment{{
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}, {
FileID: openai.F("file_id"),
Tools: openai.F([]openai.BetaThreadNewAndRunParamsThreadMessagesAttachmentsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
}}),
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"}),
FileIDs: openai.F([]string{"string"}),
}),
FileSearch: openai.F(openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearch{
VectorStoreIDs: openai.F([]string{"string"}),
VectorStores: openai.F([]openai.BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStore{{
ChunkingStrategy: openai.F[openai.FileChunkingStrategyParamUnion](openai.AutoFileChunkingStrategyParam{
Type: openai.F(openai.AutoFileChunkingStrategyParamTypeAuto),
}),
FileIDs: openai.F([]string{"string", "string", "string"}),
FileIDs: openai.F([]string{"string"}),
Metadata: openai.F[any](map[string]interface{}{}),
}}),
}),
Expand All @@ -368,18 +196,14 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) {
ToolChoice: openai.F[openai.AssistantToolChoiceOptionUnionParam](openai.AssistantToolChoiceOptionBehavior(openai.AssistantToolChoiceOptionBehaviorNone)),
ToolResources: openai.F(openai.BetaThreadNewAndRunParamsToolResources{
CodeInterpreter: openai.F(openai.BetaThreadNewAndRunParamsToolResourcesCodeInterpreter{
FileIDs: openai.F([]string{"string", "string", "string"}),
FileIDs: openai.F([]string{"string"}),
}),
FileSearch: openai.F(openai.BetaThreadNewAndRunParamsToolResourcesFileSearch{
VectorStoreIDs: openai.F([]string{"string"}),
}),
}),
Tools: openai.F([]openai.BetaThreadNewAndRunParamsToolUnion{openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}, openai.CodeInterpreterToolParam{
Type: openai.F(openai.CodeInterpreterToolTypeCodeInterpreter),
}}),
TopP: openai.F(1.000000),
TruncationStrategy: openai.F(openai.BetaThreadNewAndRunParamsTruncationStrategy{
Expand Down
Loading
Loading