Creare un progetto e un agente Dialogflow (Dialogflow)
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Per sviluppare con Dialogflow, devi prima creare un progetto Actions e un agente Dialogflow. Avere un progetto ti consente di accedere alla console per gli sviluppatori per gestire e distribuire l'Azione. L'agente Dialogflow contiene tutti gli intent
che definiscono l'Azione.
Inserisci un nome per il progetto e fai clic su Crea progetto.
Scorri verso il basso fino alla sezione Altre opzioni e fai clic sulla scheda Conversazionale.
Fai clic su Sviluppa nel menu in alto, poi fai clic su Azioni nel menu a sinistra.
Fai clic su Aggiungi la tua prima azione.
Nella scheda Personalizzato per intenzione, fai clic su Crea.
Viene visualizzata la console di Dialogflow con le informazioni completate automaticamente in un agente. Fai clic su Crea per salvare l'agente.
Console Dialogflow
Ora dovresti vedere la console di Dialogflow e il riquadro dei menu a sinistra. Se hai uno schermo piccolo e il menu è nascosto, fai clic su menu nell'angolo in alto a sinistra.
La finestra centrale mostra l'elenco di intent per l'agente. Per impostazione predefinita, gli agenti Dialogflow iniziano con due intent. L'intent di benvenuto predefinito saluta gli utenti. L'agente corrisponde all'intent di riserva predefinito quando non comprende ciò che dicono gli utenti.
Il simulatore Dialogflow si trova sul lato destro della pagina. Il simulatore ti consente di provare l'agente parlando o digitando messaggi. Nel simulatore Dialogflow, fai clic su Prova ora, digita qualsiasi cosa e premi Invio.
Figura 1. Uno screenshot della console di Dialogflow che mostra un agente.
Crea il tuo primo intent
Dialogflow utilizza gli intent per classificare le intenzioni di un utente. Gli intent hanno frasi di addestramento, che sono esempi di ciò che un utente potrebbe dire al tuo agente.
Ad esempio, un utente che vuole sapere il nome dell'agente potrebbe chiedere "Come ti chiami?", "Hai un nome?", oppure di' semplicemente "nome". Queste frasi hanno lo stesso
obiettivo finale: ottenere il nome dell'agente.
Per creare un agente che gestisca questo caso:
Fai clic su add accanto a Intent nel menu di navigazione.
Inserisci Name nel campo di testo Nome intent.
Nella sezione Frasi di addestramento, fai clic su Aggiungi frasi di addestramento.
Inserisci le seguenti frasi (premi Invio dopo ogni frase):
What is your name?
Do you have a name?
name
Nella sezione Risposte, fai clic su Aggiungi risposta.
Inserisci la seguente risposta nella finestra Risposta di testo:
My name is Dialogflow!
Fai clic su Salva.
Prova
Per testare il nuovo intent Nome, nel simulatore Dialogflow digita "Come ti chiami?" e premi Invio.
L'agente può rispondere correttamente alla domanda anche se poni domande che non corrispondono esattamente alle frasi di addestramento (ad esempio, "Come ti chiami?" invece "Come ti chiami?").
Dialogflow utilizza frasi di addestramento per addestrare un modello di machine learning, che consente all'agente di abbinare le frasi degli utenti agli intent corretti.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-26 UTC."],[[["\u003cp\u003eTo begin developing with Dialogflow, you need to set up an Actions project and a Dialogflow agent using the Actions console.\u003c/p\u003e\n"],["\u003cp\u003eDialogflow utilizes intents, containing training phrases and responses, to understand and respond to user requests.\u003c/p\u003e\n"],["\u003cp\u003eYou can test your Dialogflow agent using the built-in simulator by typing or speaking messages.\u003c/p\u003e\n"],["\u003cp\u003eDialogflow employs machine learning to match user input to the appropriate intents, even if the phrasing differs slightly from training phrases.\u003c/p\u003e\n"]]],[],null,["# Create a project and Dialogflow agent (Dialogflow)\n\nTo develop with Dialogflow, you first need to create an Actions project and a\nDialogflow agent. Having a project allows you to access the developer console to\nmanage and distribute your Action. The Dialogflow agent contains all the intents\nthat define your Action.\n| **Note:** When creating a new project, Actions on Google enables [Firebase](//firebase.google.com/), Google's developer platform that provides a number of services for app developers. Relative terms of service information can be found in the [Actions on Google Terms Explanation](/assistant/console/policies/terms-explanation).\n\nCreate an Actions project and Dialogflow agent\n----------------------------------------------\n\n1. Go to the [Actions console](//console.actions.google.com/).\n2. Click **New project**.\n3. Enter a name for your project and click **Create Project** .\n4. Scroll down to the **More options** section and click on the **Conversational** card.\n5. Click **Develop** in the top menu, then click **Actions** in the left menu.\n6. Click **Add Your First Action**.\n7. On the **Custom intent** card, click **Build**.\n8. The Dialogflow console appears with the information automatically populated in an agent. Click **Create** to save the agent.\n\nThe Dialogflow console\n----------------------\n\nYou should now see the Dialogflow console and the menu panel on the left. If\nyou're on a small screen and the menu is hidden, click\n*menu* in the upper left corner.\n\nThe center window shows the list of intents for the agent. By default,\nDialogflow agents start with two intents. The *Default Welcome Intent* greets\nyour users. Your agent matches the *Default Fallback Intent* when it doesn't\nunderstand what the users say.\n\nThe Dialogflow simulator is on the right side of the page. The simulator lets\nyou try out your agent by speaking or typing messages. In the Dialogflow\nsimulator, click **Try it now**, type anything, and press enter.\n\n**Figure 1**. A screenshot of the Dialogflow console showing an agent.\n\nCreate your first intent\n------------------------\n\nDialogflow uses intents to categorize a user's intentions. Intents have\n*Training Phrases*, which are examples of what a user might say to your agent.\nFor instance, a user who wants to know your agent's name might ask, \"What is\nyour name?\", \"Do you have a name?\", or simply say \"name\". These phrases have the\nsame end goal: to get the name of your agent.\n\nTo create an agent that handles this case, follow these steps:\n\n1. Click *add* next to **Intents** in the navigation menu.\n2. Enter `Name` in the **Intent name** text field.\n3. In the **Training Phrases** section, click **Add Training Phrases**.\n4. Enter the following phrases (press enter after each phrase):\n - `What is your name?`\n - `Do you have a name?`\n - `name`\n5. In the **Responses** section, click **Add Response**.\n6. Enter the following response in the **Text Response** window:\n - `My name is Dialogflow!`\n7. Click **Save**.\n\nTry it out\n----------\n\nTo test your new *Name* intent, in the Dialogflow simulator, type \"What's\nyour name?\" and press enter.\n\nYour agent can respond to your question correctly even when you ask questions\nthat aren't exactly the same as the training phrases (for example, \"What's your\nname?\" versus \"What is your name?\").\n\nDialogflow uses training phrases to train a machine learning model, which helps\nthe agent match user utterances to the correct intents."]]