@Marvin I've joined Prefect Cloud. Why can't I see...
# ask-marvin
b
@Marvin I've joined Prefect Cloud. Why can't I see openAI under blocks?
n
hi @Ben Brink - there is not an official OpenAI block - what are you looking for?
b
Thanks. I'm looking to connect an LLM
n
gotcha! is it openai? i.e. can you just set
OPENAI_API_KEY
and then use
from openai import OpenAI; OpenAI()
etc
b
I'm trying to learn RAG through Prefect, so I am not that experienced. I saw that there were several OpenAI blocks in the blocks section on a youtube tutorial about Prefect, and thought that I could learn something by looking at them.
n
ah! so in Prefect you're free to make custom blocks and then register them to your workspace, perhaps someone had done that @Marvin tldr prefect blocks
🧐 1
you might be interested in this example, which is roughly what I do to refresh the knowledge base for this chatbot here
b
Thanks. That explains why I could't find them. I will look at your example
Where do I find the most comprehensive tutorials to using Prefect for absolute beginners?
n
ill point you a couple places: • docs quickstart • unofficial youtube videos (me) if you prefer this format tldr • write vanilla python functions • add
@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
Copy code
pip install -U prefect
main.py
Copy code
import prefect

@flow
def arbitrary_python_code(x: int, y: str, z: bool):
  pass

if __name__ == "__main__":
  arbitrary_python_code(42, "foo", False)