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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.61"
".": "0.1.0-alpha.62"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
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.61'
go get -u 'github.com/openai/openai-go@v0.1.0-alpha.62'
```

<!-- x-release-please-end -->
Expand Down
9 changes: 6 additions & 3 deletions betathreadrunstep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
18 changes: 18 additions & 0 deletions finetuningjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:"-"`
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions finetuningjob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading