OpenProgram Docs

Pure Python

def word_count(text: str) -> int:
    """Count the number of words in a text.

    Args:
        text: Input text.

    Returns:
        The word count.
    """
    return len(text.split())
OperationImplementation
Fixed algorithm, data conversion, counting, file reading and writing, mathOrdinary Python helper or Agent method; no llm(), no runtime parameter, a standard Google-style docstring
Natural-language generation, classification, reasoningExplicit agent() or self(...) request

In the session DAG

from openprogram import Agent

class TextAgent(Agent):
    def word_count(self, text: str) -> int:
        """Count words."""
        return len(text.split())
FunctionRecording
Agent method that starts an executionRecorded; needs no model request or tool registration
Helper nested in that execution, or in a managed Program sourceRuns in the active call scope; no node of its own
Arbitrary host functionNot captured

Being deterministic does not decide recording. Set tool=True only when the model should be able to call it.

Last updated · 2026-11-25