Last active
June 30, 2025 16:10
-
-
Save chand1012/218372f3e1101dfa7f915dc35c0e66d8 to your computer and use it in GitHub Desktop.
Magentic and PEP 723 example. https://chand1012.mit-license.org
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S uv run --script | |
# /// script | |
# requires-python = ">=3.10" | |
# dependencies = [ | |
# "fire", | |
# "magentic" | |
# ] | |
# /// | |
import fire | |
from magentic import prompt | |
@prompt('Add more "dude"ness to: {phrase}') | |
def dudeify(phrase: str) -> str: ... # No function body as this is never executed | |
if __name__=="__main__": | |
fire.Fire(dudeify) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Be sure to put a space between the triple slashes and the word

script
in the metadata! I didn't do this on the version revision and it doesn't work!