Skip to content

Commit 5e45cbb

Browse files
authored
Merge pull request #10 from luiscamara/add-missing-messageitem-fields
fix: properly support function calls
2 parents ea76078 + cf56ca9 commit 5e45cbb

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

types.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,23 @@ type MessageContentPart struct {
162162

163163
type MessageItem struct {
164164
// The unique ID of the item.
165-
ID string `json:"id"`
165+
ID string `json:"id,omitempty"`
166166
// The type of the item ("message", "function_call", "function_call_output").
167167
Type MessageItemType `json:"type"`
168168
// The final status of the item.
169-
Status ItemStatus `json:"status"`
169+
Status ItemStatus `json:"status,omitempty"`
170170
// The role associated with the item.
171-
Role MessageRole `json:"role"`
171+
Role MessageRole `json:"role,omitempty"`
172172
// The content of the item.
173-
Content []MessageContentPart `json:"content"`
173+
Content []MessageContentPart `json:"content,omitempty"`
174+
// The ID of the function call, if the item is a function call.
175+
CallID string `json:"call_id,omitempty"`
176+
// The name of the function, if the item is a function call.
177+
Name string `json:"name,omitempty"`
178+
// The arguments of the function, if the item is a function call.
179+
Arguments string `json:"arguments,omitempty"`
180+
// The output of the function, if the item is a function call output.
181+
Output string `json:"output,omitempty"`
174182
}
175183

176184
type ResponseMessageItem struct {

0 commit comments

Comments
 (0)