Ben Brink
10/21/2024, 2:18 PMNate
10/21/2024, 2:20 PMBen Brink
10/21/2024, 2:21 PMNate
10/21/2024, 2:24 PMOPENAI_API_KEY
and then use from openai import OpenAI; OpenAI()
etcBen Brink
10/21/2024, 2:30 PMNate
10/21/2024, 2:31 PMNate
10/21/2024, 2:32 PMBen Brink
10/21/2024, 2:33 PMBen Brink
10/21/2024, 2:37 PMNate
10/21/2024, 2:43 PM@task
on top of functions that you want to be able to add retries or caching to (tasks are atomic pieces of work)
• add @flow
on top of functions you want to deploy (flows compose other pieces of work)
so the bare minimum to "do prefect" is
pip install -U prefect
main.py
import prefect
@flow
def arbitrary_python_code(x: int, y: str, z: bool):
pass
if __name__ == "__main__":
arbitrary_python_code(42, "foo", False)