How easy is it to build a simple Glean Chat client?

I can write that code in 145 lines!

By Rob

I spent an amazing week at Glean’s BOOSTcamp. An event for new Gleanies joining the company to learn about sales, product features, architecture, get hands on with the product with HOLs on Connectors and Prompts labs along with a little socializing to get to know each other.

There was a wide range of people from Account Exectives, Systems Engineers, Solutions Architects, Business Development, Executives and Technical Enablement leaders.

Much of my time was spent time with the Systems Engineering and nerding out. Our time together was spent discussing Glean’s architecture and security features along with the Platform. For me when the word Platform is used that means extensibility, APIs and ability to build your own solutions, and we do not disappoint. Of course out out of the box is pretty awesome with the web, mobile and desktop application. BUT, APIs bring so many more possibilities. This led me to put together a simple application showing how easy it is to create your own custom Chat client.

glean-chitchat

Basic capabilities:

  • Input a query to ask your question.
  • Display multiple query results with the most recent at the top.
  • Retains your query history at the bottom to see what you have asked. Not persisted.

Basic Python app, 145 lines of code.

GitHub Repo: rob-barker-glean/chitchat

Here are the libraries I used:

# Libraries
import sys
import requests
import json
import markdown

# UI elements
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel, QLineEdit, QTextBrowser, QPushButton, QComboBox

Again, it is just a simple example but shows how easy it is to use our APIs.

If you are current Glean customer, feel free to fork, play around and see how you can extend. Just replace the API_KEY and CHAT_ENDPOINT to get going.

If you aren’t a Glean customer, check out our Glean Developer site to learn more about our APIs. And you can always reach out to get a demo.

thanks == ‘Rob’:

Share: LinkedIn