Skip to content

Exploration

Try Alloy interactively with ask() and your first @command (3 minutes).


Freeform Q&A

from alloy import ask
print(ask("Say hello!"))

First command

from alloy import command

@command
def summarize(text: str) -> str:
    return f"Summarize in one sentence: {text}"

print(summarize("Alloy lets you write typed AI functions in Python."))

See on GitHub