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
{{ message }}
Repository navigation
GrokChatClient fails to send images (DataContent) #72
Adding DataContent (such as image) to chat message does not actually get appended to Grok request
Steps to Reproduce
[SecretsFact("XAI_API_KEY")]publicasyncTaskGrokImage(){varmessages=newList<ChatMessage>();varimage=newDataContent(File.ReadAllBytes(@"C:\temp\xai.png"),"image/png");varchatMessage=newChatMessage(ChatRole.User,[newTextContent("Tell me what you see in the image"),image]);messages.Add(chatMessage);varchat=newGrokClient(Configuration["XAI_API_KEY"]!).AsIChatClient("grok-4").AsBuilder().UseLogging(output.AsLoggerFactory()).Build();varoptions=newGrokChatOptions{ModelId="grok-4-fast-non-reasoning",AdditionalProperties=new(){}};varresponse=awaitchat.GetResponseAsync(messages,options);output.WriteLine(response.Messages.Select(x =>x.Text).Last());}
Expected Behavior
Grok detects the image
Exception with Stack Trace
Put the exception with stack trace here.
Version Info
Latest source code / v1.0 on nuget both affected
Additional Info
Adding something like this to GrokChatClient seems to fix it, though this is probably more to it.
Activity