You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Note: JSON field order follows struct definition
92
92
expected: `[{"content":"Let me call a function","role":"assistant","tool_calls":[{"id":"call_123","type":"function","function":{"name":"get_weather","arguments":"{\"location\":\"San Francisco\"}"}}]}]`,
93
93
},
94
+
{
95
+
name: "tool result message with tool_call_id",
96
+
messages: []Message{
97
+
{
98
+
Role: "tool",
99
+
Content: "The weather in San Francisco is sunny, 72°F",
100
+
ToolCallID: "call_123",
101
+
},
102
+
},
103
+
expected: `[{"content":"The weather in San Francisco is sunny, 72°F","role":"tool","tool_call_id":"call_123"}]`,
104
+
},
105
+
{
106
+
name: "multiple raw base64 images without prefix",
107
+
messages: []Message{
108
+
{
109
+
Role: "user",
110
+
Content: "Compare these two images",
111
+
Images: []string{
112
+
"/9j/4AAQSkZJRgABAQEBLA...",
113
+
"iVBORw0KGgoAAAANSUhEUgAAA...",
114
+
},
115
+
},
116
+
},
117
+
// Should auto-detect MIME types and add appropriate prefixes
118
+
expected: `[{"content":[{"text":"Compare these two images","type":"text"},{"image_url":{"url":"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLA..."},"type":"image_url"},{"image_url":{"url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA..."},"type":"image_url"}],"role":"user"}]`,
0 commit comments