How to stream CrewAI Agent steps and thoughts in a Streamlit app [Code Included]

Поділитися
Вставка
  • Опубліковано 13 січ 2025

КОМЕНТАРІ • 46

  • @firetownplatformfinders3996
    @firetownplatformfinders3996 9 місяців тому +3

    I have been looking for something like this for a while. Thanks you so much for sharing.

    • @tonykipkemboi
      @tonykipkemboi  9 місяців тому

      Awesome! Glad you hear you find it useful. Thank you 🙏

  • @abutispinach
    @abutispinach 9 місяців тому +2

    this was what i been looking for , well description even for us non coders

    • @tonykipkemboi
      @tonykipkemboi  9 місяців тому

      Thank you for the feedback! Glad you find it useful.

  • @Talking2Wall
    @Talking2Wall 6 місяців тому +1

    This is exceptionally clear and easy to understand, Thank you!

    • @tonykipkemboi
      @tonykipkemboi  6 місяців тому

      @@Talking2Wall glad you enjoyed it.

  • @spigg777
    @spigg777 8 місяців тому +1

    Well Done Mister, been playing with the crewai Trip planner, Sreamlit is a great UI am going to it, Asante sana

  • @yuzual9506
    @yuzual9506 9 місяців тому +1

    i will stay tuned, sur!!! thx for your work, i want to developp this for my university for research papers

    • @tonykipkemboi
      @tonykipkemboi  9 місяців тому

      Awesome! Thank you. That would be really cool.

  • @andydataguy
    @andydataguy 8 місяців тому

    Stoked to see where you take this in the next iteration brother 🙌🏾
    Maybe some interesting hierarchical systems

  • @ruozhufeng9008
    @ruozhufeng9008 9 місяців тому +2

    Fantastic tutorial!❤

  • @sircaju
    @sircaju 9 місяців тому

    @Tony, you save my day. I was looking to a example on how to have streamlit and crewAI interaction, not only at the end, but during the process. Very nice demo. I will use it as my default to my experiments. Thanks.

    • @tonykipkemboi
      @tonykipkemboi  9 місяців тому

      Awesome! I am glad to hear you find it useful! I saw a lot of questions around this and decided it was a good idea to work on it. Excited to see what end up building. Let me know if there's any other thing you'd like for me to cover.

  • @AIdevel
    @AIdevel 8 місяців тому +2

    This is really excellent video , I have been thinking about similar UI to adapt it to automate processes

    • @tonykipkemboi
      @tonykipkemboi  8 місяців тому

      Thank you. Let me know how that goes, good luck!

  • @kubaD2000
    @kubaD2000 9 місяців тому +2

    Amazing. Would it make sense and be doable to display agents chat in the st.chat_messages component? So like even each agent would have individual icon and name?

    • @tonykipkemboi
      @tonykipkemboi  9 місяців тому +2

      Thank you! Yes, it is possible. I'll be working on another agent tutorial that will be more updated and use chat as well as a better parsed out agent process.

  • @LuigiLoiacono-v9t
    @LuigiLoiacono-v9t 2 місяці тому

    nice work. you mentioned costs only for gpt (although 3.5 should be free), but what about scraper and BROWSERLESS, they do add costs to use cases?

  • @thealwayssmileguy9060
    @thealwayssmileguy9060 9 місяців тому +1

    Which LLM do you use for the agents? I am curious about the costs

    • @tonykipkemboi
      @tonykipkemboi  9 місяців тому

      I used GPT-3.5 for this demo. Yes, it can be costly if the agents have long running processes. Another alternative is to use local models through Ollama or Groq while it's still free.

  • @thefutureisbright
    @thefutureisbright 9 місяців тому +1

    Nice tutorial 👍

  • @Vishnu-c2o
    @Vishnu-c2o 2 місяці тому

    looks like the step_callback is not working anymore. Is it a version issue? I'm on 0.76.9

  • @yazanrisheh5127
    @yazanrisheh5127 7 місяців тому +1

    Can you show how to integrate human input on streamlit

    • @tonykipkemboi
      @tonykipkemboi  7 місяців тому

      We're thinking the same. Adding human input to Streamlit is challenging due to the nature of the apps running from top to bottom each time there's an intereaction. So if we add human feedback and submit, it will rerun our code again from top to bottom instead of picking up from where we left of. I'm still trying to get it to work and will let you know if I get it working.

    • @yazanrisheh5127
      @yazanrisheh5127 7 місяців тому +1

      @@tonykipkemboi Wouldn't it work if you set it to a session state in this case?

    • @tonykipkemboi
      @tonykipkemboi  6 місяців тому

      @@yazanrisheh5127 it would still not work since it will restart the process from the beginning regardless. It will not save the stage in session state and be able to start from there after human input. I'm still investigating a way to do this that is more cleaner.

  • @pierre-louis4519
    @pierre-louis4519 8 місяців тому

    🤔.... Say that I am a professional who is traveling. Is there any possibility to implement something like : OK I am occupied during this period of time in the day, what can I do before and afterward ?

    • @tonykipkemboi
      @tonykipkemboi  8 місяців тому

      Good question. Yes, you can add that to the box on the sidebar with any special things for context to the agent. Things like your hobbies or anything that you want the agent to be aware of when creating your itinerary.

  • @Guna-nm6be
    @Guna-nm6be 9 місяців тому

    I have a question
    Open ai api key is need

    • @tonykipkemboi
      @tonykipkemboi  9 місяців тому

      Yes, you'll need OpenAI key for this but you can also use Ollama instead if you want to use a local model and reduce/cut out costs. GPT-4 has better results though. I'm actually experimenting with using Groq API to see if I can reduce the latency/wait times of the agents work. Would be much fun to have results much faster and not wait for too long.

    • @kubaD2000
      @kubaD2000 9 місяців тому

      @@tonykipkemboi How about gpt3.5. ? Are there any cons in using it for testing/learning? I think it cost multiple times cheaper than version 4.

  • @phani3519
    @phani3519 2 місяці тому +1

    hey can I pass extra parameters to the callback function lets say I want to save the output in a file, I want to give the filename how can we do it?
    agent = Agent(
    role=task_info.agent.role,
    goal=task_info.agent.goal,
    backstory=task_info.agent.backstory,
    verbose=False,
    llm=get_llm(),
    step_callback=write_callback_to_file(file_path="output.txt")
    )
    def write_callback_to_file(step_output, file_path: str = "output.txt"):
    with open(file_path, 'a') as file:
    file.write("---
    ")
    # some logic I want to do
    can we do something like this?

    • @tonykipkemboi
      @tonykipkemboi  2 місяці тому

      @@phani3519 so the CrewAI codebase has changed quite a lot that I might need to update this code.

    • @phani3519
      @phani3519 2 місяці тому

      @@tonykipkemboi oh that's unfortunate, i tried looking at the documentation but didn't find any leads for the following, anything help would be greatly appreciated

    • @tonykipkemboi
      @tonykipkemboi  2 місяці тому

      @@phani3519 no, I meant I will need to update the tutorial on my end.

    • @nandanayak-f2g
      @nandanayak-f2g 2 місяці тому +1

      @@tonykipkemboi it will be very helpful if you could do that! cheers, thanks for all your work

    • @tonykipkemboi
      @tonykipkemboi  2 місяці тому

      @@nandanayak-f2g coming soon