Loving this series! Working on something that sends outputs from tasks to a supabase db as tasks complete. How do you decide between using a callback function vs a custom tool for something like that?
@gerasimosplegas56997 сағат бұрын
Sending outputs of tasks to supabase. Mind if you shared an example?
@chrisgscott4 сағат бұрын
@ yeah, so I’m building something that has a bunch of tasks that each do a very specific bit of research asynchronously and spit out a report on the thing they researched. Right now I’m using a callback function to send those reports individually to a supabase table so they can be displayed on the front end (nextjs). Wondering if I’d be better served by creating a custom tool instead and just giving the agents or tasks access to that tool.
@gerasimosplegas56994 сағат бұрын
I’m trying to figure out sth similar to that. Using callback function to store each tasks output to supabase. Could you please share a snippet of how you handle that?
@chrisgscott49 минут бұрын
@@gerasimosplegas5699 I don't have access to that project right now, but here's an example from the CrewAI docs' support bot: Here's an example of a callback function that could be used to send task output to a Supabase database: def send_to_supabase(output: TaskOutput): print(f""" Task completed! Task: {output.description} Output: {output.raw} """) # Add your Supabase database connection and insertion logic here # For example: # supabase_client.table('task_outputs').insert({ # 'task_description': output.description, # 'task_output': output.raw # }).execute() research_task = Task( description='Find and summarize the latest AI news', expected_output='A bullet list summary of the top 5 most important AI news', agent=research_agent, tools=[search_tool], callback=send_to_supabase ) So you create that callback function in your main.py and add "callback=send_to_supabase" to any task that you need the output sent to supabase. Still working on my implementation, but this is the gist of it. Hope that helps!
@KumR8 сағат бұрын
Hi Brandon -- How are you ? I am a fan of your work . I need some help. I have done some work in CrewAI some months back but have been out of touch. Now I see CrewAI has changed a lot . A lot of my old notebooks aren't really working now. So can you suggest how I can restart my journey of learning CrewAI ? There are many videos but am not sure which is valid and which is deprecated.. Kindly help me? If you have any paid training also pl let me know. In KZbin do you have any dedicated playlist for CrewAI ?
@sylvestersylvester71888 сағат бұрын
I noticed the same thing. I like your Complete Crash Course for Beginners Brandon, but watching this video I felt a bit lost with the yaml files. Do you go through them in some other video?
@gajjalayeswanth44153 сағат бұрын
Hi @aiwithbrandon, How to tackle the large outputs from the tools
@seththunder20779 сағат бұрын
Hey brandon can u share the github link please
@bhancock_ai8 сағат бұрын
Hey! It’s actually the first link in the description 😁