dashboard-match

0.1.0 • Public • Published

Looker Recommended Dashboards with AI

Demo Gif

This app demonstrates how you could use a language model and embeddings to get recommended dashboards for a natural language query.

Huge Shoutout to Hugo and Meredith for their initial work in getting this use case built out for Looker Hack Week.

It uses

Getting Started for Development

  1. Clone or download a copy of this repository to your development machine.

    # cd ~/ Optional. your user directory is usually a good place to git clone to.
    git clone git@github.com:looker-open-source/extension-examples.git
    
  2. Navigate (cd) to the template directory on your system

    cd dashboard_demo
    
  3. Install the dependencies with NPM.

    npm install
    

    You may need to update your Node version or use a Node version manager to change your Node version.

  4. Start the development server

    npm start
    

    Great! Your extension is now running and serving the JavaScript at https://localhost:8080/bundle.js.

  5. Now log in to Looker and create a new project.

    This is found under Develop => Manage LookML Projects => New LookML Project.

    You'll want to select "Blank Project" as your "Starting Point". You'll now have a new project with no files.

    1. In your copy of the extension project you have a manifest.lkml file.

    You can either drag & upload this file into your Looker project, or create a manifest.lkml with the same content. Change the id, label, or url as needed.

    application: dashboard_match {
     label: "Dashboard Match"
     url: "https://localhost:8080/bundle.js"
     entitlements: {
       core_api_methods: ["all_dashboards", "dashboard", "update_dashboard", "dashboard_dashboard_elements"]
       navigation: yes
       use_embeds: yes
       local_storage: yes
       external_api_urls: ["https://generativelanguage.googleapis.com"]
     }
    }
    
  6. Create a model LookML file in your project. The name doesn't matter. The model and connection won't be used, and in the future this step may be eliminated.

    • Add a connection in this model. It can be any connection, it doesn't matter which.
    • Configure the model you created so that it has access to some connection.
  7. Connect your new project to Git. You can do this multiple ways:

    • Create a new repository on GitHub or a similar service, and follow the instructions to connect your project to Git
    • A simpler but less powerful approach is to set up git with the "Bare" repository option which does not require connecting to an external Git Service.
  8. Commit your changes and deploy your them to production through the Project UI.

  9. Reload the page and click the Browse dropdown menu. You should see your extension in the list.

    • The extension will load the JavaScript from the url provided in the application definition. By default, this is https://localhost:8080/bundle.js. If you change the port your server runs on in the package.json, you will need to also update it in the manifest.lkml.
  • Refreshing the extension page will bring in any new code changes from the extension template, although some changes will hot reload.
  1. Use with an access key requires a bit more setup. First, create a .env file in the dashboard_match directory with the following entries. Use a password generator to create the values. These values should be set prior to starting the development and data servers. Do NOT store the .env file in your source code repository.
GOOGLE_API_KEY='[your service key for generativelanguage.googleapis.com here]'

Deployment

The process above requires your local development server to be running to load the extension code. To allow other people to use the extension, a production build of the extension needs to be run. As the kitchensink uses code splitting to reduce the size of the initially loaded bundle, multiple JavaScript files are generated.

  1. In your extension project directory on your development machine, build the extension by running the command yarn build.
  2. Drag and drop ALL of the generated JavaScript files contained in the dist directory into the Looker project interface.
  3. Modify your manifest.lkml to use file instead of url and point it at the bundle.js file.

Note that the additional JavaScript files generated during the production build process do not have to be mentioned in the manifest. These files will be loaded dynamically by the extension as and when they are needed. Note that to utilize code splitting, the Looker server must be at version 7.21 or above.

Related Projects

Readme

Keywords

none

Package Sidebar

Install

npm i dashboard-match

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

58.9 kB

Total Files

27

Last publish

Collaborators

  • marcopaaz