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

Improve health check to return more granular details #85

Merged
merged 12 commits into from
Oct 4, 2023

Conversation

sd2k
Copy link
Contributor

@sd2k sd2k commented Oct 2, 2023

The Dashboard AI team have requested that the plugin health check returns more details about whether the OpenAI functionality is configured, and whether that configuration is valid. This PR adds it, and similar functionality for the vector service.

It's backwards incompatible with past health checks unfortunately, but the llmclient package does include a change which should be compatible with both the current and previous version of the plugin.

We're definitely due a refactor of the way we handle OpenAI config and requests, but I think that will be part of #80.

The Dashboard AI team have requested that the plugin health check
returns more details about whether the OpenAI functionality is
configured, and whether that configuration is valid. This PR adds it,
and similar functionality for the vector service.

It's backwards incompatible with past health checks unfortunately, but
the llmclient package does include a change which should be compatible
with both the current and previous version of the plugin.

We're definitely due a refactor of the way we handle OpenAI config and
requests, but I think that will be part of #80.
@sd2k
Copy link
Contributor Author

sd2k commented Oct 2, 2023

TODO:

  • cache the health check result on the App struct, since it's expensive and slow and the app will be recreated if the plugin settings change anyway.
  • add a 'test' button to the settings UI which runs a health check (bypassing the cache?)

The app is recreated by the plugin management system if settings
change, so the cached value will be discarded when the user updates
the settings to fix the health check error.

Still unsure if this is an ideal way of doing things, but it
speeds up health checks significantly while saving on OpenAI costs.
src/components/AppConfig/HealthCheck.tsx Outdated Show resolved Hide resolved
src/components/AppConfig/HealthCheck.tsx Outdated Show resolved Hide resolved
src/components/AppConfig/HealthCheck.tsx Outdated Show resolved Hide resolved
Error: "",
Models: map[string]openAIModelHealth{
"gpt-3.5-turbo": {OK: true, Error: ""},
"gpt-4": {OK: false, Error: `unexpected status code: 404: {"error": "model does not exist"}`},

Choose a reason for hiding this comment

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

If we return the errors like foo: bar: {error: baz} it is hard to parse in the frontend. Could we just return an object? is this any type of convention?
I'd love to return to the frontend as much information as possible from OpenAI since this is part of the configuration phase.

This is the best we can do when the request fails when using the query:
2023-09-29 16 08 07

@sd2k sd2k marked this pull request as ready for review October 4, 2023 10:53
Copy link

@ivanortegaalba ivanortegaalba left a comment

Choose a reason for hiding this comment

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

✅ The experience configuring the plugin is great. The right place to have debug info.
✅ The feature still working as expected
✅ The health check works in every scenario

@sd2k sd2k merged commit 75926cf into main Oct 4, 2023
3 checks passed
@sd2k sd2k deleted the upgraded-health-check branch October 4, 2023 14:23
@yoziru yoziru mentioned this pull request Oct 17, 2023
SandersAaronD pushed a commit that referenced this pull request Oct 27, 2023
Fix expected field names in type in health check details
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.

2 participants