@truto/truto-jsonata 1.0.6 → 1.0.8

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.
package/README.md CHANGED
@@ -1819,6 +1819,43 @@ URL {
1819
1819
 
1820
1820
  ---
1821
1821
 
1822
+ ### AI Stuff
1823
+
1824
+ <details>
1825
+ <summary>generateEmbeddingsCohere(body, api_key)</summary>
1826
+
1827
+ Generate embeddings through Cohere /embed API.
1828
+
1829
+ **Parameters:**
1830
+
1831
+ - **body**: The object similar to what [Cohere's /embed API](https://docs.cohere.com/reference/embed) expects.
1832
+ - **api_key**: Cohere's API Key
1833
+
1834
+ **Example Usage:**
1835
+
1836
+ ```javascript
1837
+ import trutoJsonata from '@truto/truto-jsonata';
1838
+
1839
+ const body = {
1840
+ "model": "embed-multilingual-v3.0",
1841
+ "texts": [
1842
+ "hello",
1843
+ "goodbye"
1844
+ ],
1845
+ "input_type": "classification",
1846
+ "embedding_types": [
1847
+ "float"
1848
+ ]
1849
+ };
1850
+ const api_key = "c7fdd028-d967-456a-9765-be47a7959f7e";
1851
+ const expression = trutoJsonata("$generateEmbeddingsCohere(body, api_key)");
1852
+ expression.evaluate({ body, api_key }).then(result => { console.log(result); });
1853
+ // Output: {"id": "c7fdd028-d967-456a-9765-be47a7959f7e", .....}
1854
+ ```
1855
+
1856
+ </details>
1857
+
1858
+
1822
1859
  ### Miscellaneous
1823
1860
 
1824
1861
  <details>
package/dist/main.cjs CHANGED
@@ -1295,8 +1295,9 @@ function $61d34cb0b1d98121$var$firstNonEmpty(...args) {
1295
1295
  var $61d34cb0b1d98121$export$2e2bcd8739ae039 = $61d34cb0b1d98121$var$firstNonEmpty;
1296
1296
 
1297
1297
 
1298
+
1298
1299
  async function $5e0a134878b8be39$var$getArrayBuffer(file) {
1299
- return file ? await file.arrayBuffer() : undefined;
1300
+ return file && (0, $dxT2C$lodashes.isFunction)(file.arrayBuffer) ? await file.arrayBuffer() : undefined;
1300
1301
  }
1301
1302
  var $5e0a134878b8be39$export$2e2bcd8739ae039 = $5e0a134878b8be39$var$getArrayBuffer;
1302
1303