diff --git a/betaassistant.go b/betaassistant.go index 99272e9..4b2aee7 100644 --- a/betaassistant.go +++ b/betaassistant.go @@ -335,10 +335,10 @@ func (r AssistantDeletedObject) IsKnown() bool { // [Assistants API quickstart](https://platform.openai.com/docs/assistants/overview) // to learn how to integrate the Assistants API with streaming. type AssistantStreamEvent struct { - Event AssistantStreamEventEvent `json:"event,required"` // This field can have the runtime type of [Thread], [Run], [RunStep], // [RunStepDeltaEvent], [Message], [MessageDeltaEvent], [shared.ErrorObject]. - Data interface{} `json:"data"` + Data interface{} `json:"data,required"` + Event AssistantStreamEventEvent `json:"event,required"` // Whether to enable input audio transcription. Enabled bool `json:"enabled"` JSON assistantStreamEventJSON `json:"-"` @@ -348,8 +348,8 @@ type AssistantStreamEvent struct { // assistantStreamEventJSON contains the JSON metadata for the struct // [AssistantStreamEvent] type assistantStreamEventJSON struct { - Event apijson.Field Data apijson.Field + Event apijson.Field Enabled apijson.Field raw string ExtraFields map[string]apijson.Field @@ -1651,19 +1651,19 @@ func (r AssistantStreamEventEvent) IsKnown() bool { } type AssistantTool struct { - // This field can have the runtime type of [FileSearchToolFileSearch]. - FileSearch interface{} `json:"file_search,required"` // The type of tool being defined: `code_interpreter` - Type AssistantToolType `json:"type,required"` - Function shared.FunctionDefinition `json:"function"` - JSON assistantToolJSON `json:"-"` - union AssistantToolUnion + Type AssistantToolType `json:"type,required"` + // This field can have the runtime type of [FileSearchToolFileSearch]. + FileSearch interface{} `json:"file_search"` + Function shared.FunctionDefinition `json:"function"` + JSON assistantToolJSON `json:"-"` + union AssistantToolUnion } // assistantToolJSON contains the JSON metadata for the struct [AssistantTool] type assistantToolJSON struct { - FileSearch apijson.Field Type apijson.Field + FileSearch apijson.Field Function apijson.Field raw string ExtraFields map[string]apijson.Field @@ -1736,10 +1736,10 @@ func (r AssistantToolType) IsKnown() bool { } type AssistantToolParam struct { - FileSearch param.Field[interface{}] `json:"file_search,required"` // The type of tool being defined: `code_interpreter` - Type param.Field[AssistantToolType] `json:"type,required"` - Function param.Field[shared.FunctionDefinitionParam] `json:"function"` + Type param.Field[AssistantToolType] `json:"type,required"` + FileSearch param.Field[interface{}] `json:"file_search"` + Function param.Field[shared.FunctionDefinitionParam] `json:"function"` } func (r AssistantToolParam) MarshalJSON() (data []byte, err error) { diff --git a/betathread.go b/betathread.go index 34cfb0b..c68dd9c 100644 --- a/betathread.go +++ b/betathread.go @@ -1007,10 +1007,10 @@ func (r BetaThreadNewAndRunParamsToolResourcesFileSearch) MarshalJSON() (data [] } type BetaThreadNewAndRunParamsTool struct { - FileSearch param.Field[interface{}] `json:"file_search,required"` // The type of tool being defined: `code_interpreter` - Type param.Field[BetaThreadNewAndRunParamsToolsType] `json:"type,required"` - Function param.Field[shared.FunctionDefinitionParam] `json:"function"` + Type param.Field[BetaThreadNewAndRunParamsToolsType] `json:"type,required"` + FileSearch param.Field[interface{}] `json:"file_search"` + Function param.Field[shared.FunctionDefinitionParam] `json:"function"` } func (r BetaThreadNewAndRunParamsTool) MarshalJSON() (data []byte, err error) { diff --git a/betathreadmessage.go b/betathreadmessage.go index 27f2e0a..6f8f4e9 100644 --- a/betathreadmessage.go +++ b/betathreadmessage.go @@ -133,28 +133,28 @@ func (r *BetaThreadMessageService) Delete(ctx context.Context, threadID string, // File associated with the assistant or the message. Generated when the assistant // uses the "file_search" tool to search files. type Annotation struct { - EndIndex int64 `json:"end_index,required"` - // This field can have the runtime type of [FileCitationAnnotationFileCitation]. - FileCitation interface{} `json:"file_citation,required"` - // This field can have the runtime type of [FilePathAnnotationFilePath]. - FilePath interface{} `json:"file_path,required"` - StartIndex int64 `json:"start_index,required"` + EndIndex int64 `json:"end_index,required"` + StartIndex int64 `json:"start_index,required"` // The text in the message content that needs to be replaced. Text string `json:"text,required"` // Always `file_citation`. - Type AnnotationType `json:"type,required"` - JSON annotationJSON `json:"-"` - union AnnotationUnion + Type AnnotationType `json:"type,required"` + // This field can have the runtime type of [FileCitationAnnotationFileCitation]. + FileCitation interface{} `json:"file_citation"` + // This field can have the runtime type of [FilePathAnnotationFilePath]. + FilePath interface{} `json:"file_path"` + JSON annotationJSON `json:"-"` + union AnnotationUnion } // annotationJSON contains the JSON metadata for the struct [Annotation] type annotationJSON struct { EndIndex apijson.Field - FileCitation apijson.Field - FilePath apijson.Field StartIndex apijson.Field Text apijson.Field Type apijson.Field + FileCitation apijson.Field + FilePath apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -227,17 +227,17 @@ func (r AnnotationType) IsKnown() bool { // File associated with the assistant or the message. Generated when the assistant // uses the "file_search" tool to search files. type AnnotationDelta struct { - // This field can have the runtime type of - // [FileCitationDeltaAnnotationFileCitation]. - FileCitation interface{} `json:"file_citation,required"` - // This field can have the runtime type of [FilePathDeltaAnnotationFilePath]. - FilePath interface{} `json:"file_path,required"` // The index of the annotation in the text content part. Index int64 `json:"index,required"` // Always `file_citation`. - Type AnnotationDeltaType `json:"type,required"` - EndIndex int64 `json:"end_index"` - StartIndex int64 `json:"start_index"` + Type AnnotationDeltaType `json:"type,required"` + EndIndex int64 `json:"end_index"` + // This field can have the runtime type of + // [FileCitationDeltaAnnotationFileCitation]. + FileCitation interface{} `json:"file_citation"` + // This field can have the runtime type of [FilePathDeltaAnnotationFilePath]. + FilePath interface{} `json:"file_path"` + StartIndex int64 `json:"start_index"` // The text in the message content that needs to be replaced. Text string `json:"text"` JSON annotationDeltaJSON `json:"-"` @@ -246,11 +246,11 @@ type AnnotationDelta struct { // annotationDeltaJSON contains the JSON metadata for the struct [AnnotationDelta] type annotationDeltaJSON struct { - FileCitation apijson.Field - FilePath apijson.Field Index apijson.Field Type apijson.Field EndIndex apijson.Field + FileCitation apijson.Field + FilePath apijson.Field StartIndex apijson.Field Text apijson.Field raw string diff --git a/betathreadrunstep.go b/betathreadrunstep.go index 9fbf03c..efa3dc7 100644 --- a/betathreadrunstep.go +++ b/betathreadrunstep.go @@ -265,11 +265,11 @@ func (r codeInterpreterToolCallCodeInterpreterJSON) RawJSON() string { // Text output from the Code Interpreter tool call as part of a run step. type CodeInterpreterToolCallCodeInterpreterOutput struct { - // This field can have the runtime type of - // [CodeInterpreterToolCallCodeInterpreterOutputsImageImage]. - Image interface{} `json:"image,required"` // Always `logs`. Type CodeInterpreterToolCallCodeInterpreterOutputsType `json:"type,required"` + // This field can have the runtime type of + // [CodeInterpreterToolCallCodeInterpreterOutputsImageImage]. + Image interface{} `json:"image"` // The text output from the Code Interpreter tool call. Logs string `json:"logs"` JSON codeInterpreterToolCallCodeInterpreterOutputJSON `json:"-"` @@ -279,8 +279,8 @@ type CodeInterpreterToolCallCodeInterpreterOutput struct { // codeInterpreterToolCallCodeInterpreterOutputJSON contains the JSON metadata for // the struct [CodeInterpreterToolCallCodeInterpreterOutput] type codeInterpreterToolCallCodeInterpreterOutputJSON struct { - Image apijson.Field Type apijson.Field + Image apijson.Field Logs apijson.Field raw string ExtraFields map[string]apijson.Field @@ -557,12 +557,12 @@ func (r codeInterpreterToolCallDeltaCodeInterpreterJSON) RawJSON() string { // Text output from the Code Interpreter tool call as part of a run step. type CodeInterpreterToolCallDeltaCodeInterpreterOutput struct { - // This field can have the runtime type of [CodeInterpreterOutputImageImage]. - Image interface{} `json:"image,required"` // The index of the output in the outputs array. Index int64 `json:"index,required"` // Always `logs`. Type CodeInterpreterToolCallDeltaCodeInterpreterOutputsType `json:"type,required"` + // This field can have the runtime type of [CodeInterpreterOutputImageImage]. + Image interface{} `json:"image"` // The text output from the Code Interpreter tool call. Logs string `json:"logs"` JSON codeInterpreterToolCallDeltaCodeInterpreterOutputJSON `json:"-"` @@ -572,9 +572,9 @@ type CodeInterpreterToolCallDeltaCodeInterpreterOutput struct { // codeInterpreterToolCallDeltaCodeInterpreterOutputJSON contains the JSON metadata // for the struct [CodeInterpreterToolCallDeltaCodeInterpreterOutput] type codeInterpreterToolCallDeltaCodeInterpreterOutputJSON struct { - Image apijson.Field Index apijson.Field Type apijson.Field + Image apijson.Field Logs apijson.Field raw string ExtraFields map[string]apijson.Field @@ -1262,23 +1262,23 @@ func (r RunStepStatus) IsKnown() bool { // The details of the run step. type RunStepStepDetails struct { + // Always `message_creation`. + Type RunStepStepDetailsType `json:"type,required"` // This field can have the runtime type of // [MessageCreationStepDetailsMessageCreation]. - MessageCreation interface{} `json:"message_creation,required"` + MessageCreation interface{} `json:"message_creation"` // This field can have the runtime type of [[]ToolCall]. - ToolCalls interface{} `json:"tool_calls,required"` - // Always `message_creation`. - Type RunStepStepDetailsType `json:"type,required"` - JSON runStepStepDetailsJSON `json:"-"` - union RunStepStepDetailsUnion + ToolCalls interface{} `json:"tool_calls"` + JSON runStepStepDetailsJSON `json:"-"` + union RunStepStepDetailsUnion } // runStepStepDetailsJSON contains the JSON metadata for the struct // [RunStepStepDetails] type runStepStepDetailsJSON struct { + Type apijson.Field MessageCreation apijson.Field ToolCalls apijson.Field - Type apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -1414,23 +1414,23 @@ func (r runStepDeltaJSON) RawJSON() string { // The details of the run step. type RunStepDeltaStepDetails struct { + // Always `message_creation`. + Type RunStepDeltaStepDetailsType `json:"type,required"` // This field can have the runtime type of // [RunStepDeltaMessageDeltaMessageCreation]. - MessageCreation interface{} `json:"message_creation,required"` + MessageCreation interface{} `json:"message_creation"` // This field can have the runtime type of [[]ToolCallDelta]. - ToolCalls interface{} `json:"tool_calls,required"` - // Always `message_creation`. - Type RunStepDeltaStepDetailsType `json:"type,required"` - JSON runStepDeltaStepDetailsJSON `json:"-"` - union RunStepDeltaStepDetailsUnion + ToolCalls interface{} `json:"tool_calls"` + JSON runStepDeltaStepDetailsJSON `json:"-"` + union RunStepDeltaStepDetailsUnion } // runStepDeltaStepDetailsJSON contains the JSON metadata for the struct // [RunStepDeltaStepDetails] type runStepDeltaStepDetailsJSON struct { + Type apijson.Field MessageCreation apijson.Field ToolCalls apijson.Field - Type apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -1624,27 +1624,27 @@ func (r RunStepInclude) IsKnown() bool { type ToolCall struct { // The ID of the tool call. ID string `json:"id,required"` + // The type of tool call. This is always going to be `code_interpreter` for this + // type of tool call. + Type ToolCallType `json:"type,required"` // This field can have the runtime type of // [CodeInterpreterToolCallCodeInterpreter]. - CodeInterpreter interface{} `json:"code_interpreter,required"` + CodeInterpreter interface{} `json:"code_interpreter"` // This field can have the runtime type of [FileSearchToolCallFileSearch]. - FileSearch interface{} `json:"file_search,required"` + FileSearch interface{} `json:"file_search"` // This field can have the runtime type of [FunctionToolCallFunction]. - Function interface{} `json:"function,required"` - // The type of tool call. This is always going to be `code_interpreter` for this - // type of tool call. - Type ToolCallType `json:"type,required"` - JSON toolCallJSON `json:"-"` - union ToolCallUnion + Function interface{} `json:"function"` + JSON toolCallJSON `json:"-"` + union ToolCallUnion } // toolCallJSON contains the JSON metadata for the struct [ToolCall] type toolCallJSON struct { ID apijson.Field + Type apijson.Field CodeInterpreter apijson.Field FileSearch apijson.Field Function apijson.Field - Type apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -1721,32 +1721,32 @@ func (r ToolCallType) IsKnown() bool { // Details of the Code Interpreter tool call the run step was involved in. type ToolCallDelta struct { - // This field can have the runtime type of - // [CodeInterpreterToolCallDeltaCodeInterpreter]. - CodeInterpreter interface{} `json:"code_interpreter,required"` - // This field can have the runtime type of [interface{}]. - FileSearch interface{} `json:"file_search,required"` - // This field can have the runtime type of [FunctionToolCallDeltaFunction]. - Function interface{} `json:"function,required"` // The index of the tool call in the tool calls array. Index int64 `json:"index,required"` // The type of tool call. This is always going to be `code_interpreter` for this // type of tool call. Type ToolCallDeltaType `json:"type,required"` // The ID of the tool call. - ID string `json:"id"` - JSON toolCallDeltaJSON `json:"-"` - union ToolCallDeltaUnion + ID string `json:"id"` + // This field can have the runtime type of + // [CodeInterpreterToolCallDeltaCodeInterpreter]. + CodeInterpreter interface{} `json:"code_interpreter"` + // This field can have the runtime type of [interface{}]. + FileSearch interface{} `json:"file_search"` + // This field can have the runtime type of [FunctionToolCallDeltaFunction]. + Function interface{} `json:"function"` + JSON toolCallDeltaJSON `json:"-"` + union ToolCallDeltaUnion } // toolCallDeltaJSON contains the JSON metadata for the struct [ToolCallDelta] type toolCallDeltaJSON struct { - CodeInterpreter apijson.Field - FileSearch apijson.Field - Function apijson.Field Index apijson.Field Type apijson.Field ID apijson.Field + CodeInterpreter apijson.Field + FileSearch apijson.Field + Function apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/chatcompletion.go b/chatcompletion.go index 7666fae..f2dbbc5 100644 --- a/chatcompletion.go +++ b/chatcompletion.go @@ -836,10 +836,10 @@ func (r ChatCompletionChunkServiceTier) IsKnown() bool { // Learn about // [text inputs](https://platform.openai.com/docs/guides/text-generation). type ChatCompletionContentPartParam struct { - ImageURL param.Field[interface{}] `json:"image_url,required"` - InputAudio param.Field[interface{}] `json:"input_audio,required"` // The type of the content part. - Type param.Field[ChatCompletionContentPartType] `json:"type,required"` + Type param.Field[ChatCompletionContentPartType] `json:"type,required"` + ImageURL param.Field[interface{}] `json:"image_url"` + InputAudio param.Field[interface{}] `json:"input_audio"` // The text content. Text param.Field[string] `json:"text"` } @@ -1207,19 +1207,19 @@ func (r chatCompletionMessageFunctionCallJSON) RawJSON() string { } type ChatCompletionMessageParam struct { - Audio param.Field[interface{}] `json:"audio,required"` - Content param.Field[interface{}] `json:"content,required"` - FunctionCall param.Field[interface{}] `json:"function_call,required"` // The role of the messages author, in this case `system`. - Role param.Field[ChatCompletionMessageParamRole] `json:"role,required"` - ToolCalls param.Field[interface{}] `json:"tool_calls,required"` + Role param.Field[ChatCompletionMessageParamRole] `json:"role,required"` + Audio param.Field[interface{}] `json:"audio"` + Content param.Field[interface{}] `json:"content"` + FunctionCall param.Field[interface{}] `json:"function_call"` // An optional name for the participant. Provides the model information to // differentiate between participants of the same role. Name param.Field[string] `json:"name"` // The refusal message by the assistant. Refusal param.Field[string] `json:"refusal"` // Tool call that this message is responding to. - ToolCallID param.Field[string] `json:"tool_call_id"` + ToolCallID param.Field[string] `json:"tool_call_id"` + ToolCalls param.Field[interface{}] `json:"tool_calls"` } func (r ChatCompletionMessageParam) MarshalJSON() (data []byte, err error) { @@ -1946,9 +1946,9 @@ func (r ChatCompletionNewParamsFunction) MarshalJSON() (data []byte, err error) // indicates the generation exceeded `max_tokens` or the conversation exceeded the // max context length. type ChatCompletionNewParamsResponseFormat struct { - JSONSchema param.Field[interface{}] `json:"json_schema,required"` // The type of response format being defined: `text` - Type param.Field[ChatCompletionNewParamsResponseFormatType] `json:"type,required"` + Type param.Field[ChatCompletionNewParamsResponseFormatType] `json:"type,required"` + JSONSchema param.Field[interface{}] `json:"json_schema"` } func (r ChatCompletionNewParamsResponseFormat) MarshalJSON() (data []byte, err error) { diff --git a/moderation.go b/moderation.go index 56c6e1b..f60670c 100644 --- a/moderation.go +++ b/moderation.go @@ -502,9 +502,9 @@ const ( // An object describing an image to classify. type ModerationMultiModalInputParam struct { - ImageURL param.Field[interface{}] `json:"image_url,required"` // Always `image_url`. - Type param.Field[ModerationMultiModalInputType] `json:"type,required"` + Type param.Field[ModerationMultiModalInputType] `json:"type,required"` + ImageURL param.Field[interface{}] `json:"image_url"` // A string of text to classify. Text param.Field[string] `json:"text"` }