Constructor
new dg_sdk()
Example
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.
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. |
Returns:
- An instance of the appropriate zoo class based on the parameters.
Examples
let zoo = dg.connect('ws://localhost:8779');
let zoo = dg.connect('ws://localhost:8779', 'https://cs.degirum.com/degirum/public', secretToken);
let zoo = dg.connect('cloud', 'https://cs.degirum.com/degirum/public', secretToken);