{"id":20635683,"url":"https://github.com/testdotai/classifier-client-node","last_synced_at":"2025-10-15T02:09:27.462Z","repository":{"id":36654466,"uuid":"228946788","full_name":"testdotai/classifier-client-node","owner":"testdotai","description":"Node.js client for test.ai classifier server","archived":false,"fork":false,"pushed_at":"2022-04-09T04:41:04.000Z","size":1549,"stargazers_count":7,"open_issues_count":12,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T01:34:12.296Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/testdotai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-19T00:53:39.000Z","updated_at":"2023-10-10T11:13:08.000Z","dependencies_parsed_at":"2022-08-08T16:30:23.142Z","dependency_job_id":null,"html_url":"https://github.com/testdotai/classifier-client-node","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testdotai%2Fclassifier-client-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testdotai%2Fclassifier-client-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testdotai%2Fclassifier-client-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testdotai%2Fclassifier-client-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testdotai","download_url":"https://codeload.github.com/testdotai/classifier-client-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249155726,"owners_count":21221651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T15:06:26.958Z","updated_at":"2025-10-15T02:09:22.432Z","avatar_url":"https://github.com/testdotai.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test.ai Classifier - Node.js + WebdriverIO Client\n\nThe code in this directory defines a client library for use with the gRPC-based [Test.ai classifier server](https://github.com/testdotai/appium-classifier-plugin).\n\n## Installation \u0026 Setup\n\n```\nnpm install test-ai-classifier-client\n```\n\n## Usage\n\nThis client exposes as the default export a `ClassifierClient` class, which can be instantiated as follows:\n\n```js\nconst ClassifierClient = require('test-ai-classifier-client');\nconst client = new ClassifierClient({host, port})\n```\n\n(Where `host` and `port` refer to the address and port the server is running on).\n\nThe client exposes two instance methods:\n\n1. `classifyElements` takes an object parameter with 4 keys:\n    1. `labelHint`: the label you wish to find matching elements with (see `lib/labels.js` in this repo).\n    2. `elementImages`: an object whose keys are ids, and whose values are `Buffer` objects containing raw binary data of PNG images.\n    3. `confidenceThreshold`: (optional) the confidence below which not to return matches (0.0 - 1.0)\n    4. `allowWeakerMatches`: (optional) whether or not to return a match for elements that *did* match the label, but for whom *another* label had a higher confidence.\n\n    The return value of this method is an object whose keys are the same ids you sent in, and whose values are classification objects with the following keys:\n    1. `label`: the matching label\n    2. `confidence`: the confidence for the matched label\n    3. `confidenceForLabel`: the confidence for the label given in `labelHint`\n2. `findElementsMatchingLabel` is a helper function for use with Selenium tests (for Appium use the Appium plugin as described in the main README for this repo). It takes an object parameter with 4 keys: all of the same keys as in `classifyElements` except for `elementImages` which is replaced by:\n    1. `driver`: the WebdriverIO driver object\n    The return value of this method is an array of WebdriverIO element objects that match.\n\nFor a concrete example, see `test/rpc-e2e-specs.js`\n\n## Development\n\nTests expect a running Classifier server on port 50051.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestdotai%2Fclassifier-client-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestdotai%2Fclassifier-client-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestdotai%2Fclassifier-client-node/lists"}