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:
11
thread.go
11
thread.go
@@ -83,6 +83,7 @@ type ModifyThreadRequest struct {
|
||||
type ThreadMessageRole string
|
||||
|
||||
const (
|
||||
ThreadMessageRoleAssistant ThreadMessageRole = "assistant"
|
||||
ThreadMessageRoleUser ThreadMessageRole = "user"
|
||||
)
|
||||
|
||||
@@ -90,9 +91,19 @@ type ThreadMessage struct {
|
||||
Role ThreadMessageRole `json:"role"`
|
||||
Content string `json:"content"`
|
||||
FileIDs []string `json:"file_ids,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 {
|
||||
ID string `json:"id"`
|
||||
Object string `json:"object"`
|
||||
|
||||
Reference in New Issue
Block a user