DeepSeek | Vision

DeepSeek can understand and analyze images. You can send images as base64-encoded data within content blocks.

Vision Example

Send an image with a prompt asking DeepSeek to describe it.


DeepSeek := TsgcHTTP_API_DeepSeek.Create(nil);
DeepSeek.DeepSeekOptions.ApiKey := 'API_KEY';

// Load image and encode to base64
oStream := TFileStream.Create('photo.jpg', fmOpenRead);
Try
  oBytes := TBytesStream.Create;
  Try
    oBytes.CopyFrom(oStream, 0);
    vImageBase64 := EncodeBase64(oBytes.Memory, oBytes.Size);
  Finally
    oBytes.Free;
  End;
Finally
  oStream.Free;
End;

WriteLn(DeepSeek._CreateVisionMessage('deepseek-chat',
  'Describe this image', vImageBase64, 'image/jpeg'));