MCPcopy Create free account
hub / github.com/Roy3838/Observer / checkServer

Method checkServer

app/src/utils/ModelManager.ts:447–468  ·  view source on GitHub ↗
(address: string)

Source from the content-addressed store, hash-verified

445 }
446
447 public async checkServer(address: string): Promise<{ status: 'online' | 'offline'; error?: string }> {
448 try {
449 const response = await platformFetch(`${address}/v1/models`, {
450 method: 'GET',
451 headers: { 'Content-Type': 'application/json' },
452 });
453
454 if (response.ok) {
455 return { status: 'online' };
456 }
457
458 return {
459 status: 'offline',
460 error: `Server responded with status ${response.status}`
461 };
462 } catch (error) {
463 return {
464 status: 'offline',
465 error: 'Could not connect to server'
466 };
467 }
468 }
469
470 // ===========================================================================
471 // Local Model Management (unified interface)

Callers 2

checkCustomServerMethod · 0.95
checkInferenceServerFunction · 0.80

Calls 1

platformFetchFunction · 0.90

Tested by

no test coverage detected