coinfer.js package
Classes
| Class | Description |
|---|---|
| Coinfer | The coinferJS’s main class. |
Functions
| Function | Description |
|---|---|
| useCoinfer() | A hook used to retrieve the Coinfer instance within CoinferContext. |
Interfaces
| Interface | Description |
|---|---|
| IExperimentSocketLogActionType | The data type of the log information obtained from WebSocket. |
| IExperimentSocketNamesActionType | After establishing the connection on the backend (requiring version: ‘1.0’), the data returned once includes the Chains and all known Variable names under each Chain. |
| IExperimentSocketPlotDataActionType | The plot data obtained from the WebSocket. |
| ISuperLogsType | The logs for the super user. |
| IUserInfoType | The userInfo structure. |
Variables
| Variable | Description |
|---|---|
| CoinferContext | Coinferjs’s Context |
| useCoinferAction | A hook for invoking the coinferJS feature using a more convenient method. |
| useExperimentWebSocket | You can use this hook to access the WebSocket connection of the Experiment. |
| useNewCoinfer |
Type Aliases
| Type Alias | Description |
|---|---|
| ExperimentSocketActionTypes | The type of data obtained from the WebSocket. |
| FetchFunctionReturnType | |
| FetchFunctionType |
Coinfer.__VERSION property
The default backend API server version. Signature:Coinfer.(constructor)
Constructs a new instance of theCoinfer class
Signature:
Coinfer.check() method
Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| taskId | any | |
| period | number | (Optional) |
Coinfer.checkToken() method
Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| token | string |
Coinfer.config property
Signature:Coinfer.create() method
Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| payload | any |
Coinfer.createModelFromGithubGist() method
Create a model from GitHub Gist. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| repo | string | |
| modelName | string |
Coinfer.createModelFromGithubRepo() method
Create a model from GitHub repository. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| repo | string | |
| branch | string | |
| modelName | string |
Coinfer.createShared() method
Share Model or Experiment with other users. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| type | T | |
| sharedItemId | string | |
| sharedParams | ISharedAuthParams |
Coinfer.DefaultSettings property
The default backend URL server address. Signature:Example
Coinfer.del() method
Delete the model. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| shortIds | string[] |
Example 1
Example 2
Example 3
Coinfer.deleteAccessToken() method
delete the access token. Signature:Coinfer.deleteShared() method
Delete the sharing of a Model or Experiment. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| type | T | |
| ids | string[] |
Coinfer.experiment property
Signature:Coinfer.get() method
Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| props | ICoinferGetProps & CoinferAuthorizationExtraParams | |
| extraParams | ICoinferReqExtraParams | (Optional) |
Coinfer.getColabLink() method
Get the colab link of the Experiment. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| experimentId | string |
Coinfer.getExperimentStatus() method
Get the status infomation of the Experiment. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| experimentId | string | |
| params | Partial<ICoinferReqExtraParams> |
Coinfer.getNotifications() method
get the notification list. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| status | NotificationStatusType | ‘all’ | |
| pageConfig | IPagingParams |
Coinfer.getSharedInfo() method
Get the shared information of the Model/Experiment, such as whether a password is required Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| type | ‘model’ | ‘experiment’ | |
| shareId | string |
Coinfer.getSharedList() method
Get a list of Models and Experiments to share. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| type | T | |
| pageConfig | IPagingParams |
Coinfer.getSharedModel() method
Get the shared information of the Model. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| modelId | string | |
| sharedId | string | |
| extraParams | ICoinferReqExtraParams | (Optional) |
Coinfer.getTuringConfig() method
Get the turing configuration infomation. Signature:Coinfer.list() method
Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| extraParams | { [key: string]: any; } | (Optional) |
Coinfer.listGithubBranches() method
List all branches of the repository specified by the user(Log in with Github) Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| repo | string |
Coinfer.listGithubReposAndGists() method
List all repositories and Gists owned by the current user(Log in with Github). Signature:Coinfer.loadConfigFile() method
Signature:Coinfer.logs() method
Show the detailed logs (only for superuser). Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| id | any |
Example
Coinfer.markNotificationAs() method
mark the notification as read or unread. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| notificationIds | string[] | |
| status | NotificationStatusType |
Coinfer class
The coinferJS’s main class. Signature:Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)() | Constructs a new instance of the Coinfer class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| __VERSION | static | string | The default backend API server version. |
| config | ICoinferConfig | ||
| DefaultSettings | static | ICoinferConfig | The default backend URL server address. |
| experiment | readonly | this | |
| model | readonly | this | |
| onSavedAccessToken | (any: any) => void | login with token | |
| task | readonly | this | |
| token | readonly | this | |
| websocket | readonly | this |
Methods
| Method | Modifiers | Description |
|---|---|---|
| check(taskId, period) | ||
| checkToken(token) | ||
| create(payload) | ||
| createModelFromGithubGist(repo, modelName) | Create a model from GitHub Gist. | |
| createModelFromGithubRepo(repo, branch, modelName) | Create a model from GitHub repository. | |
| createShared(type, sharedItemId, sharedParams) | Share Model or Experiment with other users. | |
| del(shortIds) | Delete the model. | |
| deleteAccessToken() | delete the access token. | |
| deleteShared(type, ids) | Delete the sharing of a Model or Experiment. | |
| get(props, extraParams) | ||
| getColabLink(experimentId) | Get the colab link of the Experiment. | |
| getExperimentStatus(experimentId, params) | Get the status infomation of the Experiment. | |
| getNotifications(status, pageConfig) | get the notification list. | |
| getSharedInfo(type, shareId) | Get the shared information of the Model/Experiment, such as whether a password is required | |
| getSharedList(type, pageConfig) | Get a list of Models and Experiments to share. | |
| getSharedModel(modelId, sharedId, extraParams) | Get the shared information of the Model. | |
| getTuringConfig() | Get the turing configuration infomation. | |
| list(extraParams) | ||
| listGithubBranches(repo) | List all branches of the repository specified by the user(Log in with Github) | |
| listGithubReposAndGists() | List all repositories and Gists owned by the current user(Log in with Github). | |
| loadConfigFile() | ||
| logs(id) | Show the detailed logs (only for superuser). | |
| markNotificationAs(notificationIds, status) | mark the notification as read or unread. | |
| onDeleteAccessToken() | ||
| onError(err) | This method is called when an error occurs, such as authentication failure | |
| run(params) | ||
| runBatch(params) | ||
| runWithLambda(models) | Run Model through lamdba | |
| saveAccessToken(token) | After successful login, the method of storing the authorization code. | |
| setAccessToken(token) | Set or update the authorization token. | |
| setConfig(config) | Set config for Coinfer. | |
| update(payload) |
Coinfer.model property
Signature:Coinfer.onDeleteAccessToken() method
Signature:Coinfer.onError() method
This method is called when an error occurs, such as authentication failure Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| err | any |
Coinfer.onSavedAccessToken property
login with token Signature:Coinfer.run() method
Warning: This API is now obsolete.
Run a model, please instead it of runWithLambda.
Signature:
Parameters
| Parameter | Type | Description |
|---|---|---|
| params | ICoinferRunModelProps |
Example 1
Example 2
Coinfer.runBatch() method
Warning: This API is now obsolete.
Run some models in batches, please instead it of runWithLambda.
Signature:
Parameters
| Parameter | Type | Description |
|---|---|---|
| params | IVectorlyRunModelProps[] |
Example 1
Example 2
Coinfer.runWithLambda() method
Run Model through lamdba Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| models | IModelConfigInLambda[] |
Coinfer.saveAccessToken() method
After successful login, the method of storing the authorization code. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| token | any |
Coinfer.setAccessToken() method
Set or update the authorization token. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| token | string |
Coinfer.setConfig() method
Set config for Coinfer. Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| config | Partial<ICoinferConfig> |
Coinfer.task property
Signature:Coinfer.token property
Signature:Coinfer.update() method
Signature:Parameters
| Parameter | Type | Description |
|---|---|---|
| payload | ICoinferCommonPutProps |
Coinfer.websocket property
Signature:CoinferContext variable
Coinferjs’s Context Signature:Example
You can invoke it inApp.tsx or App.jsx.
ExperimentSocketActionTypes type
The type of data obtained from the WebSocket. Signature:FetchFunctionReturnType type
Signature:FetchFunctionType type
Signature:IExperimentSocketLogActionType.data property
Signature:IExperimentSocketLogActionType interface
The data type of the log information obtained from WebSocket. Signature:Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| data | string |
IExperimentSocketNamesActionType.data property
Signature:IExperimentSocketNamesActionType interface
After establishing the connection on the backend (requiring version: ‘1.0’), the data returned once includes the Chains and all known Variable names under each Chain. Signature:Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| data | IChainNameType$1[] |
IExperimentSocketPlotDataActionType.data property
Signature:IExperimentSocketPlotDataActionType interface
The plot data obtained from the WebSocket. Signature:Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| data | {[key: string]: any[]} |
ISuperLogsType.logs property
Signature:ISuperLogsType interface
The logs for the super user. Signature:Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| logs | [number, string] |
IUserInfoType.id property
Signature:IUserInfoType.is_github_user property
Signature:IUserInfoType interface
The userInfo structure. Signature:Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| id | number | ||
| is_github_user | boolean | ||
| super | boolean | ||
| username | string |