Skip to content

Commit

Permalink
add attachments in MessageRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
kodernubie committed Nov 3, 2024
1 parent d10f1b8 commit 8e1a70c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 5 additions & 4 deletions messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ type ImageFile struct {
}

type MessageRequest struct {
Role string `json:"role"`
Content string `json:"content"`
FileIds []string `json:"file_ids,omitempty"` //nolint:revive // backwards-compatibility
Metadata map[string]any `json:"metadata,omitempty"`
Role string `json:"role"`
Content string `json:"content"`
FileIds []string `json:"file_ids,omitempty"` //nolint:revive // backwards-compatibility
Metadata map[string]any `json:"metadata,omitempty"`
Attachments []ThreadAttachment `json:"attachments,omitempty"`
}

type MessageFile struct {
Expand Down
6 changes: 6 additions & 0 deletions thread.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ const (
threadsSuffix = "/threads"
)

const (
ThreadAttachmentToolCodeInterpreter = "code_interpreter"
ThreadAttachmentToolFunction = "function"
ThreadAttachmentToolFileSearch = "file_search"
)

type Thread struct {
ID string `json:"id"`
Object string `json:"object"`
Expand Down

0 comments on commit 8e1a70c

Please sign in to comment.