grafana / plugin-tools

Create Grafana plugins with ease.
https://grafana.com/developers/plugin-tools/
Apache License 2.0
57 stars 31 forks source link

Create Plugin: Update scenes app with LLM example #873

Closed nmarrs closed 3 months ago

nmarrs commented 5 months ago

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

NOTE: I'm not sure how to test this locally, but will work on figuring this out when I am back in next week. In meantime, with LLM plugin configured here are the demos that should be possible with these 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/grafana-plugin-examples/pull/273

CLAassistant commented 5 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

github-actions[bot] commented 5 months ago

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged. It will not be considered when calculating future versions of the npm packages and will not appear in the changelogs.

nmarrs commented 5 months ago

This is a nice idea but, I am not a fan of offering examples for plugins that rely in experimental apis. They will easily change, break and this example will quickly become non functional

I'd like to hear @sympatheticmoose opinion in this one

Hey @academo! Thanks for the review!

Totally understandable the concern about things breaking given the reliance of this on the grafana experimental package. For additional context, the API that this demo is using is our wrappers around OpenAIs chat completion API. Our wrapper API code has been stable since we first wrote it 8+ months ago so concern around breaking changes breaking things might not be as big of an issue :)

We will need to include some docs / instructions in the readme though on how to install and set up the LLM plugin as that is required for this demo to work. Those instructions probably could go inline if we detect the plugin isn't installed / configured correctly

academo commented 5 months ago

Our wrapper API code has been stable since we first wrote it 8+ months ago so concern around breaking changes breaking things might not be as big of an issue :)

The best course of action would be to move those APIs out of the experimental package, then use the stable released APIs in this example.

nmarrs commented 5 months ago

Hey @nmarrs - thanks for looking at this!

The template examples we provide should be fairly barebones to allow them to act as a starting point for development, whilst neat I feel this probably overcomplicates matters and is more niche. Is there a reason we would want this in create-plugin as opposed to https://github.com/grafana/grafana-plugin-examples/tree/main/examples?

Edit: just seen grafana/grafana-plugin-examples#273 - I think this is the best route forward for now, but maybe as a separate example

Hi @sympatheticmoose! Thanks for the reply. I think the main idea behind having these examples inside create-plugin is to serve as a launching point for the community to 1) discover that LLM capabilities are possible within Grafana apps and 2) be able to use example and leverage these capabilities in their own Grafana scenes apps.

I understand your point on simplicity, maybe would only including the basic LLM integration example make sense while I could include / reference to the "more complex" example that can live over in the grafana plugin examples repo? This would still accomplish the point on discoverability but reduce the introduced complexity a fair amount.

nmarrs commented 3 months ago

Closing this in favor of including an example of llm integration via grafana-plugin-examples repo - see this PR