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.30 #90

Merged
merged 3 commits into from
Oct 22, 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.29"
".": "0.1.0-alpha.30"
}
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-8729aaa35436531ab453224af10e67f89677db8f350f0346bb3537489edea649.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-f9320ebf347140052c7f8b0bc5c7db24f5e367c368c8cb34c3606af4e2b6591b.yml
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 0.1.0-alpha.30 (2024-10-22)

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

### ⚠ BREAKING CHANGES

* **client:** improve naming of some variants ([#89](https://github.com/openai/openai-go/issues/89))

### Features

* **client:** improve naming of some variants ([#89](https://github.com/openai/openai-go/issues/89)) ([12ac070](https://github.com/openai/openai-go/commit/12ac070611061e98ae2aaaeefa8eb661ff7f995f))

## 0.1.0-alpha.29 (2024-10-17)

Full Changelog: [v0.1.0-alpha.28...v0.1.0-alpha.29](https://github.com/openai/openai-go/compare/v0.1.0-alpha.28...v0.1.0-alpha.29)
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/[email protected].29'
go get -u 'github.com/openai/[email protected].30'
```

<!-- x-release-please-end -->
Expand Down
31 changes: 16 additions & 15 deletions chatcompletion.go
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ func (r ChatCompletionToolType) IsKnown() bool {
// `none` is the default when no tools are present. `auto` is the default if tools
// are present.
//
// Satisfied by [ChatCompletionToolChoiceOptionString],
// Satisfied by [ChatCompletionToolChoiceOptionBehavior],
// [ChatCompletionNamedToolChoiceParam].
type ChatCompletionToolChoiceOptionUnionParam interface {
implementsChatCompletionToolChoiceOptionUnionParam()
Expand All @@ -1567,23 +1567,24 @@ type ChatCompletionToolChoiceOptionUnionParam interface {
// `none` means the model will not call any tool and instead generates a message.
// `auto` means the model can pick between generating a message or calling one or
// more tools. `required` means the model must call one or more tools.
type ChatCompletionToolChoiceOptionString string
type ChatCompletionToolChoiceOptionBehavior string

const (
ChatCompletionToolChoiceOptionStringNone ChatCompletionToolChoiceOptionString = "none"
ChatCompletionToolChoiceOptionStringAuto ChatCompletionToolChoiceOptionString = "auto"
ChatCompletionToolChoiceOptionStringRequired ChatCompletionToolChoiceOptionString = "required"
ChatCompletionToolChoiceOptionBehaviorNone ChatCompletionToolChoiceOptionBehavior = "none"
ChatCompletionToolChoiceOptionBehaviorAuto ChatCompletionToolChoiceOptionBehavior = "auto"
ChatCompletionToolChoiceOptionBehaviorRequired ChatCompletionToolChoiceOptionBehavior = "required"
)

func (r ChatCompletionToolChoiceOptionString) IsKnown() bool {
func (r ChatCompletionToolChoiceOptionBehavior) IsKnown() bool {
switch r {
case ChatCompletionToolChoiceOptionStringNone, ChatCompletionToolChoiceOptionStringAuto, ChatCompletionToolChoiceOptionStringRequired:
case ChatCompletionToolChoiceOptionBehaviorNone, ChatCompletionToolChoiceOptionBehaviorAuto, ChatCompletionToolChoiceOptionBehaviorRequired:
return true
}
return false
}

func (r ChatCompletionToolChoiceOptionString) implementsChatCompletionToolChoiceOptionUnionParam() {}
func (r ChatCompletionToolChoiceOptionBehavior) implementsChatCompletionToolChoiceOptionUnionParam() {
}

type ChatCompletionToolMessageParam struct {
// The contents of the tool message.
Expand Down Expand Up @@ -1838,7 +1839,7 @@ func (r ChatCompletionNewParams) MarshalJSON() (data []byte, err error) {
// `none` is the default when no functions are present. `auto` is the default if
// functions are present.
//
// Satisfied by [ChatCompletionNewParamsFunctionCallString],
// Satisfied by [ChatCompletionNewParamsFunctionCallBehavior],
// [ChatCompletionFunctionCallOptionParam].
type ChatCompletionNewParamsFunctionCallUnion interface {
implementsChatCompletionNewParamsFunctionCallUnion()
Expand All @@ -1847,22 +1848,22 @@ type ChatCompletionNewParamsFunctionCallUnion interface {
// `none` means the model will not call a function and instead generates a message.
// `auto` means the model can pick between generating a message or calling a
// function.
type ChatCompletionNewParamsFunctionCallString string
type ChatCompletionNewParamsFunctionCallBehavior string

const (
ChatCompletionNewParamsFunctionCallStringNone ChatCompletionNewParamsFunctionCallString = "none"
ChatCompletionNewParamsFunctionCallStringAuto ChatCompletionNewParamsFunctionCallString = "auto"
ChatCompletionNewParamsFunctionCallBehaviorNone ChatCompletionNewParamsFunctionCallBehavior = "none"
ChatCompletionNewParamsFunctionCallBehaviorAuto ChatCompletionNewParamsFunctionCallBehavior = "auto"
)

func (r ChatCompletionNewParamsFunctionCallString) IsKnown() bool {
func (r ChatCompletionNewParamsFunctionCallBehavior) IsKnown() bool {
switch r {
case ChatCompletionNewParamsFunctionCallStringNone, ChatCompletionNewParamsFunctionCallStringAuto:
case ChatCompletionNewParamsFunctionCallBehaviorNone, ChatCompletionNewParamsFunctionCallBehaviorAuto:
return true
}
return false
}

func (r ChatCompletionNewParamsFunctionCallString) implementsChatCompletionNewParamsFunctionCallUnion() {
func (r ChatCompletionNewParamsFunctionCallBehavior) implementsChatCompletionNewParamsFunctionCallUnion() {
}

type ChatCompletionNewParamsFunction struct {
Expand Down
4 changes: 2 additions & 2 deletions chatcompletion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestChatCompletionNewWithOptionalParams(t *testing.T) {
Voice: openai.F(openai.ChatCompletionAudioParamVoiceAlloy),
}),
FrequencyPenalty: openai.F(-2.000000),
FunctionCall: openai.F[openai.ChatCompletionNewParamsFunctionCallUnion](openai.ChatCompletionNewParamsFunctionCallString(openai.ChatCompletionNewParamsFunctionCallStringNone)),
FunctionCall: openai.F[openai.ChatCompletionNewParamsFunctionCallUnion](openai.ChatCompletionNewParamsFunctionCallBehavior(openai.ChatCompletionNewParamsFunctionCallBehaviorNone)),
Functions: openai.F([]openai.ChatCompletionNewParamsFunction{{
Name: openai.F("name"),
Description: openai.F("description"),
Expand Down Expand Up @@ -70,7 +70,7 @@ func TestChatCompletionNewWithOptionalParams(t *testing.T) {
IncludeUsage: openai.F(true),
}),
Temperature: openai.F(1.000000),
ToolChoice: openai.F[openai.ChatCompletionToolChoiceOptionUnionParam](openai.ChatCompletionToolChoiceOptionString(openai.ChatCompletionToolChoiceOptionStringNone)),
ToolChoice: openai.F[openai.ChatCompletionToolChoiceOptionUnionParam](openai.ChatCompletionToolChoiceOptionBehavior(openai.ChatCompletionToolChoiceOptionBehaviorNone)),
Tools: openai.F([]openai.ChatCompletionToolParam{{
Function: openai.F(shared.FunctionDefinitionParam{
Name: openai.F("name"),
Expand Down
50 changes: 25 additions & 25 deletions finetuningjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func (r fineTuningJobHyperparametersJSON) RawJSON() string {
// on the size of the dataset. If setting the number manually, we support any
// number between 1 and 50 epochs.
//
// Union satisfied by [FineTuningJobHyperparametersNEpochsString] or
// Union satisfied by [FineTuningJobHyperparametersNEpochsBehavior] or
// [shared.UnionInt].
type FineTuningJobHyperparametersNEpochsUnion interface {
ImplementsFineTuningJobHyperparametersNEpochsUnion()
Expand All @@ -291,7 +291,7 @@ func init() {
"",
apijson.UnionVariant{
TypeFilter: gjson.String,
Type: reflect.TypeOf(FineTuningJobHyperparametersNEpochsString("")),
Type: reflect.TypeOf(FineTuningJobHyperparametersNEpochsBehavior("")),
},
apijson.UnionVariant{
TypeFilter: gjson.Number,
Expand All @@ -300,21 +300,21 @@ func init() {
)
}

type FineTuningJobHyperparametersNEpochsString string
type FineTuningJobHyperparametersNEpochsBehavior string

const (
FineTuningJobHyperparametersNEpochsStringAuto FineTuningJobHyperparametersNEpochsString = "auto"
FineTuningJobHyperparametersNEpochsBehaviorAuto FineTuningJobHyperparametersNEpochsBehavior = "auto"
)

func (r FineTuningJobHyperparametersNEpochsString) IsKnown() bool {
func (r FineTuningJobHyperparametersNEpochsBehavior) IsKnown() bool {
switch r {
case FineTuningJobHyperparametersNEpochsStringAuto:
case FineTuningJobHyperparametersNEpochsBehaviorAuto:
return true
}
return false
}

func (r FineTuningJobHyperparametersNEpochsString) ImplementsFineTuningJobHyperparametersNEpochsUnion() {
func (r FineTuningJobHyperparametersNEpochsBehavior) ImplementsFineTuningJobHyperparametersNEpochsUnion() {
}

// The object type, which is always "fine_tuning.job".
Expand Down Expand Up @@ -586,80 +586,80 @@ func (r FineTuningJobNewParamsHyperparameters) MarshalJSON() (data []byte, err e
// Number of examples in each batch. A larger batch size means that model
// parameters are updated less frequently, but with lower variance.
//
// Satisfied by [FineTuningJobNewParamsHyperparametersBatchSizeString],
// Satisfied by [FineTuningJobNewParamsHyperparametersBatchSizeBehavior],
// [shared.UnionInt].
type FineTuningJobNewParamsHyperparametersBatchSizeUnion interface {
ImplementsFineTuningJobNewParamsHyperparametersBatchSizeUnion()
}

type FineTuningJobNewParamsHyperparametersBatchSizeString string
type FineTuningJobNewParamsHyperparametersBatchSizeBehavior string

const (
FineTuningJobNewParamsHyperparametersBatchSizeStringAuto FineTuningJobNewParamsHyperparametersBatchSizeString = "auto"
FineTuningJobNewParamsHyperparametersBatchSizeBehaviorAuto FineTuningJobNewParamsHyperparametersBatchSizeBehavior = "auto"
)

func (r FineTuningJobNewParamsHyperparametersBatchSizeString) IsKnown() bool {
func (r FineTuningJobNewParamsHyperparametersBatchSizeBehavior) IsKnown() bool {
switch r {
case FineTuningJobNewParamsHyperparametersBatchSizeStringAuto:
case FineTuningJobNewParamsHyperparametersBatchSizeBehaviorAuto:
return true
}
return false
}

func (r FineTuningJobNewParamsHyperparametersBatchSizeString) ImplementsFineTuningJobNewParamsHyperparametersBatchSizeUnion() {
func (r FineTuningJobNewParamsHyperparametersBatchSizeBehavior) ImplementsFineTuningJobNewParamsHyperparametersBatchSizeUnion() {
}

// Scaling factor for the learning rate. A smaller learning rate may be useful to
// avoid overfitting.
//
// Satisfied by
// [FineTuningJobNewParamsHyperparametersLearningRateMultiplierString],
// [FineTuningJobNewParamsHyperparametersLearningRateMultiplierBehavior],
// [shared.UnionFloat].
type FineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion interface {
ImplementsFineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion()
}

type FineTuningJobNewParamsHyperparametersLearningRateMultiplierString string
type FineTuningJobNewParamsHyperparametersLearningRateMultiplierBehavior string

const (
FineTuningJobNewParamsHyperparametersLearningRateMultiplierStringAuto FineTuningJobNewParamsHyperparametersLearningRateMultiplierString = "auto"
FineTuningJobNewParamsHyperparametersLearningRateMultiplierBehaviorAuto FineTuningJobNewParamsHyperparametersLearningRateMultiplierBehavior = "auto"
)

func (r FineTuningJobNewParamsHyperparametersLearningRateMultiplierString) IsKnown() bool {
func (r FineTuningJobNewParamsHyperparametersLearningRateMultiplierBehavior) IsKnown() bool {
switch r {
case FineTuningJobNewParamsHyperparametersLearningRateMultiplierStringAuto:
case FineTuningJobNewParamsHyperparametersLearningRateMultiplierBehaviorAuto:
return true
}
return false
}

func (r FineTuningJobNewParamsHyperparametersLearningRateMultiplierString) ImplementsFineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion() {
func (r FineTuningJobNewParamsHyperparametersLearningRateMultiplierBehavior) ImplementsFineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion() {
}

// The number of epochs to train the model for. An epoch refers to one full cycle
// through the training dataset.
//
// Satisfied by [FineTuningJobNewParamsHyperparametersNEpochsString],
// Satisfied by [FineTuningJobNewParamsHyperparametersNEpochsBehavior],
// [shared.UnionInt].
type FineTuningJobNewParamsHyperparametersNEpochsUnion interface {
ImplementsFineTuningJobNewParamsHyperparametersNEpochsUnion()
}

type FineTuningJobNewParamsHyperparametersNEpochsString string
type FineTuningJobNewParamsHyperparametersNEpochsBehavior string

const (
FineTuningJobNewParamsHyperparametersNEpochsStringAuto FineTuningJobNewParamsHyperparametersNEpochsString = "auto"
FineTuningJobNewParamsHyperparametersNEpochsBehaviorAuto FineTuningJobNewParamsHyperparametersNEpochsBehavior = "auto"
)

func (r FineTuningJobNewParamsHyperparametersNEpochsString) IsKnown() bool {
func (r FineTuningJobNewParamsHyperparametersNEpochsBehavior) IsKnown() bool {
switch r {
case FineTuningJobNewParamsHyperparametersNEpochsStringAuto:
case FineTuningJobNewParamsHyperparametersNEpochsBehaviorAuto:
return true
}
return false
}

func (r FineTuningJobNewParamsHyperparametersNEpochsString) ImplementsFineTuningJobNewParamsHyperparametersNEpochsUnion() {
func (r FineTuningJobNewParamsHyperparametersNEpochsBehavior) ImplementsFineTuningJobNewParamsHyperparametersNEpochsUnion() {
}

type FineTuningJobNewParamsIntegration struct {
Expand Down
6 changes: 3 additions & 3 deletions finetuningjob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func TestFineTuningJobNewWithOptionalParams(t *testing.T) {
Model: openai.F(openai.FineTuningJobNewParamsModelBabbage002),
TrainingFile: openai.F("file-abc123"),
Hyperparameters: openai.F(openai.FineTuningJobNewParamsHyperparameters{
BatchSize: openai.F[openai.FineTuningJobNewParamsHyperparametersBatchSizeUnion](openai.FineTuningJobNewParamsHyperparametersBatchSizeString(openai.FineTuningJobNewParamsHyperparametersBatchSizeStringAuto)),
LearningRateMultiplier: openai.F[openai.FineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion](openai.FineTuningJobNewParamsHyperparametersLearningRateMultiplierString(openai.FineTuningJobNewParamsHyperparametersLearningRateMultiplierStringAuto)),
NEpochs: openai.F[openai.FineTuningJobNewParamsHyperparametersNEpochsUnion](openai.FineTuningJobNewParamsHyperparametersNEpochsString(openai.FineTuningJobNewParamsHyperparametersNEpochsStringAuto)),
BatchSize: openai.F[openai.FineTuningJobNewParamsHyperparametersBatchSizeUnion](openai.FineTuningJobNewParamsHyperparametersBatchSizeBehavior(openai.FineTuningJobNewParamsHyperparametersBatchSizeBehaviorAuto)),
LearningRateMultiplier: openai.F[openai.FineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion](openai.FineTuningJobNewParamsHyperparametersLearningRateMultiplierBehavior(openai.FineTuningJobNewParamsHyperparametersLearningRateMultiplierBehaviorAuto)),
NEpochs: openai.F[openai.FineTuningJobNewParamsHyperparametersNEpochsUnion](openai.FineTuningJobNewParamsHyperparametersNEpochsBehavior(openai.FineTuningJobNewParamsHyperparametersNEpochsBehaviorAuto)),
}),
Integrations: openai.F([]openai.FineTuningJobNewParamsIntegration{{
Type: openai.F(openai.FineTuningJobNewParamsIntegrationsTypeWandb),
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.29" // x-release-please-version
const PackageVersion = "0.1.0-alpha.30" // x-release-please-version
Loading