Class: dg_sdk

dg_sdk()

This class is the entrypoint for DeGirumJS, responsible for creating AIServerZoo / AIServerCloudZoo / CloudServerCloudZoo instances.

Constructor

new dg_sdk()

Source:
Example

Usage:

let dg = new dg_sdk();
let zoo = dg.connect('ws://localhost:8779', 'https://cs.degirum.com/degirum/public', secretToken);

Methods

connect(dest, zooUrlopt, tokenopt, isDummyopt) → {AIServerZoo|AIServerCloudZoo|CloudServerCloudZoo}

Connects to an AI Server or Cloud model zoo based on the provided parameters. This method supports three modes of inference:
1. AIServer inference with AIServer model zoo.
2. AIServer inference with Cloud model zoo.
3. Cloud inference with Cloud model zoo.
Dummy flag is used for creating AIServerCloudZoo instances that only need to have model listing functionality. This is useful for page elements or testing that need to display the model / zoo lists without connecting to any AIServer.
Parameters:
Name Type Attributes Default Description
dest string The destination address or alias ('cloud' for cloud inference).
zooUrl string <optional>
null The URL of the cloud model zoo (required for cloud model access in AIServerCloudZoo / CloudServerCloudZoo inference).
token string <optional>
null The authentication token for the model zoo (required for cloud model access).
isDummy boolean <optional>
false Flag to indicate if a dummy zoo instance should be created.
Source:
Returns:
- An instance of the appropriate zoo class based on the parameters.
Type
AIServerZoo | AIServerCloudZoo | CloudServerCloudZoo
Examples

AIServer inference with AIServer model zoo:

let zoo = dg.connect('ws://localhost:8779');

AIServer inference with Cloud model zoo:

let zoo = dg.connect('ws://localhost:8779', 'https://cs.degirum.com/degirum/public', secretToken);

Cloud inference with Cloud model zoo:

let zoo = dg.connect('cloud', 'https://cs.degirum.com/degirum/public', secretToken);

(async) getSupportedDevices(inferenceHostAddress) → {Promise.<Array.<string>>}

Gets the list of supported devices for inference as a list of "RUNTIME/DEVICE" strings.
Parameters:
Name Type Description
inferenceHostAddress string The address of the inference host, either an AIServer IP address or 'cloud'
Source:
Returns:
- A promise that resolves with the list of supported runtime/device strings.
Type
Promise.<Array.<string>>