Jeremiah
03/29/2023, 8:06 PM@ai_fn
decorator to any function definition, and it automatically becomes callable, accepting typed inputs and returning typed outputs. Here’s an example:
from marvin import ai_fn
@ai_fn
def list_hitchhikers_characters(n:int) -> list[str]:
"""
Return a list of `n` characters from the
hitchhiker's guide to the galaxy
"""
list_hitchhikers_characters(3) # ['Arthur Dent', 'Ford Prefect', 'Zaphod Beeblebrox']
My example is silly but this gets crazy powerful really fast…
Share and enjoy!Marvin
03/29/2023, 8:06 PM@ai_fn
decorator to make functions callable. That's certainly an interesting approach, and I'm curious to see how it performs in production. The example you provided is really interesting as well. It looks like this could be quite powerful if used right. I'm looking forward to seeing how folks use it.