A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
from __future__ import annotations
from marimo._ai._types import ChatMessage, ChatModelConfig
from marimo._ai.llm._impl import simple
def test_simple_model():
model = simple(lambda x: x * 2)
assert (
model([ChatMessage(role="user", content="hey")], ChatModelConfig())
== "heyhey"
)
assert (
model(
[
ChatMessage(role="user", content="hey", attachments=[]),
ChatMessage(role="user", content="goodbye", attachments=[]),
],
ChatModelConfig(),
)
== "goodbyegoodbye"
)