The newest version of Google Keyboard, version 5.2, is included in the developer preview of Android version 7.1.1 (Nougat). This new incarnation of Google's long-running keyboard app, having only recently supplanted the AOSP keyboard as the default on Nexus and Pixel devices, boasts a number of new features. One of those features actually ties into a new perk of the newest version of Android, called "Image keyboard support". In short, this feature allows an app to tell a keyboard if it accepts more content than just text, and what that is. From there, the images and other content available can be determined by the app, the keyboard, or both. The implementation of the new feature that ties into Google Keyboard 5.2 is thus far only found in Google's own Messenger app.
The feature is open to developers as of the Android 7.1.1 preview, meaning that it could soon find its way into a number of other apps like Facebook Messenger and Snapchat. For the time being, however, even users of Google apps besides Messenger won't be seeing it. The implementation of the feature in Google Keyboard, as some users have reported, is not terribly unlike that found in Fleksy; users search for a GIF from a large library, and the one they choose is placed into the conversation just as naturally as any text. GIFs as autocompletes or suggestions, however, do not seem to be implemented at this time, if they're coming at all.
Current rich keyboard solutions, such as stickers and GIFs from third-party keyboards, are either transcoded on-the-fly, have to be supported in-app, or the recipient has to have the same keyboard installed. Creating a universal standard for what's accepted in an app and how an app can tell a user's device what it will accept opens the concept up to all users and developers, allowing for richer conversations across the board, so long as developers pick up and include the feature. In order to facilitate compatibility and make the API easy to implement, Google has included it in the regular AOSP support libraries, on top of having support enabled by default in the Android 7.1.1 (Nougat) developer preview.