diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ac82036b..95fde4a9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.61" + ".": "0.1.0-alpha.62" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 04c18e6d..fc6bebe0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 73 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-5d30684c3118d049682ea30cdb4dbef39b97d51667da484689193dc40162af32.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-b524aed1c2c5c928aa4e2c546f5dbb364e7b4d5027daf05e42e210b05a97c3c6.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 11e10130..e77ea949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.1.0-alpha.62 (2025-03-05) + +Full Changelog: [v0.1.0-alpha.61...v0.1.0-alpha.62](https://github.com/openai/openai-go/compare/v0.1.0-alpha.61...v0.1.0-alpha.62) + +### Bug Fixes + +* **api:** add missing file rank enum + more metadata ([#248](https://github.com/openai/openai-go/issues/248)) ([78e98d1](https://github.com/openai/openai-go/commit/78e98d18b319bc0de2c00543d75771166a42db73)) + ## 0.1.0-alpha.61 (2025-02-27) Full Changelog: [v0.1.0-alpha.60...v0.1.0-alpha.61](https://github.com/openai/openai-go/compare/v0.1.0-alpha.60...v0.1.0-alpha.61) diff --git a/README.md b/README.md index eee3910b..d99ac354 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Or to pin the version: ```sh -go get -u 'github.com/openai/openai-go@v0.1.0-alpha.61' +go get -u 'github.com/openai/openai-go@v0.1.0-alpha.62' ``` diff --git a/betathreadrunstep.go b/betathreadrunstep.go index 8fdc27c5..eec646bb 100644 --- a/betathreadrunstep.go +++ b/betathreadrunstep.go @@ -702,7 +702,8 @@ func (r fileSearchToolCallFileSearchJSON) RawJSON() string { // The ranking options for the file search. type FileSearchToolCallFileSearchRankingOptions struct { - // The ranker used for the file search. + // The ranker to use for the file search. If not specified will use the `auto` + // ranker. Ranker FileSearchToolCallFileSearchRankingOptionsRanker `json:"ranker,required"` // The score threshold for the file search. All values must be a floating point // number between 0 and 1. @@ -727,16 +728,18 @@ func (r fileSearchToolCallFileSearchRankingOptionsJSON) RawJSON() string { return r.raw } -// The ranker used for the file search. +// The ranker to use for the file search. If not specified will use the `auto` +// ranker. type FileSearchToolCallFileSearchRankingOptionsRanker string const ( + FileSearchToolCallFileSearchRankingOptionsRankerAuto FileSearchToolCallFileSearchRankingOptionsRanker = "auto" FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolCallFileSearchRankingOptionsRanker = "default_2024_08_21" ) func (r FileSearchToolCallFileSearchRankingOptionsRanker) IsKnown() bool { switch r { - case FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21: + case FileSearchToolCallFileSearchRankingOptionsRankerAuto, FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21: return true } return false diff --git a/finetuningjob.go b/finetuningjob.go index c2f2557c..0559cd61 100644 --- a/finetuningjob.go +++ b/finetuningjob.go @@ -180,6 +180,13 @@ type FineTuningJob struct { EstimatedFinish int64 `json:"estimated_finish,nullable"` // A list of integrations to enable for this fine-tuning job. Integrations []FineTuningJobWandbIntegrationObject `json:"integrations,nullable"` + // Set of 16 key-value pairs that can be attached to an object. This can be useful + // for storing additional information about the object in a structured format, and + // querying for objects via API or the dashboard. + // + // Keys are strings with a maximum length of 64 characters. Values are strings with + // a maximum length of 512 characters. + Metadata shared.Metadata `json:"metadata,nullable"` // The method used for fine-tuning. Method FineTuningJobMethod `json:"method"` JSON fineTuningJobJSON `json:"-"` @@ -204,6 +211,7 @@ type fineTuningJobJSON struct { ValidationFile apijson.Field EstimatedFinish apijson.Field Integrations apijson.Field + Metadata apijson.Field Method apijson.Field raw string ExtraFields map[string]apijson.Field @@ -1087,6 +1095,13 @@ type FineTuningJobNewParams struct { Hyperparameters param.Field[FineTuningJobNewParamsHyperparameters] `json:"hyperparameters"` // A list of integrations to enable for your fine-tuning job. Integrations param.Field[[]FineTuningJobNewParamsIntegration] `json:"integrations"` + // Set of 16 key-value pairs that can be attached to an object. This can be useful + // for storing additional information about the object in a structured format, and + // querying for objects via API or the dashboard. + // + // Keys are strings with a maximum length of 64 characters. Values are strings with + // a maximum length of 512 characters. + Metadata param.Field[shared.MetadataParam] `json:"metadata"` // The method used for fine-tuning. Method param.Field[FineTuningJobNewParamsMethod] `json:"method"` // The seed controls the reproducibility of the job. Passing in the same seed and @@ -1567,6 +1582,9 @@ type FineTuningJobListParams struct { After param.Field[string] `query:"after"` // Number of fine-tuning jobs to retrieve. Limit param.Field[int64] `query:"limit"` + // Optional metadata filter. To filter, use the syntax `metadata[k]=v`. + // Alternatively, set `metadata=null` to indicate no metadata. + Metadata param.Field[map[string]string] `query:"metadata"` } // URLQuery serializes [FineTuningJobListParams]'s query parameters as diff --git a/finetuningjob_test.go b/finetuningjob_test.go index bd42c138..5a241400 100644 --- a/finetuningjob_test.go +++ b/finetuningjob_test.go @@ -11,6 +11,7 @@ import ( "github.com/openai/openai-go" "github.com/openai/openai-go/internal/testutil" "github.com/openai/openai-go/option" + "github.com/openai/openai-go/shared" ) func TestFineTuningJobNewWithOptionalParams(t *testing.T) { @@ -42,6 +43,9 @@ func TestFineTuningJobNewWithOptionalParams(t *testing.T) { Tags: openai.F([]string{"custom-tag"}), }), }}), + Metadata: openai.F(shared.MetadataParam{ + "foo": "string", + }), Method: openai.F(openai.FineTuningJobNewParamsMethod{ Dpo: openai.F(openai.FineTuningJobNewParamsMethodDpo{ Hyperparameters: openai.F(openai.FineTuningJobNewParamsMethodDpoHyperparameters{ @@ -110,6 +114,9 @@ func TestFineTuningJobListWithOptionalParams(t *testing.T) { _, err := client.FineTuning.Jobs.List(context.TODO(), openai.FineTuningJobListParams{ After: openai.F("after"), Limit: openai.F(int64(0)), + Metadata: openai.F(map[string]string{ + "foo": "string", + }), }) if err != nil { var apierr *openai.Error diff --git a/internal/version.go b/internal/version.go index 05fab40e..c6a48575 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.1.0-alpha.61" // x-release-please-version +const PackageVersion = "0.1.0-alpha.62" // x-release-please-version