Aujourd'hui, je vais vous expliquer comment créer des co-agents IA ou des applications basées sur Copilot.

CoAgent propose un ensemble d'outils nécessaires à l'intégration d'agents LanGraph dans des applications React afin de créer des applications d'agents natives. Dans cet article, nous parlerons de cet outil et verrons comment créer des applications basées sur AI CoAgents ou Copilot.

Comment créer des co-agents IA ou des applications basées sur Copilot.



CoAgent propose un ensemble d'outils nécessaires à l'intégration d'agents LanGraph dans des applications React afin de créer des applications d'agents natives. Dans cet article, nous parlerons de cet outil et verrons comment créer des applications basées sur AI CoAgents ou Copilot.

Qu'est-ce que CoAgents ?


Comme mentionné précédemment, CoAgent est un ensemble d’outils qui vous permettra d’intégrer des agents IA dans des applications pour développer des applications d’agents natifs. Parlons maintenant de certaines de ses fonctionnalités.




Créez des coagents IA ou des applications basées sur Copilot


Suivez les étapes ci-dessous pour créer des applications AI CoAgents ou Copilot.



Voyons-les en détail.

1] Installation de CopilotKit


Before we get started with CoAgents, we first need to install CopilotKit on your device. We assume that you have already installed Node.js and npm on your computer and created a folder for React apps; however, the last part is optional for this step. CopilotKit uses an open-source LLM model; in this tutorial, we will be using the OpenAI API key. Without further ado, let’s get started.



cd C:\React\My\App



npm install @copilotkit/react-core @copilotkit/react-ui @copilotkit/runtime


Then, run the below-mentioned command to install OpenAI.


OPENAI_API_KEY=your_api_key_here


After making changes to the file, we recommend you navigate to docs.copilot.ai/quickstart to learn how to configure the endpoint and setup the CopilotKit provider in your project.

2] Configure the backend remote endpoint


To integrate Python-based services (or any other Node.js alternative), we need to connect the Copilot application to a remote backend endpoint. To do so, we first install the Copilot dependencies in Windows Terminal using the following query.




pip install copilotkit fastapi uvicorn --extra-index-url https://copilotkit.gateway.scarf.sh/simple/


Now, we need to configure the FastAI server, for that, run the commands mentioned below.




mkdir my_copilotkit_remote_endpointcd my_copilotkit_remote_endpointecho. > server.py


If echo didn't work, you can open the folder in Visual Studio Code and then create the server.py file.




Open the server.py file in VSCode and then paste the following lines of code.




from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"}


Now, go back to Windows Terminal and install FastAPI and Uvicorn.




pip install fastapi uvicorn


Once you're done with that, head over to the docs.copilot.ai guides for more information.

3] Add LangGraph Agent


Next, we need to integrate the LangGraph agent into the server.py file. First, locate the CopilotKitSDK instance inside your Python remote endpoint, which is usually located in server.py. Next, adjust the CopilotKitSDK instance (set in the previous step) to accommodate the LangGraph agents. You need to add the following lines of code.




agents=[ Lanonfig={ # if you use Google Gemini, uncomment this code (and import `copilotkit_messages_to_langchain`, see above) # "convert_messages": copilotkit_messages_to_langchain(use_function_call=True) # } ) ],


Ceci doit être placé sous la balise CopilotKitSDK.




Other Articles
Comment corriger l'erreur de lecture d'authentification ECONNRESET Copilot
Si vous ne savez pas comment résoudre l'erreur du copilote, lisez le guide d'authentification et il existe un guide que vous pouvezutiliser avec lui.

Comment créer des agents Copilot à l'aide de Microsoft AI?
Je vais vous dire comment créer des agents Copilot à l'aide de Microsoft AI ?

Comment construire un chemin du barbare Wild Heart dans Dungeons & Dragons
Pour apprendre à créer un barbare du Chemin du Cœur Sauvage dans Donjons & Dragons, voici un guide complet.

Comment configurer la mise en miroir des ports Hyper-V
Je vais vous expliquer comment configurer la mise en miroir du port Hyper-V

Comment obtenir la clé BIOS ASUS pour PC Windows
Je vous recommande comment obtenir la clé BIOS ASUS pour PC Windows

Comment créer une vidéo en utilisant le site Google AI Vids.new
Je vais vous guider Comment créer une vidéo avec Google AI Vids.nouveau site

Où trouver du minerai d'étain dans Sengoku Dynasty
Si vous ne savez pas où trouver du minerai d'étain dans le Sengoku Dynasty, voici un guide qui vous aidera.

Comment obtenir une dent de monstre marin dans Disney Dreamlight Valley
Aujourd'hui, dans notre article, nous vous montrons comment obtenir une dent de monstre marin dans Disney Dreamlight Valley.

Comment accéder aux profondeurs en Roblox Fisch
Si vous ne savez pas comment accéder aux profondeurs de Roblox Fisch, voici un guide étape par étape qui vous aidera.

Comment obtenir la Perle Noire dans Roblox King Legacy
Vous avez ici un guide complet qui vous apprendra comment obtenir Noir Pearl dans Roblox King Legacy.