-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from grafana/new-health-check
LLM: use new, more detailed health check results
- Loading branch information
Showing
3 changed files
with
99 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,42 @@ | ||
export type LLMAppHealthCheck = { | ||
details: { | ||
openAI?: boolean; | ||
vector?: boolean; | ||
version?: string; | ||
}; | ||
}; | ||
export interface HealthCheckResponse { | ||
status: 'ok' | 'error'; | ||
details?: HealthCheckDetails; | ||
} | ||
|
||
export interface HealthCheckDetails { | ||
openAI: OpenAIHealthDetails | boolean; | ||
vector: VectorHealthDetails | boolean; | ||
version: string; | ||
} | ||
|
||
export interface OpenAIHealthDetails { | ||
// Whether the minimum required OpenAI settings have been provided. | ||
configured: boolean; | ||
// Whether we can call the OpenAI API with the provided settings. | ||
ok: boolean; | ||
// If set, the error returned when trying to call the OpenAI API. | ||
// Will be undefined if ok is true. | ||
error?: string; | ||
// A map of model names to their health details. | ||
// The health check attempts to call the OpenAI API with each | ||
// of a few models and records the result of each call here. | ||
models?: Record<string, OpenAIModelHealthDetails>; | ||
} | ||
|
||
export interface OpenAIModelHealthDetails { | ||
// Whether we can use this model in calls to OpenAI. | ||
ok: boolean; | ||
// If set, the error returned when trying to call the OpenAI API. | ||
// Will be undefined if ok is true. | ||
error?: string; | ||
} | ||
|
||
export interface VectorHealthDetails { | ||
// Whether the vector service has been enabled. | ||
enabled: boolean; | ||
// Whether we can use the vector service with the provided settings. | ||
ok: boolean; | ||
// If set, the error returned when trying to call the vector service. | ||
// Will be undefined if ok is true. | ||
error?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters