grafana / grafana-plugin-examples

181 stars 52 forks source link

Scenes app example: Add scenes app LLM plugin integration demo example #273

Open nmarrs opened 5 months ago

nmarrs commented 5 months ago

Update the create plugin template scenes app to include a example integrating the LLM plugin

TODO:

In meantime, with LLM plugin configured here are the demos that should be possible with these changes 🦖

As a side note it would be super cool if there was a way to somehow have a single github repo for demos vs needing to duplicate changes between this repo and plugin-tools 😬 (i.e. see this PR with duplicate changes)

https://github.com/grafana/scenes-app-template/assets/22381771/36b21e2d-aa4c-4515-baea-661c0764058c

https://github.com/grafana/scenes-app-template/assets/22381771/c67bcf88-3e25-4558-9647-02b0929a2ec3

https://github.com/grafana/scenes-app-template/assets/22381771/efe08fd8-fe64-47f9-b2e9-d198b061d610

Related PR: https://github.com/grafana/plugin-tools/pull/873

CLAassistant commented 5 months ago

CLA assistant check
All committers have signed the CLA.

nmarrs commented 5 months ago

Hey @nmarrs thanks again for these contributions.

As a side note it would be super cool if there was a way to somehow have a single github repo for demos vs needing to duplicate changes between this repo and plugin-tools

create-plugin templates are starting points which we try to keep fairly minimal so users don't have a ton to delete, but can still see "enough" to get started. We already get feedback that they are overly complex/cluttered.

These examples can showcase more specific functionality or be fully featured demos. A potential enhancement we are considering is to allow create-plugin to eventually also load these as templates, for example npx @grafana/create-plugin@latest --pluginType='scenesapp' --template='scenesapp-with-llm'

I think this would make a great addition to the examples repository, but can I request we split this out into its own example called something like app-with-scenes-llm and there in the example readme indicate any particular requirements or caution over experimental APIs, i.e. https://github.com/grafana/grafana-plugin-examples/tree/main/examples/app-with-service-account.

You could then remove other sections as you see fit compared to the current app-with-scenes example, to make this more focussed.

Hey @sympatheticmoose! I think this route sounds good - I will work on splitting out this example and will re-request your review when it is ready to go. Re: create-plugin template I think it would be great to still try and include the basic LLM integration screen just for discoverability sake (see this related comment on the related create plugin PR) but will defer to your judgement there 👍

nmarrs commented 3 months ago

I've gone through and updated this to be a separate example. I'm having some troubles though testing this locally as when trying to open the app plugin it gets a bad request error. This should be ready though for re-review :)

Error: Unknown Plugin
    at pluginSettings.ts:28:29
    at async As (AppRootPage.tsx:176:17)

https://github.com/grafana/grafana-plugin-examples/assets/22381771/67ba1ad4-e5f5-4838-a1e5-5e85b6cf735f