Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Functions

Share reusable code across notebooks, with versions.

A function asset is reusable code, such as a function or class, that you write once and use across notebooks. Use functions for code your team shares, such as a standard way to load positions data or calculate risk metrics, so everyone uses the same version.

Find them under Assets → Functions.

What a function contains

Each version of a function holds:

Part
Details

Code

The function or class itself

Requirements

The packages it needs, each with a version rule, such as pandas >= 2.0

Imports

The imports the code needs

Language

The language and language version it's written in

Versions

Functions are versioned, like constants. Each change creates a new version, and a notebook uses the specific version attached to it. Updating a function doesn't change notebooks using an older version until you switch them.

This lets you improve shared code without breaking work that depends on the old behavior.

Using a function in a notebook

Attach the function to a notebook, optionally with an alias. A notebook can't have the same function attached twice, or two functions with the same name.

Functions, DAGs and skills

A function shares code. A DAG shares a whole pipeline of connected blocks. A skill shares instructions for the agent, such as how your team backtests a strategy. They work well together: a skill can tell the agent to use your team's functions.

Last updated

Was this helpful?