← All ivy-nodes
IVYXSTUDIO · IVY NODE
C

Callable

ivy.node.callable · v0.0.0

ivyx

A generic placeholder node for callable function references. This node serves as a template or placeholder for custom callable functions that can be passed between nodes. Currently outputs an empty function reference. Use this node when you need to create custom callable functions for use with other nodes like web-scraping (for next_page_rule or content_processor) or prompt-generator (for creator functions).

#Callable

Inputs

FieldTypeDescription
featuresobjectFeatures
labelsobjectLabels

Outputs

FieldTypeDescription
functionrequiredobjectCallable function reference
featuresobjectFeatures
labelsobjectLabels

Source

python

# Input preparation
inp = __ivy_ctx__["nodes"][__ivy_node_id__]["input"]

# Compute
class Callable:
    """Placeholder callable factory; produces a generic no-op callable reference."""

    def build(self):
        def callable_function(*args, **kwargs):
            return None
        return callable_function

node = Callable()
function = node.build()

# Output collection (runner reads __ivy_ctx__)
out = __ivy_ctx__["nodes"][__ivy_node_id__]["output"]
out["function"] = function

Tests

Requires: python:3.11

  • basic-callable-creation

    Create callable reference (should succeed).

    callablefunctionbasic