2023-10-29 22:56:57 +00:00
|
|
|
'use client'
|
2023-10-26 00:48:18 +00:00
|
|
|
|
2023-10-29 21:55:50 +00:00
|
|
|
import useSWRImmutable from 'swr/immutable'
|
2023-10-26 00:48:18 +00:00
|
|
|
import { SWRResponse } from 'swr'
|
2023-10-29 21:55:50 +00:00
|
|
|
import fetcher from '@/lib/tabby-fetcher'
|
2023-10-26 00:48:18 +00:00
|
|
|
|
|
|
|
|
export interface HealthInfo {
|
2023-10-29 22:56:57 +00:00
|
|
|
device: string
|
2023-10-30 00:04:42 +00:00
|
|
|
model?: string
|
2023-10-29 22:56:57 +00:00
|
|
|
chat_model?: string
|
|
|
|
|
version: {
|
|
|
|
|
build_date: string
|
|
|
|
|
git_describe: string
|
|
|
|
|
}
|
2023-10-26 00:48:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function useHealth(): SWRResponse<HealthInfo> {
|
2023-10-29 22:56:57 +00:00
|
|
|
return useSWRImmutable('/v1/health', fetcher)
|
|
|
|
|
}
|