File tree Expand file tree Collapse file tree 4 files changed +25
-4
lines changed
openai-core/src/commonMain/kotlin/com.aallam.openai.api/message Expand file tree Collapse file tree 4 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
- ** Audio** : add ` timestampGranularities ` (thanks @mxwell )
6
6
7
+ ### Fixed
8
+
9
+ - ** Messages** : nullable field ` MessageContent.Image#fileId ` (#313 )
10
+
7
11
## 3.7.0
8
12
9
13
### Added
Original file line number Diff line number Diff line change
1
+ package com.aallam.openai.api.message
2
+
3
+ import com.aallam.openai.api.file.FileId
4
+ import kotlinx.serialization.SerialName
5
+ import kotlinx.serialization.Serializable
6
+
7
+ /* *
8
+ * References an image File in the content of a message.
9
+ */
10
+ @Serializable
11
+ public data class ImageFile (
12
+ /* *
13
+ * The File ID of the image in the message content.
14
+ */
15
+ @SerialName(" file_id" ) val fileId : FileId
16
+ )
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public sealed interface MessageContent {
35
35
/* *
36
36
* The File ID of the image in the message content.
37
37
*/
38
- @SerialName(" file_id " ) val fileId : FileId
38
+ @SerialName(" image_file " ) val imageFile : ImageFile
39
39
) : MessageContent
40
40
41
41
}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.aallam.openai.api.message
2
2
3
3
import com.aallam.openai.api.BetaOpenAI
4
4
import com.aallam.openai.api.file.FileId
5
+ import kotlinx.serialization.SerialName
5
6
import kotlinx.serialization.Serializable
6
7
7
8
/* *
@@ -13,13 +14,13 @@ public data class MessageFile(
13
14
/* *
14
15
* The identifier, which can be referenced in API endpoints.
15
16
*/
16
- val id : FileId ,
17
+ @SerialName( " id " ) val id : FileId ,
17
18
/* *
18
19
* The Unix timestamp (in seconds) for when the message file was created.
19
20
*/
20
- val createdAt : Int? = null ,
21
+ @SerialName( " created_at " ) val createdAt : Int? = null ,
21
22
/* *
22
23
* The ID of the message that the File is attached to.
23
24
*/
24
- val messageId : MessageId ? = null ,
25
+ @SerialName( " message_id " ) val messageId : MessageId ? = null ,
25
26
)
You can’t perform that action at this time.
0 commit comments