Passaggi successivi
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Dopo aver eseguito l'Assistente Google nel tuo progetto, prova queste soluzioni:
Personalizza la modalità di interazione del tuo progetto con l'assistente. Ad esempio, puoi attivare l'assistente premendo un pulsante o facendo lampeggiare un LED durante la riproduzione dell'audio. Puoi anche mostrare una trascrizione
di riconoscimento vocale dall'assistente su un display.
Controlla il progetto con Azioni dispositivo.
Ad esempio, chiedi alla lampada, con l'assistente integrato, di accenderla e
modificarne la luminosità.
Personalizza la modalità di interazione del tuo progetto con l'assistente
Attivare l'assistente
Con la libreria dell'Assistente Google, puoi attivare una richiesta all'assistente pronunciando
una hotword, ad esempio Ok Google. Puoi disattivare il microfono per impedire
all'assistente di ascoltare la hotword. Utilizza il set_mic_mute()
per controllare questa opzione. Attiva il metodo start_conversation()
in base al tuo evento personalizzato.
Ottieni la trascrizione della richiesta dell'utente
L'SDK dell'Assistente Google fornisce una trascrizione testuale della richiesta dell'utente. Utilizzalo per fornire un feedback all'utente eseguendo il rendering del testo su un display o anche per qualcosa di più creativo, come l'esecuzione di azioni locali sul dispositivo.
La trascrizione si trova in un oggetto stringa Python nell'evento ON_RECOGNIZING_SPEECH_FINISHED
.
Controllare il progetto con la funzionalità Azioni dispositivo
Puoi aggiungere Azioni dispositivo all'assistente per controllare il dispositivo tramite comandi vocali. Estendi l'esempio della Raccolta dell'Assistente Google in modo da includere Azioni dispositivo.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 2025-07-26 UTC."],[[["\u003cp\u003eThe Google Assistant Library for Python is deprecated and developers should utilize the Google Assistant Service instead.\u003c/p\u003e\n"],["\u003cp\u003eCustomize Assistant interaction by triggering requests with custom events (e.g., button press) and displaying speech transcripts.\u003c/p\u003e\n"],["\u003cp\u003eControl your project using Device Actions, enabling voice control for functionalities like adjusting brightness.\u003c/p\u003e\n"],["\u003cp\u003eThe library provides methods for microphone control (\u003ccode\u003eset_mic_mute\u003c/code\u003e) and initiating conversations (\u003ccode\u003estart_conversation\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eAccess user request transcripts via the \u003ccode\u003eON_RECOGNIZING_SPEECH_FINISHED\u003c/code\u003e event for feedback or custom actions.\u003c/p\u003e\n"]]],[],null,["# Next Steps\n\n| **Warning:** The Google Assistant Library for Python is deprecated as of June 28th, 2019. Use the [Google Assistant Service](/assistant/sdk/guides/service/python) instead.\n\n\u003cbr /\u003e\n\nOnce you have the Google Assistant running on your project, give these a try:\n\n1. [Customize](#custom-interaction) how your project interacts with the\n Assistant. For example, trigger the Assistant with the push of a button or\n blink an LED when playing back audio. You can even show a speech recognition\n transcript from the Assistant on a display.\n\n2. [Control](#device-control) your project with Device Actions.\n For example, ask your lamp, with the Assistant built-in, to turn on and\n change its brightness.\n\nCustomize how your project interacts with the Assistant\n-------------------------------------------------------\n\n### Trigger the Assistant\n\nWith the Google Assistant Library, you trigger an Assistant request by speaking\na hotword like *Ok Google* . You can mute the microphone to stop the Assistant\nfrom listening for the hotword. Use the [`set_mic_mute()`](/assistant/sdk/reference/library/python#google.assistant.library.Assistant.set_mic_mute)\nto control this. Trigger the [`start_conversation()`](/assistant/sdk/reference/library/python#google.assistant.library.Assistant.start_conversation)\nmethod based on your own custom event.\n\n### Get the transcript of the user request\n\nThe Google Assistant SDK gives you a text transcript of the user request. Use\nthis to provide feedback to the user by rendering the text to a display, or even\nfor something more creative such as performing some local actions on the device.\n\nThe transcript is located in a Python string object in the [`ON_RECOGNIZING_SPEECH_FINISHED`](/assistant/sdk/reference/library/python#google.assistant.library.event.EventType.ON_RECOGNIZING_SPEECH_FINISHED)\nevent.\n\nControl your project with Device Actions\n----------------------------------------\n\nYou can add Device Actions to the Assistant that allow you to control your\ndevice via voice. [Extend](/assistant/sdk/guides/library/python/extend/install-hardware)\nthe Google Assistant Library sample to include [Device Actions](/assistant/sdk/device-actions-overview)."]]