Skip to content

Commit

Permalink
fix: Updated ThreadMessage struct with latest fields based on OpenAI …
Browse files Browse the repository at this point in the history
…docs (#792)

* fix: Updated ThreadMessage struct with latest fields based on OpenAI docs

* fix: Reverted FileIDs for backward compatibility of v1
  • Loading branch information
ecoralic committed Jul 19, 2024
1 parent 92f4830 commit ae903d7
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions thread.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,25 @@ type ModifyThreadRequest struct {
type ThreadMessageRole string

const (
ThreadMessageRoleUser ThreadMessageRole = "user"
ThreadMessageRoleAssistant ThreadMessageRole = "assistant"
ThreadMessageRoleUser ThreadMessageRole = "user"
)

type ThreadMessage struct {
Role ThreadMessageRole `json:"role"`
Content string `json:"content"`
FileIDs []string `json:"file_ids,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
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 {
Expand Down

0 comments on commit ae903d7

Please sign in to comment.