CrewAI Code Interpreter: How I Made AI Agents to Generate Execute Code (Vs AutoGen)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this is amazing now you can add open interpreter to crew AI this is like the code interpreter for chat GPT why it will be useful to integrate open interpreter to crew AI the main difference between crew Ai autogen and task weer is the ability to create code and execute code if your project requires 100% code execution and creation then you could focus on task viewer that is a code first agent framework if you want to perform coding and non-coding task you could prefer autogen crew AI can do only non-coding task that's one of the key difference between these three agent Frameworks but if you want to add coding to crew AI That's when you add open interpreter to crew AI first we going to create agent then assign toss to the agent finally we integrate open interpreter tool to the crew finally we're going to add a user interface using gradio and also go through how to integrate o Lama in crew AI That's exactly what we're going to see today let's get [Music] started hi everyone I'm really excited to show you about open interpreter integration with crew AI in this we are going to integrate this open interpreter and finally add a user interface like this I'm going to take you through step by step on how to do this but before that I regularly create videos and Records to Artificial Intelligence on my YouTube channel so do subscribe and click the Bell icon to stay tuned make sure you click the like button so this video can be helpful for many others like you so first upep pip install open interpreter crew AI gradio L chain and Lang chain open Ai and then click enter next export your open AI API key like this and then click enter next let's create a file called app.py and then let's open it first from crew AI import agent task crew and process next importing interpreter tool from lank chain chat open AI so as a first step we are going to set up configuration and tools so llm equals check chat open Ai and we are providing the model name next interpreter. autorun equals true this will automatically execute commands on your behalf next we are setting up the llm model for interpreter so this llm will be used by crew AI this llm model will be used by interpreter next we're going to create tools so that is called CLI tool so this tool can create an execute code using open interpreter we calling the function interpreter. chat to initiate interpreter within crew AI so now we are going to create agents and assign task for them step number two creating agent for CLI toss CLI agent role software engineer ability to perform CLI operations write programs execute using executor tool and we are assigning the tool here next we are creating task CLA task identify the OS and an empty my recycle bin so this is a basic computer operation next creating the crew we have assigning those agents task process sequential manager LM is the open AI CH GPT finally we are going to run the crew CLI crew. kickoff and print the results that's it just this one bit of code will integrate the open interpreter in your crew AI giving the ability to write and execute code this is a workaround to create and execute code in crew AI now I'm going to run this code in your terminal Python app.py and then click answerer you can see the agent started working it's trying to identify the computer's OS which is Mac OS and then finally it's clearing my trash using open interpreter so here is the final response the operating system has been identified as Mac OS and cleared all the files from the trash now we're going to add a user interface for this to do that import gradio as grr you can mention this at the top of the file but just for your understanding I'm writing it here next we are defining the CLI interface and providing the command so we modifying the CLI task description so you can see the CLI task description by using CLI toss. description you are modifying this command and you're assigning that as a variable and then crew kick off and then return the results next g. interface and passing the CLI interface function with the text box as input and the output will be in text format finally if face. launch to start the user interface now I'm going to run this code Python app.py and click enter one thing I might need to remove which is the result here and the print statement I'm going to run again and here is the URL for the user interface I'm going to open it and here is the interface so I'm going to ask wrer Python program to find the stock price of Apple using Y Finance execute the code and return the result and I'm going to click Summit if you see the terminal you can see the code running that is the open interpreter it's going through step by step first it's verifying if it's why Finance is installed or not it came up saying that since I cannot execute code or access external data which is wrong we added open interpreter this is because we need to modify or optimize The Prompt accordingly so I'm going to modify the code here always use executor tool expert in command line operations creating and executing code now let's try this again opening the URL asking the same question in the terminal I can see it's trying to run the code and it is checking if y Finance is already installed or not I can see the code got executed and finally here is the response which we also can see that in the user interface it is 82.3 one thing to note is that currently we are directly running commands in our computer using open interpreter which we need to be cautious because it can even delete your own files but autogen provides another way that is using Docker to execute these commands you you should still be able to modify this tool to include Docker as well I'm not going to include that to keep this tutorial short now let's add olama and run a local Lodge language model with this to do that pip install Lang chain community and then click enter mostly by default this package is automatically include with your crew AA package but just to let you know that these are the packages required to run I'm just installing it from Lang chain Community LMS import oama now we you're going to modify this configuration so changing the llm is olama model mistal then auto run is true llm model is open a/ mistal and API base is this URL that's the Ola base URL next providing the API key a fake API key offline equals true providing the max tokens retries and context window you can modify these according to your needs the maximum number of tries is 20 I gave because mostly these models struggle to implement any code so in general any open source model running locally on your computer struggle to run agents for now so now we're going to run this code with myal model let's see what's going to happen Python app.py and click enter now providing the same command and then click submit as expected it didn't work agent stopped due to iteration limit or time limit it tried 20 times but still it failed so just keep a note of that that if you run any open source lot language model locally on your computer it's very less likely that it's going to perform these tasks one thing to note is that I have already covered crew Ai autogen and task viewer so I will link all those in the description below to get a better understanding I'm really excited about this I'm going to create more vide similar to this so stay tuned I hope you like this video do like share and subscribe and thanks for watching
Info
Channel: Mervin Praison
Views: 11,860
Rating: undefined out of 5
Keywords: crewai, ai agents, crewai tutorial, crew ai, ai, autonomous agents, autonomous ai agents, agents, ai agent, crew, how to use crewai, langchain, best autonomous ai agents, ollama, create complex ai agents, crewai local llm, crewai lm studio, crewai full tutorial, crewai local, crewai ollama, crewai private, crewai agents, crewai tools, crewai 2.0, crew ai tutorial, crewai open interpreter, crew ai open interpreter, crewai code interpreter, crewai code, crew ai code interpreter
Id: DDDXO_Y_YAI
Channel Id: undefined
Length: 7min 51sec (471 seconds)
Published: Mon Feb 19 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.