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
34 changes: 17 additions & 17 deletions betaassistant.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,22 +335,22 @@ 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 {
// Whether to enable input audio transcription.
Enabled bool `json:"enabled"`
Event AssistantStreamEventEvent `json:"event,required"`
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"`
JSON assistantStreamEventJSON `json:"-"`
union AssistantStreamEventUnion
Data interface{} `json:"data"`
// Whether to enable input audio transcription.
Enabled bool `json:"enabled"`
JSON assistantStreamEventJSON `json:"-"`
union AssistantStreamEventUnion
}

// assistantStreamEventJSON contains the JSON metadata for the struct
// [AssistantStreamEvent]
type assistantStreamEventJSON struct {
Enabled apijson.Field
Event apijson.Field
Data apijson.Field
Enabled apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down Expand Up @@ -1651,19 +1651,19 @@ func (r AssistantStreamEventEvent) IsKnown() bool {
}

type AssistantTool struct {
// The type of tool being defined: `code_interpreter`
Type AssistantToolType `json:"type,required"`
// This field can have the runtime type of [FileSearchToolFileSearch].
FileSearch interface{} `json:"file_search,required"`
Function shared.FunctionDefinition `json:"function"`
JSON assistantToolJSON `json:"-"`
union AssistantToolUnion
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
}

// assistantToolJSON contains the JSON metadata for the struct [AssistantTool]
type assistantToolJSON struct {
Type apijson.Field
FileSearch apijson.Field
Type apijson.Field
Function apijson.Field
raw string
ExtraFields map[string]apijson.Field
Expand Down Expand Up @@ -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"`
FileSearch param.Field[interface{}] `json:"file_search,required"`
Function param.Field[shared.FunctionDefinitionParam] `json:"function"`
Type param.Field[AssistantToolType] `json:"type,required"`
Function param.Field[shared.FunctionDefinitionParam] `json:"function"`
}

func (r AssistantToolParam) MarshalJSON() (data []byte, err error) {
Expand Down
6 changes: 3 additions & 3 deletions betathread.go
Original file line number Diff line number Diff line change
Expand Up @@ -998,10 +998,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"`
FileSearch param.Field[interface{}] `json:"file_search,required"`
Function param.Field[shared.FunctionDefinitionParam] `json:"function"`
Type param.Field[BetaThreadNewAndRunParamsToolsType] `json:"type,required"`
Function param.Field[shared.FunctionDefinitionParam] `json:"function"`
}

func (r BetaThreadNewAndRunParamsTool) MarshalJSON() (data []byte, err error) {
Expand Down
68 changes: 34 additions & 34 deletions betathreadmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
// Always `file_citation`.
Type AnnotationType `json:"type,required"`
// The text in the message content that needs to be replaced.
Text string `json:"text,required"`
EndIndex int64 `json:"end_index,required"`
// This field can have the runtime type of [FileCitationAnnotationFileCitation].
FileCitation interface{} `json:"file_citation,required"`
StartIndex int64 `json:"start_index,required"`
EndIndex int64 `json:"end_index,required"`
// This field can have the runtime type of [FilePathAnnotationFilePath].
FilePath interface{} `json:"file_path,required"`
JSON annotationJSON `json:"-"`
union AnnotationUnion
FilePath interface{} `json:"file_path,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
}

// annotationJSON contains the JSON metadata for the struct [Annotation]
type annotationJSON struct {
Type apijson.Field
Text apijson.Field
FileCitation apijson.Field
StartIndex apijson.Field
EndIndex apijson.Field
FileCitation apijson.Field
FilePath apijson.Field
StartIndex apijson.Field
Text apijson.Field
Type apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down Expand Up @@ -227,32 +227,32 @@ 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 {
// The index of the annotation in the text content part.
Index int64 `json:"index,required"`
// Always `file_citation`.
Type AnnotationDeltaType `json:"type,required"`
// The text in the message content that needs to be replaced.
Text string `json:"text"`
// This field can have the runtime type of
// [FileCitationDeltaAnnotationFileCitation].
FileCitation interface{} `json:"file_citation,required"`
StartIndex int64 `json:"start_index"`
EndIndex int64 `json:"end_index"`
// This field can have the runtime type of [FilePathDeltaAnnotationFilePath].
FilePath interface{} `json:"file_path,required"`
JSON annotationDeltaJSON `json:"-"`
union AnnotationDeltaUnion
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"`
// The text in the message content that needs to be replaced.
Text string `json:"text"`
JSON annotationDeltaJSON `json:"-"`
union AnnotationDeltaUnion
}

// annotationDeltaJSON contains the JSON metadata for the struct [AnnotationDelta]
type annotationDeltaJSON struct {
FileCitation apijson.Field
FilePath apijson.Field
Index apijson.Field
Type apijson.Field
Text apijson.Field
FileCitation apijson.Field
StartIndex apijson.Field
EndIndex apijson.Field
FilePath apijson.Field
StartIndex apijson.Field
Text apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down Expand Up @@ -1336,8 +1336,8 @@ type MessageContent struct {
Type MessageContentType `json:"type,required"`
ImageFile ImageFile `json:"image_file"`
ImageURL ImageURL `json:"image_url"`
Text Text `json:"text"`
Refusal string `json:"refusal"`
Text Text `json:"text"`
JSON messageContentJSON `json:"-"`
union MessageContentUnion
}
Expand All @@ -1347,8 +1347,8 @@ type messageContentJSON struct {
Type apijson.Field
ImageFile apijson.Field
ImageURL apijson.Field
Text apijson.Field
Refusal apijson.Field
Text apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down Expand Up @@ -1437,9 +1437,9 @@ type MessageContentDelta struct {
// Always `image_file`.
Type MessageContentDeltaType `json:"type,required"`
ImageFile ImageFileDelta `json:"image_file"`
Text TextDelta `json:"text"`
Refusal string `json:"refusal"`
ImageURL ImageURLDelta `json:"image_url"`
Refusal string `json:"refusal"`
Text TextDelta `json:"text"`
JSON messageContentDeltaJSON `json:"-"`
union MessageContentDeltaUnion
}
Expand All @@ -1450,9 +1450,9 @@ type messageContentDeltaJSON struct {
Index apijson.Field
Type apijson.Field
ImageFile apijson.Field
Text apijson.Field
Refusal apijson.Field
ImageURL apijson.Field
Refusal apijson.Field
Text apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down
Loading