fix: Updated ThreadMessage struct with latest fields based on OpenAI docs (#792)
* fix: Updated ThreadMessage struct with latest fields based on OpenAI docs * fix: Reverted FileIDs for backward compatibility of v1
This commit is contained in:
21
thread.go
21
thread.go
@@ -83,14 +83,25 @@ type ModifyThreadRequest struct {
|
|||||||
type ThreadMessageRole string
|
type ThreadMessageRole string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ThreadMessageRoleUser ThreadMessageRole = "user"
|
ThreadMessageRoleAssistant ThreadMessageRole = "assistant"
|
||||||
|
ThreadMessageRoleUser ThreadMessageRole = "user"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ThreadMessage struct {
|
type ThreadMessage struct {
|
||||||
Role ThreadMessageRole `json:"role"`
|
Role ThreadMessageRole `json:"role"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
FileIDs []string `json:"file_ids,omitempty"`
|
FileIDs []string `json:"file_ids,omitempty"`
|
||||||
Metadata map[string]any `json:"metadata,omitempty"`
|
Attachments []ThreadAttachment `json:"attachments,omitempty"`
|
||||||
|
Metadata map[string]any `json:"metadata,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ThreadAttachment struct {
|
||||||
|
FileID string `json:"file_id"`
|
||||||
|
Tools []ThreadAttachmentTool `json:"tools"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ThreadAttachmentTool struct {
|
||||||
|
Type string `json:"type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ThreadDeleteResponse struct {
|
type ThreadDeleteResponse struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user