Skip to content

Commit b107e16

Browse files
feat: add multi content type
1 parent 1421a08 commit b107e16

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

chat.go

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,30 @@ type ChatMessageImageURL struct {
7979
Detail ImageURLDetail `json:"detail,omitempty"`
8080
}
8181

82+
type ChatMessageInputAudio struct {
83+
Data string `json:"data,omitempty"`
84+
Format string `json:"format,omitempty"`
85+
}
86+
87+
type ChatMessageVideoURL struct {
88+
URL string `json:"url,omitempty"`
89+
}
90+
8291
type ChatMessagePartType string
8392

8493
const (
85-
ChatMessagePartTypeText ChatMessagePartType = "text"
86-
ChatMessagePartTypeImageURL ChatMessagePartType = "image_url"
94+
ChatMessagePartTypeText ChatMessagePartType = "text"
95+
ChatMessagePartTypeImageURL ChatMessagePartType = "image_url"
96+
ChatMessagePartTypeInputAudio ChatMessagePartType = "input_audio"
97+
ChatMessagePartTypeVideoURL ChatMessagePartType = "video_url"
8798
)
8899

89100
type ChatMessagePart struct {
90-
Type ChatMessagePartType `json:"type,omitempty"`
91-
Text string `json:"text,omitempty"`
92-
ImageURL *ChatMessageImageURL `json:"image_url,omitempty"`
101+
Type ChatMessagePartType `json:"type,omitempty"`
102+
Text string `json:"text,omitempty"`
103+
ImageURL *ChatMessageImageURL `json:"image_url,omitempty"`
104+
InputAudio *ChatMessageInputAudio `json:"input_audio,omitempty"`
105+
VideoURL *ChatMessageVideoURL `json:"video_url,omitempty"`
93106
}
94107

95108
type ChatCompletionMessage struct {

0 commit comments

Comments
 (0)