Oggi vi spiegherò come creare co-agenti AI o applicazioni basate su Copilot.

CoAgent offre un set di strumenti necessari per integrare gli agenti LanGraph nelle applicazioni React per creare applicazioni native di agenti. In questo post parleremo di questo strumento e vedremo come si possono creare applicazioni AI CoAgent o basate su Copilot.

Come creare co-agenti AI o applicazioni basate su Copilot.



CoAgent offre un set di strumenti necessari per integrare gli agenti LanGraph nelle applicazioni React per creare applicazioni native di agenti. In questo post parleremo di questo strumento e vedremo come si possono creare applicazioni AI CoAgent o basate su Copilot.

Che cosa è CoAgents?


Come accennato in precedenza, CoAgent è un set di strumenti che ti consentirà di integrare agenti AI in applicazioni per lo sviluppo di applicazioni native. Parliamo ora di alcune delle sue funzionalità.




Crea AI CoAgents o app basate su Copilot


Per creare CoAgent AI o app basate su Copilot, seguire i passaggi elencati di seguito.



Vediamoli nel dettaglio.

1] Installazione di 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) # } ) ],


Deve essere inserito sotto il tag CopilotKitSDK.




Other Articles
Come correggere l'errore Auth Read ECONNRESET Copilot
Se non sai come risolvere l'errore del copilota, leggi la guidaall'autenticazione: troverai una guida che puoi utilizzare.

Come creare agenti Copilot utilizzando Microsoft AI?
Ti spiegherò come creare agenti Copilot utilizzando Microsoft AI?

Come costruire un percorso del barbaro del cuore selvaggio in Dungeons & Dragons
Per imparare come creare un barbaro del Sentiero del Cuore Selvaggio in Dungeons & Dragons, ecco una guida completa.

Come configurare il Port Mirroring Hyper-V
Ti spiegherò come configurare il mirroring delle porte Hyper-V

Come ottenere la chiave BIOS ASUS per PC Windows
Ti consiglierò come ottenere la chiave BIOS ASUS per PC Windows

Come creare un video utilizzando il sito Google AI Vids.new
Ti guiderò su come creare un video con il sito Google AI Vids.new

Dove trovare il minerale di stagno in Sengoku Dynasty
Se non sai dove trovare il minerale di stagno nel Sengoku Dynasty, ecco una guida che ti aiuterà.

Come ottenere il dente di mostro marino in Disney Dreamlight Valley
Nel nostro post di oggi vi mostriamo come ottenere un dente di mostro marino in Disney Dreamlight Valley.

Come entrare nelle profondità in Roblox Fisch
Se non sai come raggiungere le profondità di Roblox Fisch, ecco una guida passo passo che ti aiuterà.

Come ottenere Noir Pearl in Roblox King Legacy
Ecco una guida completa che ti insegnerà come ottenere la Perla Nera in Roblox King Legacy.