Skip to content

Client

Bases: ToolClient

Base client for operators following the same pattern as ToolClient. Handles validation, execution, and result formatting for operators.

Source code in blue/operators/client.py
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
class OperatorClient(ToolClient):
    """
    Base client for operators following the same pattern as ToolClient.
    Handles validation, execution, and result formatting for operators.
    """

    def __init__(self, name: str = "OperatorClient", properties: Dict[str, Any] = None):
        """Initialize the OperatorClient.

        Parameters:
            name: Name of the client. Defaults to "OperatorClient".
            properties: Properties for the client. Defaults to None.
        """
        super().__init__(name, properties=properties or {})

    ## _intialize, _start, _stop, _connect, _disconnect, _start_connection, _stop_connection, _initialize_properties, _update_properties inherited from ToolClient

    ######### server
    def fetch_metadata(self):
        """Fetch metadata about the operator client.

        Returns:
            Dictionary containing metadata information.
        """
        return self.fetch_metadata()

    ######### operator
    def fetch_operators(self):
        """Fetch available operators.

        Returns:
            List of available operators.
        """
        return self.fetch_tools()

    def fetch_operator_metadata(self, operator):
        """Fetch metadata for a specific operator.

        Parameters:
            operator: Name of the operator.

        Returns:
            Dictionary containing operator metadata.
        """
        return self.fetch_tool_metadata(operator)

    def execute_operator(self, operator, args=None, kwargs=None):
        """Execute a specific operator with given arguments.

        Parameters:
            operator: Name of the operator.
            args: Arguments for the operator. Defaults to None.
            kwargs: Keyword arguments for the operator. Defaults to None.

        Returns:
            Result of the operator execution
        """
        return self.execute_tool(operator, args=args, kwargs=kwargs)

    def refine_operator(self, operator, args=None, kwargs=None):
        """Refine the operator based on given arguments, returns list of possible refinements as DataPipeline objects.

        Parameters:
            operator: Name of the operator.
            args: Arguments for the operator. Defaults to None.
            kwargs: Keyword arguments for the operator. Defaults to None.

        Returns:
            List of possible refinements as DataPipeline objects.
        """
        return []

    def get_operator_attributes(self, operator):
        """Get attributes of a specific operator.

        Parameters:
            operator: Name of the operator.

        Returns:
            Dictionary of operator attributes.
        """
        return {}

__init__(name='OperatorClient', properties=None)

Initialize the OperatorClient.

Parameters:

Name Type Description Default
name str

Name of the client. Defaults to "OperatorClient".

'OperatorClient'
properties Dict[str, Any]

Properties for the client. Defaults to None.

None
Source code in blue/operators/client.py
23
24
25
26
27
28
29
30
def __init__(self, name: str = "OperatorClient", properties: Dict[str, Any] = None):
    """Initialize the OperatorClient.

    Parameters:
        name: Name of the client. Defaults to "OperatorClient".
        properties: Properties for the client. Defaults to None.
    """
    super().__init__(name, properties=properties or {})

execute_operator(operator, args=None, kwargs=None)

Execute a specific operator with given arguments.

Parameters:

Name Type Description Default
operator

Name of the operator.

required
args

Arguments for the operator. Defaults to None.

None
kwargs

Keyword arguments for the operator. Defaults to None.

None

Returns:

Type Description

Result of the operator execution

Source code in blue/operators/client.py
63
64
65
66
67
68
69
70
71
72
73
74
def execute_operator(self, operator, args=None, kwargs=None):
    """Execute a specific operator with given arguments.

    Parameters:
        operator: Name of the operator.
        args: Arguments for the operator. Defaults to None.
        kwargs: Keyword arguments for the operator. Defaults to None.

    Returns:
        Result of the operator execution
    """
    return self.execute_tool(operator, args=args, kwargs=kwargs)

fetch_metadata()

Fetch metadata about the operator client.

Returns:

Type Description

Dictionary containing metadata information.

Source code in blue/operators/client.py
35
36
37
38
39
40
41
def fetch_metadata(self):
    """Fetch metadata about the operator client.

    Returns:
        Dictionary containing metadata information.
    """
    return self.fetch_metadata()

fetch_operator_metadata(operator)

Fetch metadata for a specific operator.

Parameters:

Name Type Description Default
operator

Name of the operator.

required

Returns:

Type Description

Dictionary containing operator metadata.

Source code in blue/operators/client.py
52
53
54
55
56
57
58
59
60
61
def fetch_operator_metadata(self, operator):
    """Fetch metadata for a specific operator.

    Parameters:
        operator: Name of the operator.

    Returns:
        Dictionary containing operator metadata.
    """
    return self.fetch_tool_metadata(operator)

fetch_operators()

Fetch available operators.

Returns:

Type Description

List of available operators.

Source code in blue/operators/client.py
44
45
46
47
48
49
50
def fetch_operators(self):
    """Fetch available operators.

    Returns:
        List of available operators.
    """
    return self.fetch_tools()

get_operator_attributes(operator)

Get attributes of a specific operator.

Parameters:

Name Type Description Default
operator

Name of the operator.

required

Returns:

Type Description

Dictionary of operator attributes.

Source code in blue/operators/client.py
89
90
91
92
93
94
95
96
97
98
def get_operator_attributes(self, operator):
    """Get attributes of a specific operator.

    Parameters:
        operator: Name of the operator.

    Returns:
        Dictionary of operator attributes.
    """
    return {}

refine_operator(operator, args=None, kwargs=None)

Refine the operator based on given arguments, returns list of possible refinements as DataPipeline objects.

Parameters:

Name Type Description Default
operator

Name of the operator.

required
args

Arguments for the operator. Defaults to None.

None
kwargs

Keyword arguments for the operator. Defaults to None.

None

Returns:

Type Description

List of possible refinements as DataPipeline objects.

Source code in blue/operators/client.py
76
77
78
79
80
81
82
83
84
85
86
87
def refine_operator(self, operator, args=None, kwargs=None):
    """Refine the operator based on given arguments, returns list of possible refinements as DataPipeline objects.

    Parameters:
        operator: Name of the operator.
        args: Arguments for the operator. Defaults to None.
        kwargs: Keyword arguments for the operator. Defaults to None.

    Returns:
        List of possible refinements as DataPipeline objects.
    """
    return []
Last update: 2025-10-08