{"id":18351728,"url":"https://github.com/jlengrand/dialogflow-fun","last_synced_at":"2025-04-10T00:36:47.049Z","repository":{"id":142015508,"uuid":"214225948","full_name":"jlengrand/dialogflow-fun","owner":"jlengrand","description":"This repository contains the code for my talk at JFuture (https://jfuture.dev/#talk_Julien_Lengrand-Lambert)","archived":false,"fork":false,"pushed_at":"2019-11-18T20:38:50.000Z","size":94,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T10:54:29.042Z","etag":null,"topics":["agent","cloud","dialogflow","google-cloud","openbanking","psd2"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jlengrand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-10T15:57:55.000Z","updated_at":"2020-03-13T07:32:04.000Z","dependencies_parsed_at":"2023-07-07T07:32:11.470Z","dependency_job_id":null,"html_url":"https://github.com/jlengrand/dialogflow-fun","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlengrand%2Fdialogflow-fun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlengrand%2Fdialogflow-fun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlengrand%2Fdialogflow-fun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlengrand%2Fdialogflow-fun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlengrand","download_url":"https://codeload.github.com/jlengrand/dialogflow-fun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138001,"owners_count":21053774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","cloud","dialogflow","google-cloud","openbanking","psd2"],"created_at":"2024-11-05T21:32:35.831Z","updated_at":"2025-04-10T00:36:47.033Z","avatar_url":"https://github.com/jlengrand.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DialogFlow fun\n\n[![CircleCI](https://circleci.com/gh/jlengrand/dialogflow-fun/tree/master.svg?style=svg)](https://circleci.com/gh/jlengrand/dialogflow-fun/tree/master)\n\nThis repository contains the code used in my \"Hey Google, send 20$ to Mum\" talk at [JFuture](https://jfuture.dev/) in November 2019.\nYou can find the slides of this talk in [this other repository](https://github.com/jlengrand/google-send-money-talk).\n\nIt is not directly possible for you to just clone this repository and get it working because it depends on environments that I used for the talk. I deploy my app on Google App Engine and some of the credentials are privately stored.\nThe whole dialogflow agent will also be created live, except for the contact entity. \n\n## Technology used\n\n* The backend for this talk is built using **Java 11**. I wanted to use **Kotlin** for a while but decided to have some Java fun instead.\n* The backend is a simple [Spring Boot](https://spring.io/projects/spring-boot) REST application. Great to start kicking fast.\n* The virtual assistant used is Google's [dialogFlow](https://dialogflow.com/).\n* The Banking PSD2 demo is built on top of the [OpenBankProject](https://www.openbankproject.com/). They provide a nice 'Bank as a service' API with cool sandboxes, and some are PSD2 compliant.\n  \n## Some pointers in the code\n\nThe project is composed of several modules.\n\n* The agent folder contains a zipped version of the DialogFlow agent I will build live. You should be able to import it.\n* The `dialogflow-fun-agent` module contains a few routines that interact with an agent using the DialogFlow API. \n  * The `CreateAgent` class especially creates an agent based on input from a text file.\n* The `dialogflow-fun-api` module contains a simple REST API that the DialogFlow agent will interact with. It is the 'backend' of the application.\n  * The backend is essentially a proxy between the DialogFlow fulfillment requests on one hand, and the OpenBankProject sandboxes on the other hand.\n  * The entry point of the application is `DialogFlowFunApiApplication`. It hosts the controller used for the Agent fulfillment.\n  * Most of the PSD2 magic happens in the `OpenBankClient` class. It is a simple class that makes authenticated REST GET and POST calls to the sandbox under the hood.\n  * The `DialogFlowService` class is tasked with converting fulfillment requests into fully fledged PSD2 API calls.\n  * The `UserAccountLookup` class is a dirty trick used for the demo to link users and bank accounts. This would have to be done differently for an actual app :).\n\n## Useful references (for potential readers of this repo :)\n\n- [Reference guide](https://cloud.google.com/dialogflow/docs/reference/libraries/java)\n- [Full library reference](https://googleapis.dev/java/google-cloud-clients/latest/index.html?com/google/cloud/dialogflow/v2/package-summary.html)\n- [Maven dependency](https://search.maven.org/artifact/com.google.cloud/google-cloud-dialogflow/0.114.0-alpha/jar)\n- [Authentication](https://cloud.google.com/docs/authentication/getting-started)\n- [Transaction Types](https://github.com/OpenBankProject/OBP-API/wiki/Transaction-Requests)\n\n## Missing information\n\nIf you want to run the code yourself, you'll need to have an *OpenBankProject* account and update the `dialogflow-fun-api/src/main/appengine/app.yaml` file to contain the following (with updated values): \n\n```\nenv_variables:\n  OPENBANKPROJECT_USERNAME: 'yourUsername'\n  OPENBANKPROJECT_PASSWORD: 'Bnj0VyuI127SN7yjwfwfet'\n  OPENBANKPROJECT_CONSUMERKEY: 'c4vkdziyokjfhwekfjhwek50oblsolo5f1g1k2tdyu2'\n```\n \n## Google Resources (for me to remember before the talk)\n\n- Google Cloud project name : [dialogflow-fun](https://console.cloud.google.com/apis/library?project=dialogflow-fun)\n- [View logs](https://console.cloud.google.com/logs/viewer?project=dialogflow-fun\u0026minLogLevel=0\u0026expandAll=false\u0026timestamp=2019-10-23T07:50:18.827000000Z\u0026customFacets=\u0026limitCustomFacetWidth=true\u0026dateRangeStart=2019-10-23T06:50:19.080Z\u0026dateRangeEnd=2019-10-23T07:50:19.080Z\u0026interval=PT1H\u0026resource=gae_app%2Fmodule_id%2Fdefault\u0026logName=projects%2Fdialogflow-fun%2Flogs%2Fstdout\u0026logName=projects%2Fdialogflow-fun%2Flogs%2Fstderr\u0026logName=projects%2Fdialogflow-fun%2Flogs%2Fappengine.googleapis.com%252Frequest_log\u0026scrollTimestamp=2019-10-23T07:48:44.904582000Z)\n- [Dialog Flow project](https://dialogflow.cloud.google.com/#/agent/ac522b80-e75b-40cd-9493-269fbb4ef634/intents)\n- [App Engine Dashboard](https://console.cloud.google.com/appengine?project=dialogflow-fun\u0026serviceId=default\u0026duration=PT6H)\n- [The app in the cloud](https://dialogflow-fun.appspot.com/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlengrand%2Fdialogflow-fun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlengrand%2Fdialogflow-fun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlengrand%2Fdialogflow-fun/lists"}