mirror of
https://github.com/langgenius/dify.git
synced 2026-06-15 14:05:29 +08:00
cfc1cf2b8c
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
20 lines
651 B
TypeScript
20 lines
651 B
TypeScript
import type { ServerVersionResponse } from '@dify/contracts/api/openapi/types.gen'
|
|
import type { HttpClient } from '@/http/types'
|
|
|
|
// Used by every /_version probe call site (the version command and the
|
|
// per-command auto-nudge). Both must construct their HTTP client with this
|
|
// timeout + retryAttempts: 0, otherwise the default 30s/3-retry budget kicks in.
|
|
export const META_PROBE_TIMEOUT_MS = 2000
|
|
|
|
export class MetaClient {
|
|
private readonly http: HttpClient
|
|
|
|
constructor(http: HttpClient) {
|
|
this.http = http
|
|
}
|
|
|
|
async serverVersion(): Promise<ServerVersionResponse> {
|
|
return this.http.get<ServerVersionResponse>('_version')
|
|
}
|
|
}
|