Skip to content

Commit abb8d55

Browse files
committed
add file input support
1 parent c4273cb commit abb8d55

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

chat.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,25 @@ type ChatMessageImageURL struct {
8181
Detail ImageURLDetail `json:"detail,omitempty"`
8282
}
8383

84+
type ChatMessageFile struct {
85+
FileID string `json:"file_id,omitempty"`
86+
FileName string `json:"file_name,omitempty"`
87+
FileData string `json:"file_data,omitempty"`
88+
}
89+
8490
type ChatMessagePartType string
8591

8692
const (
8793
ChatMessagePartTypeText ChatMessagePartType = "text"
8894
ChatMessagePartTypeImageURL ChatMessagePartType = "image_url"
95+
ChatMessagePartTypeFile ChatMessagePartType = "file"
8996
)
9097

9198
type ChatMessagePart struct {
9299
Type ChatMessagePartType `json:"type,omitempty"`
93100
Text string `json:"text,omitempty"`
94101
ImageURL *ChatMessageImageURL `json:"image_url,omitempty"`
102+
File *ChatMessageFile `json:"file,omitempty"`
95103
}
96104

97105
type ChatCompletionMessage struct {

0 commit comments

Comments
 (0)