-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: main
Are you sure you want to change the base?
Initial Pulze Provider #153
Conversation
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. |
customize json unmarshalling to support old settings structure
There was a problem hiding this 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() | |||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
pkg/plugin/health.go
Outdated
@@ -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{ |
There was a problem hiding this comment.
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{}, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 👍
Thanks for your review, I've updated the PR. Let me know if there's anything else |
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. |
Hey @fabianbaier, forgot to follow up on this one. |
Draft of adding Pulze.ai as provider