Skip to content

Commit

Permalink
feat: support deprecated markers (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 22, 2025
1 parent 3aedec5 commit 2c21e34
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions chatcompletion.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ type ChatCompletionAssistantMessageParam struct {
Content param.Field[[]ChatCompletionAssistantMessageParamContentUnion] `json:"content"`
// Deprecated and replaced by `tool_calls`. The name and arguments of a function
// that should be called, as generated by the model.
//
// Deprecated: deprecated
FunctionCall param.Field[ChatCompletionAssistantMessageParamFunctionCall] `json:"function_call"`
// An optional name for the participant. Provides the model information to
// differentiate between participants of the same role.
Expand Down Expand Up @@ -410,6 +412,8 @@ func (r ChatCompletionAssistantMessageParamContentType) IsKnown() bool {

// Deprecated and replaced by `tool_calls`. The name and arguments of a function
// that should be called, as generated by the model.
//
// Deprecated: deprecated
type ChatCompletionAssistantMessageParamFunctionCall struct {
// The arguments to call the function with, as generated by the model in JSON
// format. Note that the model does not always generate valid JSON, and may
Expand Down Expand Up @@ -617,6 +621,8 @@ type ChatCompletionChunkChoicesDelta struct {
Content string `json:"content,nullable"`
// Deprecated and replaced by `tool_calls`. The name and arguments of a function
// that should be called, as generated by the model.
//
// Deprecated: deprecated
FunctionCall ChatCompletionChunkChoicesDeltaFunctionCall `json:"function_call"`
// The refusal message generated by the model.
Refusal string `json:"refusal,nullable"`
Expand Down Expand Up @@ -648,6 +654,8 @@ func (r chatCompletionChunkChoicesDeltaJSON) RawJSON() string {

// Deprecated and replaced by `tool_calls`. The name and arguments of a function
// that should be called, as generated by the model.
//
// Deprecated: deprecated
type ChatCompletionChunkChoicesDeltaFunctionCall struct {
// The arguments to call the function with, as generated by the model in JSON
// format. Note that the model does not always generate valid JSON, and may
Expand Down Expand Up @@ -1114,6 +1122,7 @@ func (r ChatCompletionFunctionCallOptionParam) MarshalJSON() (data []byte, err e

func (r ChatCompletionFunctionCallOptionParam) implementsChatCompletionNewParamsFunctionCallUnion() {}

// Deprecated: deprecated
type ChatCompletionFunctionMessageParam struct {
// The contents of the function message.
Content param.Field[string] `json:"content,required"`
Expand Down Expand Up @@ -1158,6 +1167,8 @@ type ChatCompletionMessage struct {
Audio ChatCompletionAudio `json:"audio,nullable"`
// Deprecated and replaced by `tool_calls`. The name and arguments of a function
// that should be called, as generated by the model.
//
// Deprecated: deprecated
FunctionCall ChatCompletionMessageFunctionCall `json:"function_call"`
// The tool calls generated by the model, such as function calls.
ToolCalls []ChatCompletionMessageToolCall `json:"tool_calls"`
Expand Down Expand Up @@ -1227,6 +1238,8 @@ func (r ChatCompletionMessageRole) IsKnown() bool {

// Deprecated and replaced by `tool_calls`. The name and arguments of a function
// that should be called, as generated by the model.
//
// Deprecated: deprecated
type ChatCompletionMessageFunctionCall struct {
// The arguments to call the function with, as generated by the model in JSON
// format. Note that the model does not always generate valid JSON, and may
Expand Down Expand Up @@ -1968,6 +1981,8 @@ func (r ChatCompletionNewParams) MarshalJSON() (data []byte, err error) {
//
// Satisfied by [ChatCompletionNewParamsFunctionCallBehavior],
// [ChatCompletionFunctionCallOptionParam].
//
// Deprecated: deprecated
type ChatCompletionNewParamsFunctionCallUnion interface {
implementsChatCompletionNewParamsFunctionCallUnion()
}
Expand All @@ -1993,6 +2008,7 @@ func (r ChatCompletionNewParamsFunctionCallBehavior) IsKnown() bool {
func (r ChatCompletionNewParamsFunctionCallBehavior) implementsChatCompletionNewParamsFunctionCallUnion() {
}

// Deprecated: deprecated
type ChatCompletionNewParamsFunction struct {
// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain
// underscores and dashes, with a maximum length of 64.
Expand Down
4 changes: 4 additions & 0 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,13 @@ type FileObject struct {
Purpose FileObjectPurpose `json:"purpose,required"`
// Deprecated. The current status of the file, which can be either `uploaded`,
// `processed`, or `error`.
//
// Deprecated: deprecated
Status FileObjectStatus `json:"status,required"`
// Deprecated. For details on why a fine-tuning training file failed validation,
// see the `error` field on `fine_tuning.job`.
//
// Deprecated: deprecated
StatusDetails string `json:"status_details"`
JSON fileObjectJSON `json:"-"`
}
Expand Down
2 changes: 2 additions & 0 deletions finetuningjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,8 @@ func (r FineTuningJobNewParamsModel) IsKnown() bool {

// The hyperparameters used for the fine-tuning job. This value is now deprecated
// in favor of `method`, and should be passed in under the `method` parameter.
//
// Deprecated: deprecated
type FineTuningJobNewParamsHyperparameters struct {
// Number of examples in each batch. A larger batch size means that model
// parameters are updated less frequently, but with lower variance.
Expand Down

0 comments on commit 2c21e34

Please sign in to comment.