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,6 +83,7 @@ type ModifyThreadRequest struct {
type ThreadMessageRole string type ThreadMessageRole string
const ( const (
ThreadMessageRoleAssistant ThreadMessageRole = "assistant"
ThreadMessageRoleUser ThreadMessageRole = "user" ThreadMessageRoleUser ThreadMessageRole = "user"
) )
@@ -90,9 +91,19 @@ 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"`
Attachments []ThreadAttachment `json:"attachments,omitempty"`
Metadata map[string]any `json:"metadata,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 {
ID string `json:"id"` ID string `json:"id"`
Object string `json:"object"` Object string `json:"object"`