Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

Dialogflow libraries and samples

Dialogflow's APIs allow you to take action on your own systems based on conversational input, embed your conversational interface into your app or website, and dynamically change your agent's behavior. Dialogflow APIs center around three primary use cases:

  • Fulfillment: take action on your own systems based on conversational input. You can do things like querying a database or API to provide info to your users with any integration (Actions on Google, Slack, etc.)
  • Detect Intent API: Embed your conversational interface built with Dialogflow into your app, website or device. Call this API with a user's query to get back how your DIalogflow agent's response
  • Agent API: Dynamically change your agent's behavior by editing your agent's intents, entities and contexts. Do anything you can through Dialogflow console programmatically with Dialogflow's agent APIs.

Fulfillment

Fulfillment is code that's deployed as a webhook that lets your Dialogflow agent call business logic on an intent-by-intent basis. During a conversation, fulfillment allows you to use the information extracted by Dialogflow's natural language processing to generate dynamic responses or trigger actions on your back-end.

Most Dialogflow agents make use of fulfillment to do things like: generate dynamic responses based on information looked up from a database, place orders based on products a customer has asked for, implement the rules and winning conditions for a game.

Library

PlatformPackage ManagerQuick StartGetting Started
Node.jsnpmQuick Start GuideGetting Started Guide

Note: For all other platforms please see API reference for a webhook request and response.

Samples

NameDescription
Node.js
Actions on GoogleSample demonstrating how to use both the Dialogflow fulfillment library and the Actions on Google client library together.
Bike ShopDive into making a agent for a small business like this appointment scheudling bike shop
FAQDescription: Sample desmonstrating how to use Knowledge Connectors, the Telephony Gateway and Actions on Google together.
FirestoreSample demonstrating how to connect a Dialogflow agent to Firebase's Firestore database.
Human-agent HandoffThis sample consists of a simple API.AI agent, a node.js server and a web interface that together demonstrate an approach for handing text-based conversations from an API.AI agent to a human operator."
ImportA simple sample showing how to use Dialogflow's Importer for Alexa Skills to import a Alexa Skill to Dialogflow and deploy it to the Google Assistant."
Multi locale/languageCreate and fulfill a multilignual and multilocale agent with this French and English speaking sample
Quick StartGet started quickly with fulfillment with this basic code
Regular expression entity validation.Sample demonstrating how to validate a entity with a regular expression in fulfillment.
Temperature Converter TriviaLearn how intent, entities, contexts and rich responses work with this sample that converts temperatures with trivia along the wayTemperature Converter Trivia
WeatherMake a API call from fulfillment to give user's relevant information like the weatherWeather
Python/Flask
TranslateGet information from the user in the form of Dialogflow parameters and make an API call with the data to translate user's speech from one language to another
WeatherMake a API call from fulfillment to give user's relevant information like the weather
JSON
Webhook Request & ResponseThis sample shows Dialogflow's fulfillment webhook JSON requests and responses for v1 & v2 agents, including Actions on Google-specific requests & resposnes"

Actions on Google

Actions on Google has created a library and samples specifically for use with Dialogflow and Actions on Google together. These tools and samples do not work with any other Dialogflow integrations.

Library

If you are only interested in building Dialogflow fulfillment for the Google Assistant and don't plan on using other integrations, you should use the Actions on Google fulfillment library which supports all Actions on Google features.

Samples

For fulfillment samples specific to Google Assistant please see Actions on Google's Dialogflow sample page

Detect Intent and Agent APIs

Dialogflow's detect intent API is a great way to integrate your Dialogflow agent into your website or app. The detect intent API enables you to query your agent with a user's request (audio or text) and receive your agent's response to the user's request.

The agent API allows you to dynamically change the behavior of your Dialogflow agent by allowing you to create, read, update and delete intents, entities and contexts. Both the detect intent and agent APIs can be accessed through Dialogflow's REST API or the client libraries available for Node.js, Python, Java, Go, Ruby, C#, and PHP listed below:

API V2

Libraries

PlatformPackage ManagerInstallationInclude/Import
Node.jsNPMnpm install dialogflowconst dialogflow = require('dialogflow');
PythonPyPIpip install dialogflowimport dialogflow
JavaMavenSee Quickstartimport com.google.cloud.dialogflow.V2.*;
Gogo getgo get cloud.google.com/go/dialogflow/apiv2import "cloud.google.com/go/dialogflow/apiv2"
RubyGemgem install api-ai-rubyApiAiRuby::Client.new(...)
C#Nugetnuget install Google.Cloud.Dialogflow.V2using Google.Cloud.Dialogflow.V2;
PHPPackagistcomposer require google/cloud-dialogflowuse Google\Cloud\Dialogflow\V2\AgentsClient;

Samples

PlatformSamples
Node.jshttps://github.com/googleapis/nodejs-dialogflow/tree/master/samples
Pythonhttps://github.com/googleapis/dialogflow-python-client-v2/tree/master/samples
Javahttps://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/dialogflow/cloud-client
Gohttps://github.com/GoogleCloudPlatform/google-cloud-go/tree/master/dialogflow/apiv2
C#https://github.com/googleapis/google-cloud-dotnet/tree/master/apis/Google.Cloud.Dialogflow.V2/Google.Cloud.Dialogflow.V2.Snippets
PHPhttps://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/dialogflow
Rubyhttps://github.com/GoogleCloudPlatform/ruby-docs-samples/tree/master/dialogflow

API V2 BETA

Dialogflow's V2beta1 offers new features that are not yet available on the generally available and may make some backwards incompatible changes.

Libraries

PlatformPackage ManagerInstallationInclude/Import
Node.jsnpmnpm install dialogflowconst dialogflow = require('dialogflow').V2beta1;
PythonPyPipip install dialogflowimport dialogflow_V2beta1
JavaMavenSee Quickstartimport com.google.cloud.dialogflow.V2beta1.*;

Samples

PlatformSamples
Pythonhttps://github.com/googleapis/dialogflow-python-client-v2/tree/master/samples
Javahttps://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/dialogflow/cloud-client
Node.jshttps://github.com/googleapis/nodejs-dialogflow/tree/master/samples

API V1 (Legacy)

Libraries

Dialogflow's legacy V1 SDKs can be found below. When starting a new project, use Dialogflow V2 and V2 SDKs listed above.

PlatformDocs
Android SDKAndroid SDK Docs
Botkit SDKBotkit SDK Docs
C++C++ Docs
Cordova SDKCordova SDK Docs
HTML + JS Example
iOS SDKiOS SDK Docs
Java SDKJava SDK Docs
JavaScript SDKJavaScript SDK Docs
.NET (WP8, W10).NET SDK Docs
Node.js SDKNode.js SDK Docs
Python SDKPython SDK Docs
Ruby SDKRuby SDK Docs
Unity SDKUnity SDK Docs
Xamarin SDKXamarin SDK Docs

About

Links to all Dialogflow libraries and samples

Resources

Contributing

Stars

126 stars

Watchers

12 watching

Forks

Releases

Packages

Used by

Contributors