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:
Edin Ćoralić
2024-07-19 17:12:20 +03:00
committed by GitHub
parent 92f483055f
commit ae903d7465

View File

@@ -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 {