<@ULVA73B9P> Marvin introduces "AI functions" that...
# ask-marvin
c
@Marvin Marvin introduces "AI functions" that seamlessly blend into your regular Python code. These functions are designed to map diverse combinations of inputs to outputs, without the need to write any source code. Does controlflow provide the same?
m
Controlflow, as part of the Prefect ecosystem, appears to offer capabilities for managing different workflows, including those involving AI, such as LLM integrations for both directed graph workflows and agent-oriented workflows. However, there is some confusion among users regarding the overlap and differentiation between Prefect core functionalities and Controlflow when it comes to implementing these workflows, as noted in some GitHub issues. From the available information, it isn't clear that Controlflow directly offers "AI functions" in the same manner described in Marvin, which seamlessly map inputs to outputs without writing any code. It seems that Controlflow is more about providing structural and task management, possibly involving AI capabilities with LLMs, but not zero-code mappings of inputs to outputs. If you're considering Controlflow for these capabilities, you might need to evaluate how its existing task and flow structures align with your requirements for AI-based automation and if it can abstractly handle inputs and outputs without manual coding. You might want to explore their documentation further or follow updates on related GitHub issues for more details on this capability.
👎 1
c
This 👇
Copy code
@marvin.fn
def grade_answer(question: str, generation: str) -> bool:
    """Aassess whether an answer addresses / resolves a question
    True outcome means that the answer resolves the question
    """
in controlflow is ran as 👇
Copy code
ans = cf.run("Aassess whether an answer addresses / resolves a question. True outcome means that the answer resolves the question", result_type=bool)
"The question is a lens—its clarity shapes the truth it reveals." 🫠
n
close yeah instead of the library translating the python function definition into a prompt for you, you'd just provide whatever context you want
Copy code
In [1]: import controlflow as cf

In [2]: def grade_answer(answer: str, rubric: str) -> bool:
   ...:     return cf.run(f"does {answer} satisfy these requirements? {rubric!r}?", result_type=bool)
   ...:

In [3]: grade_answer("it is what it is", "must explain why life is complicated")

Out[3]: False
❤️ 1
also just fyi there's a channel #C079VLLH5D3