Semantic transform operator
SemanticTransformOperator
Bases: Operator, ServiceClient
Operator that transforms data into target fields and values using LLM-based transformations.
Attributes:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
input_meta |
dict | {} | Optional metadata about input fields | |
output_desc |
dict | N/A | Required description of target fields to create | |
strategy |
str | "auto" | Execution strategy: 'auto' (automatic cost-based selection), 'per_record' (one LLM call per record), 'distinct_required_values' (deduplicate by distinct values), 'distinct_required_values_with_merged_fields' (merged distinct optimization) |
Source code in blue/operators/semantic_transform_operator.py
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 | |
semantic_transform_operator_explainer(output, input_data, attributes)
Generate explanation for semantic transform operator execution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
Any
|
The output result from the operator execution. |
required |
input_data
|
List[List[Dict[str, Any]]]
|
The input data that was processed. |
required |
attributes
|
Dict[str, Any]
|
The attributes used for the operation. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dictionary containing explanation of the operation. |
Source code in blue/operators/semantic_transform_operator.py
107 108 109 110 111 112 113 114 115 116 117 118 | |
semantic_transform_operator_function(input_data, attributes, properties=None)
Transform data into target fields and values using LLM-based transformations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_data
|
List[List[Dict[str, Any]]]
|
List of JSON arrays (List[List[Dict[str, Any]]]) containing records to transform. |
required |
attributes
|
Dict[str, Any]
|
Dictionary containing transformation parameters including input_meta, output_desc, and strategy. |
required |
properties
|
Dict[str, Any]
|
Optional properties dictionary containing service configuration. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
List[List[Dict[str, Any]]]
|
List containing transformed records with target fields and values. |
Source code in blue/operators/semantic_transform_operator.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
semantic_transform_operator_validator(input_data, attributes, properties=None)
Validate semantic transform operator attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_data
|
List[List[Dict[str, Any]]]
|
List of JSON arrays (List[List[Dict[str, Any]]]) to validate. |
required |
attributes
|
Dict[str, Any]
|
Dictionary containing operator attributes to validate. |
required |
properties
|
Dict[str, Any]
|
Optional properties dictionary. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if attributes are valid, False otherwise. |
Source code in blue/operators/semantic_transform_operator.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | |