Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Pulze Provider #153

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

fabianbaier
Copy link
Contributor

@fabianbaier fabianbaier commented Nov 15, 2023

Draft of adding Pulze.ai as provider

@CLAassistant
Copy link

CLAassistant commented Nov 15, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ fabianbaier
✅ Parkuhr
❌ Nico Kupfer


Nico Kupfer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sd2k sd2k requested a review from a team February 13, 2024 10:55
Copy link
Contributor

@annanay25 annanay25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this effort! I've left a few comments and looking forward to coordinating to get this in.

@@ -169,10 +179,9 @@ func (a *App) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest)
a.healthCheckMutex.Lock()
defer a.healthCheckMutex.Unlock()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'm thinking we can remove the error returned from this function as well. we aren't returning an error anywhere.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought so too, but at the moment it's required to ensure App complies to the CheckHealthHandler interface (https://github.com/grafana/grafana-plugin-sdk-go/blob/main/backend/diagnostics.go#L12).

@@ -11,7 +11,11 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/build"
)

var openAIModels = []string{"gpt-3.5-turbo", "gpt-4"}
// Define models for each provider to be included in the health check.
var providerModels = map[string][]string{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this would be more type-safe if it was a map[openAIProvider][]string

if a.healthOpenAI != nil {
return *a.healthOpenAI, nil
return *a.healthOpenAI
}

d := openAIHealthDetails{
OK: true,
Configured: a.settings.OpenAI.apiKey != "" || a.settings.OpenAI.Provider == openAIProviderGrafana,
Models: map[string]openAIModelHealth{},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing the condition for openAIProviderGrafana here?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the logic here (e.g. all "providers" are listed in providerModels now), hence the lookup can use a.settings.OpenAI.Provider.


openAIKey = "openAIKey"
llmGatewayKey = "llmGatewayKey"
encodedTenantAndTokenKey = "base64EncodedAccessToken"
)

// OpenAISettings contains the user-specified OpenAI connection details
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think at some point we'll have to consider renaming this to ProviderSettings or something.. (but can be done in a future PR)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, agree. We initially planned to include this, but it's better to have a separate PR for this 👍

@Parkuhr
Copy link

Parkuhr commented Feb 16, 2024

Thanks for your review, I've updated the PR. Let me know if there's anything else

@sd2k
Copy link
Contributor

sd2k commented Feb 19, 2024

Sorry for the delay on reviewing this, we're thinking about some redesigns to make things easier for users and plugin developers but we haven't forgotten!

@Parkuhr
Copy link

Parkuhr commented Feb 20, 2024

Sorry for the delay on reviewing this, we're thinking about some redesigns to make things easier for users and plugin developers but we haven't forgotten!

Cool, no worries. We'll keep this PR up to date. Let us know if there's anything we can help you with.

@yoziru yoziru self-assigned this Sep 12, 2024
@yoziru
Copy link
Contributor

yoziru commented Sep 18, 2024

Hey @fabianbaier, forgot to follow up on this one.
I think since we added support for model abstractions (e.g. custom model names) in https://github.com/grafana/grafana-llm-app/releases/tag/0.10.0, this PR is probably superseded and could be closed. Pulze should work out of the box now by specifying the URL and then setting the model abstractions (Base / Large) to the Pulze abstract model names (e.g. pulze).
wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants