Skip to content

Dg sdk

dg_sdk

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

Kind: global class

new dg_sdk()

Example (Usage:)

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

dg_sdk.connect(dest, [zooUrl], [token], [isDummy]) ⇒ 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.

Kind: instance method of dg_sdk
Returns: AIServerZoo | AIServerCloudZoo | CloudServerCloudZoo - - An instance of the appropriate zoo class based on the parameters.

Param Type Default Description
dest string The destination address or alias ('cloud' for cloud inference).
[zooUrl] string null The URL of the cloud model zoo (required for cloud model access in AIServerCloudZoo / CloudServerCloudZoo inference).
[token] string null The authentication token for the model zoo (required for cloud model access).
[isDummy] boolean false Flag to indicate if a dummy zoo instance should be created.

Example (AIServer inference with AIServer model zoo:)

let zoo = dg.connect('ws://localhost:8779');
Example (AIServer inference with Cloud model zoo:)
let zoo = dg.connect('ws://localhost:8779', 'https://cs.degirum.com/degirum/public', secretToken);
Example (Cloud inference with Cloud model zoo:)
let zoo = dg.connect('cloud', 'https://cs.degirum.com/degirum/public', secretToken);

dg_sdk.getSupportedDevices(inferenceHostAddress) ⇒ Promise.<Array.<string>>

Gets the list of supported devices for inference as a list of "RUNTIME/DEVICE" strings.

Kind: instance method of dg_sdk
Returns: Promise.<Array.<string>> - - A promise that resolves with the list of supported runtime/device strings.

Param Type Description
inferenceHostAddress string The address of the inference host, either an AIServer IP address or 'cloud'