@truto/truto-jsonata 1.0.7 → 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.
Files changed (2) hide show
  1. package/README.md +37 -0
  2. package/package.json +1 -1
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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.0.7",
7
+ "version": "1.0.8",
8
8
  "description": "Truto extension of jsonata",
9
9
  "repository": "https://github.com/trutohq/truto-jsonata.git",
10
10
  "source": "src/index.ts",