bem-ai-sdk 0.25.0 → 0.26.0

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.
@@ -593,31 +593,38 @@ export namespace CreateFunction {
593
593
  type: 'enrich';
594
594
 
595
595
  /**
596
- * Configuration for enrich function with semantic search steps.
596
+ * Configuration for an enrich function.
597
597
  *
598
598
  * **How Enrich Functions Work:**
599
599
  *
600
- * Enrich functions use semantic search to augment JSON data with relevant
601
- * information from collections. They take JSON input (typically from a transform
602
- * function), extract specified fields, perform vector-based semantic search
603
- * against collections, and inject the results back into the data.
600
+ * Enrich functions augment JSON input with data from external sources. They take
601
+ * JSON input (typically from a previous function), extract specified fields, fetch
602
+ * or search for matching data, and inject the results back into the JSON.
603
+ *
604
+ * **Data Sources:**
605
+ *
606
+ * - **Collections** (`source: "collection"`): Vector/keyword search against a BEM
607
+ * collection. Best for semantic matching against pre-indexed documents.
608
+ * - **Endpoints** (`source: "endpoint"`): HTTP call to any user-provided REST API.
609
+ * Best for looking up live data from CRMs, ERPs, or other external systems.
610
+ * Optionally uses LLM agent reasoning to rank candidates returned by the
611
+ * endpoint.
604
612
  *
605
613
  * **Input Requirements:**
606
614
  *
607
- * - Must receive JSON input (typically uploaded to S3 from a previous function)
608
- * - Can be chained after transform or other functions that produce JSON output
615
+ * - Must receive JSON input (typically from a previous function's output)
609
616
  *
610
617
  * **Example Use Cases:**
611
618
  *
612
- * - Match product descriptions to SKU codes from a product catalog
613
- * - Enrich customer data with account information
614
- * - Link order line items to inventory records
619
+ * - Match product descriptions to SKU codes from a product catalog collection
620
+ * - Enrich customer data with account details from a CRM endpoint
621
+ * - Use LLM agent reasoning to fuzzy-match line item descriptions to catalog
622
+ * products
615
623
  *
616
624
  * **Configuration:**
617
625
  *
618
- * - Define one or more enrichment steps
619
- * - Each step extracts values, searches a collection, and injects results
620
- * - Steps are executed sequentially
626
+ * - Define named endpoints (for endpoint-source steps)
627
+ * - Define one or more enrichment steps; steps are executed sequentially
621
628
  */
622
629
  config?: FunctionsAPI.EnrichConfig;
623
630
 
@@ -689,43 +696,202 @@ export namespace CreateFunction {
689
696
  }
690
697
 
691
698
  /**
692
- * Configuration for enrich function with semantic search steps.
699
+ * Configuration for an enrich function.
693
700
  *
694
701
  * **How Enrich Functions Work:**
695
702
  *
696
- * Enrich functions use semantic search to augment JSON data with relevant
697
- * information from collections. They take JSON input (typically from a transform
698
- * function), extract specified fields, perform vector-based semantic search
699
- * against collections, and inject the results back into the data.
703
+ * Enrich functions augment JSON input with data from external sources. They take
704
+ * JSON input (typically from a previous function), extract specified fields, fetch
705
+ * or search for matching data, and inject the results back into the JSON.
706
+ *
707
+ * **Data Sources:**
708
+ *
709
+ * - **Collections** (`source: "collection"`): Vector/keyword search against a BEM
710
+ * collection. Best for semantic matching against pre-indexed documents.
711
+ * - **Endpoints** (`source: "endpoint"`): HTTP call to any user-provided REST API.
712
+ * Best for looking up live data from CRMs, ERPs, or other external systems.
713
+ * Optionally uses LLM agent reasoning to rank candidates returned by the
714
+ * endpoint.
700
715
  *
701
716
  * **Input Requirements:**
702
717
  *
703
- * - Must receive JSON input (typically uploaded to S3 from a previous function)
704
- * - Can be chained after transform or other functions that produce JSON output
718
+ * - Must receive JSON input (typically from a previous function's output)
705
719
  *
706
720
  * **Example Use Cases:**
707
721
  *
708
- * - Match product descriptions to SKU codes from a product catalog
709
- * - Enrich customer data with account information
710
- * - Link order line items to inventory records
722
+ * - Match product descriptions to SKU codes from a product catalog collection
723
+ * - Enrich customer data with account details from a CRM endpoint
724
+ * - Use LLM agent reasoning to fuzzy-match line item descriptions to catalog
725
+ * products
711
726
  *
712
727
  * **Configuration:**
713
728
  *
714
- * - Define one or more enrichment steps
715
- * - Each step extracts values, searches a collection, and injects results
716
- * - Steps are executed sequentially
729
+ * - Define named endpoints (for endpoint-source steps)
730
+ * - Define one or more enrichment steps; steps are executed sequentially
717
731
  */
718
732
  export interface EnrichConfig {
719
733
  /**
720
- * Array of enrichment steps to execute sequentially
734
+ * Array of enrichment steps to execute sequentially.
721
735
  */
722
736
  steps: Array<EnrichStep>;
737
+
738
+ /**
739
+ * Named HTTP endpoints available to endpoint-source steps. Each endpoint must have
740
+ * a unique `name` referenced by the step's `endpointName`. Required when any step
741
+ * uses `source: "endpoint"`.
742
+ */
743
+ endpoints?: Array<EnrichConfig.Endpoint>;
744
+ }
745
+
746
+ export namespace EnrichConfig {
747
+ /**
748
+ * A named HTTP endpoint that an enrich step can call to fetch enrichment data.
749
+ *
750
+ * The platform makes one request per extracted source value, substituting the
751
+ * value as a query parameter or body template placeholder. The raw response (or
752
+ * the sub-value selected by `responsePath`) is injected into the output, or passed
753
+ * to LLM agent reasoning when `matchInstructions` is set.
754
+ *
755
+ * **Request formats:**
756
+ *
757
+ * - `GET`: Appends `?{queryParam}={value}` to the URL.
758
+ * - `POST`: Sends `bodyTemplate` as the request body, replacing `{value}` with the
759
+ * extracted value.
760
+ */
761
+ export interface Endpoint {
762
+ /**
763
+ * HTTP method to use.
764
+ */
765
+ method: 'GET' | 'POST';
766
+
767
+ /**
768
+ * Unique name for this endpoint, referenced by enrichStep.endpointName.
769
+ */
770
+ name: string;
771
+
772
+ /**
773
+ * Full URL of the endpoint (must be http:// or https://).
774
+ */
775
+ url: string;
776
+
777
+ /**
778
+ * JSON body template for POST requests. **Required for POST endpoints.** Must
779
+ * contain the `{value}` placeholder, which is replaced with the extracted source
780
+ * value at runtime.
781
+ *
782
+ * Example: `bodyTemplate: "{\"query\": \"{value}\", \"limit\": 10}"`
783
+ */
784
+ bodyTemplate?: string;
785
+
786
+ /**
787
+ * Additional HTTP headers to include in every request (e.g.
788
+ * `Authorization: Bearer <token>`).
789
+ */
790
+ headers?: unknown;
791
+
792
+ /**
793
+ * Natural-language instructions for LLM agent reasoning.
794
+ *
795
+ * When set, the candidates fetched from the endpoint are passed to an LLM with
796
+ * these instructions, which selects the best match(es) and returns them with
797
+ * confidence scores. Each injected result has the shape
798
+ * `{ data, confidence, reasoning? }`.
799
+ *
800
+ * When omitted, the raw fetched value is injected without any LLM involvement.
801
+ */
802
+ matchInstructions?: string;
803
+
804
+ /**
805
+ * Maximum number of ranked matches to return per source value when
806
+ * `matchInstructions` is set (default: 1). Ignored when `matchInstructions` is
807
+ * empty.
808
+ */
809
+ matchTopK?: number;
810
+
811
+ /**
812
+ * LLM batch size during agent reasoning (default: 50). All candidates — across all
813
+ * fetched pages — are scored in batches of this size. Smaller values reduce
814
+ * per-call token usage; larger values mean fewer LLM calls. Ignored when
815
+ * `matchInstructions` is empty.
816
+ */
817
+ maxCandidates?: number;
818
+
819
+ /**
820
+ * Maximum number of pages to fetch (default: 10). Acts as a safety cap against
821
+ * infinite pagination loops when the server never returns an empty cursor.
822
+ */
823
+ maxPages?: number;
824
+
825
+ /**
826
+ * Query parameter name used to pass the cursor on subsequent GET requests, or the
827
+ * `{placeholder}` name used in the POST `bodyTemplate` (e.g. `"cursor"`,
828
+ * `"pageToken"`, `"offset"`).
829
+ *
830
+ * Must be set together with `nextPagePath`.
831
+ */
832
+ nextPageParam?: string;
833
+
834
+ /**
835
+ * JMESPath expression applied to each raw response to extract the cursor or token
836
+ * for the next page (e.g. `"nextCursor"`, `"pagination.nextToken"`). An absent,
837
+ * null, or empty-string result stops pagination. Both string and numeric values
838
+ * are supported — numbers are converted to their decimal string representation
839
+ * before being forwarded as a query parameter.
840
+ *
841
+ * Must be set together with `nextPageParam`.
842
+ *
843
+ * **Supported pagination styles:**
844
+ *
845
+ * - **Cursor/token-based** — server returns an opaque token in the response body
846
+ * (e.g. `{"nextCursor": "abc123"}`). Set `nextPagePath: "nextCursor"` and the
847
+ * platform forwards it verbatim on the next request.
848
+ * - **Server-computed offset/page** — server echoes back the next offset or page
849
+ * number in the response body (e.g. `{"nextOffset": 50}` or `{"nextPage": 2}`).
850
+ * Set `nextPagePath: "nextOffset"` and the platform forwards the value as-is.
851
+ *
852
+ * **Not supported:**
853
+ *
854
+ * - **Client-computed offset** — APIs where the client must compute
855
+ * `offset += limit` itself (e.g. `?offset=0&limit=50` with no next-offset in the
856
+ * response). Workaround: ask the API provider to return the next offset in the
857
+ * response body, or bake a fixed page size into the URL and use a server-side
858
+ * cursor instead.
859
+ * - **Client-computed page number** — APIs where the client increments `?page=N`
860
+ * itself with no next-page value in the response. Same workaround applies.
861
+ * - **Link header** — `Link: <url>; rel="next"` in HTTP response headers. The
862
+ * platform only inspects the response body.
863
+ */
864
+ nextPagePath?: string;
865
+
866
+ /**
867
+ * Query parameter name used to pass the extracted source value. **Required for GET
868
+ * endpoints.** The value is URL-encoded and appended as
869
+ * `?{queryParam}={sourceValue}`.
870
+ *
871
+ * Example: `queryParam: "q"` → `GET /products?q=blue+widget`
872
+ */
873
+ queryParam?: string;
874
+
875
+ /**
876
+ * JMESPath expression applied to the response body to extract the enrichment
877
+ * value. Omit to use the entire response body as the result.
878
+ *
879
+ * **For agent reasoning:** use a wildcard projection (e.g. `items[*]` or
880
+ * `results[*].data`) so the endpoint's list of candidates is flattened into an
881
+ * array before being passed to the LLM. A non-wildcard path (e.g. `data.product`)
882
+ * extracts a single value treated as one candidate.
883
+ *
884
+ * **Response size:** the platform reads at most 50 MB of the response body before
885
+ * decoding, regardless of the Content-Length header.
886
+ */
887
+ responsePath?: string;
888
+ }
723
889
  }
724
890
 
725
891
  /**
726
892
  * Single enrichment step configuration.
727
893
  *
728
- * **Process Flow:**
894
+ * **Process Flow (collection source):**
729
895
  *
730
896
  * 1. Extract values from `sourceField` using JMESPath
731
897
  * 2. Perform search against the specified collection (semantic, exact, or hybrid
@@ -733,33 +899,41 @@ export interface EnrichConfig {
733
899
  * 3. Return top K matches sorted by relevance (best match first)
734
900
  * 4. Inject results into `targetField`
735
901
  *
736
- * **Search Modes:**
902
+ * **Process Flow (endpoint source):**
737
903
  *
738
- * - `semantic` (default): Vector similarity search - best for natural language and
904
+ * 1. Extract values from `sourceField` using JMESPath
905
+ * 2. Call the named endpoint once per extracted value, following pagination if
906
+ * `nextPagePath`/`nextPageParam` are configured on the endpoint
907
+ * 3. Optionally apply LLM agent reasoning to rank candidates
908
+ * (`matchInstructions`), batching across all fetched pages in groups of
909
+ * `maxCandidates`
910
+ * 4. Inject results into `targetField`
911
+ *
912
+ * **Collection Search Modes** (`source: "collection"` only):
913
+ *
914
+ * - `semantic` (default): Vector similarity search — best for natural language and
739
915
  * conceptual matching
740
- * - `exact`: Exact keyword matching - best for SKU numbers, IDs, routing numbers
741
- * - `hybrid`: Combined semantic + keyword search - best for tags and categories
916
+ * - `exact`: Exact keyword matching best for SKU numbers, IDs, routing numbers
917
+ * - `hybrid`: Combined semantic + keyword search best for tags and categories
918
+ *
919
+ * **Result Format (collection source):**
920
+ *
921
+ * - Always an array sorted by relevance (best match first)
922
+ * - Each element: `{ data, cosineDistance? }` or `{ data, hybridScore? }`
923
+ *
924
+ * **Result Format (endpoint source, no matchInstructions):**
742
925
  *
743
- * **Result Format:**
926
+ * - Always an array; the raw fetched value is the single element
744
927
  *
745
- * - Results are always returned as an array (list), regardless of `topK` value
746
- * - Array is sorted by relevance (best match first)
747
- * - Each result contains `data` (the collection item) and optionally
748
- * `cosineDistance`
749
- * - With `topK=1`: Returns array with single best match:
750
- * `[{data: {...}, cosineDistance: 0.15}]`
751
- * - With `topK>1`: Returns array with multiple matches sorted by relevance
928
+ * **Result Format (endpoint source, with matchInstructions):**
929
+ *
930
+ * - Array of LLM-ranked matches: `[{ data, confidence, reasoning? }, ...]`
931
+ * - Length capped by `enrichEndpoint.matchTopK` (default 1)
752
932
  */
753
933
  export interface EnrichStep {
754
934
  /**
755
- * Name of the collection to search against. The collection must exist and contain
756
- * items. Supports hierarchical paths when used with `includeSubcollections`.
757
- */
758
- collectionName: string;
759
-
760
- /**
761
- * JMESPath expression to extract source data for semantic search. Can extract
762
- * single values or arrays. All extracted values will be used for search.
935
+ * JMESPath expression to extract source data. Can extract a single value or an
936
+ * array. Each extracted value is looked up independently.
763
937
  */
764
938
  sourceField: string;
765
939
 
@@ -770,6 +944,19 @@ export interface EnrichStep {
770
944
  */
771
945
  targetField: string;
772
946
 
947
+ /**
948
+ * Name of the collection to search against. Required when `source` is
949
+ * `"collection"`. The collection must exist and contain items. Supports
950
+ * hierarchical paths when used with `includeSubcollections`.
951
+ */
952
+ collectionName?: string;
953
+
954
+ /**
955
+ * Name of an endpoint defined in `enrichConfig.endpoints`. Required when `source`
956
+ * is `"endpoint"`.
957
+ */
958
+ endpointName?: string;
959
+
773
960
  /**
774
961
  * Whether to include cosine distance scores in results. Cosine distance ranges
775
962
  * from 0.0 (perfect match) to 2.0 (completely dissimilar). Lower scores indicate
@@ -828,6 +1015,16 @@ export interface EnrichStep {
828
1015
  */
829
1016
  searchMode?: 'semantic' | 'exact' | 'hybrid';
830
1017
 
1018
+ /**
1019
+ * Where to fetch enrichment data from (default: `"collection"`).
1020
+ *
1021
+ * - `"collection"`: Vector/keyword search against a BEM collection. Requires
1022
+ * `collectionName`.
1023
+ * - `"endpoint"`: HTTP call to a named endpoint defined in
1024
+ * `enrichConfig.endpoints`. Requires `endpointName`.
1025
+ */
1026
+ source?: 'collection' | 'endpoint';
1027
+
831
1028
  /**
832
1029
  * Number of top matching results to return per query (default: 1). Results are
833
1030
  * always returned as an array (list) and automatically sorted by cosine distance
@@ -1365,31 +1562,38 @@ export namespace Function {
1365
1562
 
1366
1563
  export interface EnrichFunction {
1367
1564
  /**
1368
- * Configuration for enrich function with semantic search steps.
1565
+ * Configuration for an enrich function.
1369
1566
  *
1370
1567
  * **How Enrich Functions Work:**
1371
1568
  *
1372
- * Enrich functions use semantic search to augment JSON data with relevant
1373
- * information from collections. They take JSON input (typically from a transform
1374
- * function), extract specified fields, perform vector-based semantic search
1375
- * against collections, and inject the results back into the data.
1569
+ * Enrich functions augment JSON input with data from external sources. They take
1570
+ * JSON input (typically from a previous function), extract specified fields, fetch
1571
+ * or search for matching data, and inject the results back into the JSON.
1572
+ *
1573
+ * **Data Sources:**
1574
+ *
1575
+ * - **Collections** (`source: "collection"`): Vector/keyword search against a BEM
1576
+ * collection. Best for semantic matching against pre-indexed documents.
1577
+ * - **Endpoints** (`source: "endpoint"`): HTTP call to any user-provided REST API.
1578
+ * Best for looking up live data from CRMs, ERPs, or other external systems.
1579
+ * Optionally uses LLM agent reasoning to rank candidates returned by the
1580
+ * endpoint.
1376
1581
  *
1377
1582
  * **Input Requirements:**
1378
1583
  *
1379
- * - Must receive JSON input (typically uploaded to S3 from a previous function)
1380
- * - Can be chained after transform or other functions that produce JSON output
1584
+ * - Must receive JSON input (typically from a previous function's output)
1381
1585
  *
1382
1586
  * **Example Use Cases:**
1383
1587
  *
1384
- * - Match product descriptions to SKU codes from a product catalog
1385
- * - Enrich customer data with account information
1386
- * - Link order line items to inventory records
1588
+ * - Match product descriptions to SKU codes from a product catalog collection
1589
+ * - Enrich customer data with account details from a CRM endpoint
1590
+ * - Use LLM agent reasoning to fuzzy-match line item descriptions to catalog
1591
+ * products
1387
1592
  *
1388
1593
  * **Configuration:**
1389
1594
  *
1390
- * - Define one or more enrichment steps
1391
- * - Each step extracts values, searches a collection, and injects results
1392
- * - Steps are executed sequentially
1595
+ * - Define named endpoints (for endpoint-source steps)
1596
+ * - Define one or more enrichment steps; steps are executed sequentially
1393
1597
  */
1394
1598
  config: FunctionsAPI.EnrichConfig;
1395
1599
 
@@ -1908,31 +2112,38 @@ export namespace UpdateFunction {
1908
2112
  type: 'enrich';
1909
2113
 
1910
2114
  /**
1911
- * Configuration for enrich function with semantic search steps.
2115
+ * Configuration for an enrich function.
1912
2116
  *
1913
2117
  * **How Enrich Functions Work:**
1914
2118
  *
1915
- * Enrich functions use semantic search to augment JSON data with relevant
1916
- * information from collections. They take JSON input (typically from a transform
1917
- * function), extract specified fields, perform vector-based semantic search
1918
- * against collections, and inject the results back into the data.
2119
+ * Enrich functions augment JSON input with data from external sources. They take
2120
+ * JSON input (typically from a previous function), extract specified fields, fetch
2121
+ * or search for matching data, and inject the results back into the JSON.
2122
+ *
2123
+ * **Data Sources:**
2124
+ *
2125
+ * - **Collections** (`source: "collection"`): Vector/keyword search against a BEM
2126
+ * collection. Best for semantic matching against pre-indexed documents.
2127
+ * - **Endpoints** (`source: "endpoint"`): HTTP call to any user-provided REST API.
2128
+ * Best for looking up live data from CRMs, ERPs, or other external systems.
2129
+ * Optionally uses LLM agent reasoning to rank candidates returned by the
2130
+ * endpoint.
1919
2131
  *
1920
2132
  * **Input Requirements:**
1921
2133
  *
1922
- * - Must receive JSON input (typically uploaded to S3 from a previous function)
1923
- * - Can be chained after transform or other functions that produce JSON output
2134
+ * - Must receive JSON input (typically from a previous function's output)
1924
2135
  *
1925
2136
  * **Example Use Cases:**
1926
2137
  *
1927
- * - Match product descriptions to SKU codes from a product catalog
1928
- * - Enrich customer data with account information
1929
- * - Link order line items to inventory records
2138
+ * - Match product descriptions to SKU codes from a product catalog collection
2139
+ * - Enrich customer data with account details from a CRM endpoint
2140
+ * - Use LLM agent reasoning to fuzzy-match line item descriptions to catalog
2141
+ * products
1930
2142
  *
1931
2143
  * **Configuration:**
1932
2144
  *
1933
- * - Define one or more enrichment steps
1934
- * - Each step extracts values, searches a collection, and injects results
1935
- * - Steps are executed sequentially
2145
+ * - Define named endpoints (for endpoint-source steps)
2146
+ * - Define one or more enrichment steps; steps are executed sequentially
1936
2147
  */
1937
2148
  config?: FunctionsAPI.EnrichConfig;
1938
2149
  }
@@ -3529,31 +3740,38 @@ export declare namespace FunctionCreateParams {
3529
3740
  type: 'enrich';
3530
3741
 
3531
3742
  /**
3532
- * Configuration for enrich function with semantic search steps.
3743
+ * Configuration for an enrich function.
3533
3744
  *
3534
3745
  * **How Enrich Functions Work:**
3535
3746
  *
3536
- * Enrich functions use semantic search to augment JSON data with relevant
3537
- * information from collections. They take JSON input (typically from a transform
3538
- * function), extract specified fields, perform vector-based semantic search
3539
- * against collections, and inject the results back into the data.
3747
+ * Enrich functions augment JSON input with data from external sources. They take
3748
+ * JSON input (typically from a previous function), extract specified fields, fetch
3749
+ * or search for matching data, and inject the results back into the JSON.
3750
+ *
3751
+ * **Data Sources:**
3752
+ *
3753
+ * - **Collections** (`source: "collection"`): Vector/keyword search against a BEM
3754
+ * collection. Best for semantic matching against pre-indexed documents.
3755
+ * - **Endpoints** (`source: "endpoint"`): HTTP call to any user-provided REST API.
3756
+ * Best for looking up live data from CRMs, ERPs, or other external systems.
3757
+ * Optionally uses LLM agent reasoning to rank candidates returned by the
3758
+ * endpoint.
3540
3759
  *
3541
3760
  * **Input Requirements:**
3542
3761
  *
3543
- * - Must receive JSON input (typically uploaded to S3 from a previous function)
3544
- * - Can be chained after transform or other functions that produce JSON output
3762
+ * - Must receive JSON input (typically from a previous function's output)
3545
3763
  *
3546
3764
  * **Example Use Cases:**
3547
3765
  *
3548
- * - Match product descriptions to SKU codes from a product catalog
3549
- * - Enrich customer data with account information
3550
- * - Link order line items to inventory records
3766
+ * - Match product descriptions to SKU codes from a product catalog collection
3767
+ * - Enrich customer data with account details from a CRM endpoint
3768
+ * - Use LLM agent reasoning to fuzzy-match line item descriptions to catalog
3769
+ * products
3551
3770
  *
3552
3771
  * **Configuration:**
3553
3772
  *
3554
- * - Define one or more enrichment steps
3555
- * - Each step extracts values, searches a collection, and injects results
3556
- * - Steps are executed sequentially
3773
+ * - Define named endpoints (for endpoint-source steps)
3774
+ * - Define one or more enrichment steps; steps are executed sequentially
3557
3775
  */
3558
3776
  config?: EnrichConfig;
3559
3777
 
@@ -3876,31 +4094,38 @@ export declare namespace FunctionUpdateParams {
3876
4094
  type: 'enrich';
3877
4095
 
3878
4096
  /**
3879
- * Configuration for enrich function with semantic search steps.
4097
+ * Configuration for an enrich function.
3880
4098
  *
3881
4099
  * **How Enrich Functions Work:**
3882
4100
  *
3883
- * Enrich functions use semantic search to augment JSON data with relevant
3884
- * information from collections. They take JSON input (typically from a transform
3885
- * function), extract specified fields, perform vector-based semantic search
3886
- * against collections, and inject the results back into the data.
4101
+ * Enrich functions augment JSON input with data from external sources. They take
4102
+ * JSON input (typically from a previous function), extract specified fields, fetch
4103
+ * or search for matching data, and inject the results back into the JSON.
4104
+ *
4105
+ * **Data Sources:**
4106
+ *
4107
+ * - **Collections** (`source: "collection"`): Vector/keyword search against a BEM
4108
+ * collection. Best for semantic matching against pre-indexed documents.
4109
+ * - **Endpoints** (`source: "endpoint"`): HTTP call to any user-provided REST API.
4110
+ * Best for looking up live data from CRMs, ERPs, or other external systems.
4111
+ * Optionally uses LLM agent reasoning to rank candidates returned by the
4112
+ * endpoint.
3887
4113
  *
3888
4114
  * **Input Requirements:**
3889
4115
  *
3890
- * - Must receive JSON input (typically uploaded to S3 from a previous function)
3891
- * - Can be chained after transform or other functions that produce JSON output
4116
+ * - Must receive JSON input (typically from a previous function's output)
3892
4117
  *
3893
4118
  * **Example Use Cases:**
3894
4119
  *
3895
- * - Match product descriptions to SKU codes from a product catalog
3896
- * - Enrich customer data with account information
3897
- * - Link order line items to inventory records
4120
+ * - Match product descriptions to SKU codes from a product catalog collection
4121
+ * - Enrich customer data with account details from a CRM endpoint
4122
+ * - Use LLM agent reasoning to fuzzy-match line item descriptions to catalog
4123
+ * products
3898
4124
  *
3899
4125
  * **Configuration:**
3900
4126
  *
3901
- * - Define one or more enrichment steps
3902
- * - Each step extracts values, searches a collection, and injects results
3903
- * - Steps are executed sequentially
4127
+ * - Define named endpoints (for endpoint-source steps)
4128
+ * - Define one or more enrichment steps; steps are executed sequentially
3904
4129
  */
3905
4130
  config?: EnrichConfig;
3906
4131
  }
@@ -539,31 +539,38 @@ export namespace FunctionVersion {
539
539
 
540
540
  export interface EnrichFunctionVersion {
541
541
  /**
542
- * Configuration for enrich function with semantic search steps.
542
+ * Configuration for an enrich function.
543
543
  *
544
544
  * **How Enrich Functions Work:**
545
545
  *
546
- * Enrich functions use semantic search to augment JSON data with relevant
547
- * information from collections. They take JSON input (typically from a transform
548
- * function), extract specified fields, perform vector-based semantic search
549
- * against collections, and inject the results back into the data.
546
+ * Enrich functions augment JSON input with data from external sources. They take
547
+ * JSON input (typically from a previous function), extract specified fields, fetch
548
+ * or search for matching data, and inject the results back into the JSON.
549
+ *
550
+ * **Data Sources:**
551
+ *
552
+ * - **Collections** (`source: "collection"`): Vector/keyword search against a BEM
553
+ * collection. Best for semantic matching against pre-indexed documents.
554
+ * - **Endpoints** (`source: "endpoint"`): HTTP call to any user-provided REST API.
555
+ * Best for looking up live data from CRMs, ERPs, or other external systems.
556
+ * Optionally uses LLM agent reasoning to rank candidates returned by the
557
+ * endpoint.
550
558
  *
551
559
  * **Input Requirements:**
552
560
  *
553
- * - Must receive JSON input (typically uploaded to S3 from a previous function)
554
- * - Can be chained after transform or other functions that produce JSON output
561
+ * - Must receive JSON input (typically from a previous function's output)
555
562
  *
556
563
  * **Example Use Cases:**
557
564
  *
558
- * - Match product descriptions to SKU codes from a product catalog
559
- * - Enrich customer data with account information
560
- * - Link order line items to inventory records
565
+ * - Match product descriptions to SKU codes from a product catalog collection
566
+ * - Enrich customer data with account details from a CRM endpoint
567
+ * - Use LLM agent reasoning to fuzzy-match line item descriptions to catalog
568
+ * products
561
569
  *
562
570
  * **Configuration:**
563
571
  *
564
- * - Define one or more enrichment steps
565
- * - Each step extracts values, searches a collection, and injects results
566
- * - Steps are executed sequentially
572
+ * - Define named endpoints (for endpoint-source steps)
573
+ * - Define one or more enrichment steps; steps are executed sequentially
567
574
  */
568
575
  config: FunctionsAPI.EnrichConfig;
569
576
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.25.0'; // x-release-please-version
1
+ export const VERSION = '0.26.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.25.0";
1
+ export declare const VERSION = "0.26.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.25.0";
1
+ export declare const VERSION = "0.26.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.25.0'; // x-release-please-version
4
+ exports.VERSION = '0.26.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.25.0'; // x-release-please-version
1
+ export const VERSION = '0.26.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map