@coreviz/sdk 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +82 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,49 @@
1
+ [![The World's Most Powerful Visual Copilot](./demo/banner.png)](https://coreviz.io)
2
+
3
+ <div align="center">
4
+ <h1>CoreViz</h1>
5
+ <a href="https://coreviz.io/">Home</a>
6
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
7
+ <a href="https://lab.coreviz.io/">Studio</a>
8
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
9
+ <a href="https://github.com/coreviz/cli">CLI</a>
10
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
11
+ <a href="https://github.com/coreviz/sdk">SDK</a>
12
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
13
+ <a href="https://docs.coreviz.io/">Docs</a>
14
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
15
+ <a href="https://x.com/withcoreviz">X</a>
16
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
17
+ <a href="https://www.linkedin.com/company/coreviz/">LinkedIn</a>
18
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
19
+ <a href="mailto:team@coreviz.io">Contact</a>
20
+ <br />
21
+ <br />
22
+
23
+ CoreViz is a Vision AI platform for teams and individuals working with thousands of visual assets.
24
+
25
+ <p align="center">
26
+ <a href="https://coreviz.io"><img alt="CoreViz" src="./demo/demo.gif"></a>
27
+ </p>
28
+ </div>
29
+
30
+
1
31
  # @coreviz/sdk
2
32
 
3
- The official JavaScript/TypeScript SDK for CoreViz's Vision AI APIs. Easily integrate powerful image analysis and manipulation features into your applications.
33
+ Easily integrate powerful image analysis and manipulation features into your applications with CoreViz (https://coreviz.io/) 's Vision SDK.
34
+
35
+ ## Introduction
36
+
37
+ The CoreViz SDK powers the [coreviz.io](https://coreviz.io/) platform and the [CoreViz CLI](https://github.com/coreviz/cli), providing fast, consistent AI image analysis and manipulation capabilities across environments.
38
+
39
+ You can try out the live demos and tools built with this SDK at [coreviz.io/tools](https://coreviz.io/tools), including:
40
+
41
+ - **Image Description**: Generate detailed captions for any image. [→ Demo](https://coreviz.io/tools/describe)
42
+ - **Tagging / Classification**: Classify images with custom or general prompts. [→ Demo](https://coreviz.io/tools/tag)
43
+ - **Image Editing**: Modify or retouch images using generative AI based on text instructions. [→ Demo](https://coreviz.io/tools/edit)
44
+
45
+ Check out [coreviz.io/tools](https://coreviz.io/tools) to explore these features interactively.
46
+
4
47
 
5
48
  ## Installation
6
49
 
@@ -90,6 +133,43 @@ const editedImage = await coreviz.edit('https://example.com/photo.jpg', {
90
133
  });
91
134
  ```
92
135
 
136
+ ### `coreviz.embed(input, options?)`
137
+
138
+ Generates embeddings for image or text inputs, enabling semantic search and similarity comparison. Use with `coreviz.similarity(embeddingA, embeddingB)` to compare two images or an image and a text.
139
+
140
+ **Parameters:**
141
+ - `input` (string): The text string or image (URL/base64) to embed.
142
+ - `options` (object, optional):
143
+ - `type` ('image' | 'text', optional): Explicitly define the input type.
144
+ - `mode` ('api' | 'local', optional): Execution mode (default: `'api'`). `'local'` runs in-browser/node using transformers.js.
145
+
146
+ **Returns:**
147
+ - `Promise<EmbedResponse>`: An object containing:
148
+ - `embedding` (number[]): The high-dimensional vector representation.
149
+
150
+ **Example:**
151
+
152
+ ```typescript
153
+ const { embedding } = await coreviz.embed('A photo of a sunset');
154
+ ```
155
+
156
+ ### `coreviz.similarity(embeddingA, embeddingB)`
157
+
158
+ Calculates the degree of similarity between two embeddings.
159
+
160
+ **Parameters:**
161
+ - `embeddingA` (number[]): The first image/text embedding.
162
+ - `embeddingB` (number[]): The second image/text embedding.
163
+
164
+ **Returns:**
165
+ - `number`: A similarity score between -1 and 1.
166
+
167
+ **Example:**
168
+
169
+ ```typescript
170
+ const similarity = coreviz.similarity(embeddingA, embeddingB);
171
+ ```
172
+
93
173
  ### `coreviz.resize(input, maxWidth?, maxHeight?)`
94
174
 
95
175
  Utility function to resize images client-side or server-side before processing. Also available as a standalone import.
@@ -107,8 +187,4 @@ Utility function to resize images client-side or server-side before processing.
107
187
  ```typescript
108
188
  const resized = await coreviz.resize(myFileObject, 800, 600);
109
189
  // or import { resize } from '@coreviz/sdk';
110
- ```
111
-
112
- ## License
113
-
114
- MIT
190
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreviz/sdk",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "CoreViz SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",