Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading