Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deepai

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deepai - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

lib/core/apiBaseUrl.js

14

lib/core/DeepAI.js

@@ -8,2 +8,5 @@ 'use strict';

const apiBaseUrl = require('./apiBaseUrl').baseUrl;
const resultRendering = require('./resultRendering');
const globalObject = Function('return this')();

@@ -27,3 +30,3 @@

function urlForModel(model_name) {
return "https://api.deepai.org/api/" + model_name;
return apiBaseUrl+"/api/" + model_name;
}

@@ -33,5 +36,2 @@

DeepAI.prototype.callStandardApi = async function request(model_name, inputs_object) {
if (!this.apiKey) {
throw new Error("DeepAI error: apiKey should be first set with deepai.setApiKey(...)");
}

@@ -85,3 +85,5 @@ const form = new formData();

var req_options = {};
var req_options = {
withCredentials: true
};
if (form.getHeaders !== undefined) {

@@ -96,2 +98,4 @@ // formData is the nodejs based subsitute, only needed for node.js

DeepAI.prototype.renderResultIntoElement = resultRendering.renderResultIntoElement;
module.exports = DeepAI;
{
"name": "deepai",
"version": "1.0.0",
"version": "1.0.1",
"license": "BSD-2-Clause",

@@ -5,0 +5,0 @@ "repository": {

@@ -62,2 +62,20 @@ # DeepAI JS Client

```
##### Browser Result Rendering
This code will render the result of the API call into an existing HTML element, such as a div, with the id "yourResultContainerId".
The result will fit itself inside your container, so be sure to set a size on it.
```js
var result = await deepai.callStandardApi("content-moderation", {
image: "https://YOUR_IMAGE_URL"
});
await deepai.renderResultIntoElement(result, document.getElementById('yourResultContainerId'));
```
#### Node.js

@@ -64,0 +82,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc