Answer the question
In order to leave comments, you need to log in
How to competently use third-party APIs in your web application on NodeJS?
Hello, I am doing my project - a chat server. For example, I have a function that, by voice phrase "add a reminder on X number", interacts with the Google Calendar API. The request path looks like this: the user sends a message -> the server opens the stream and sends it to Yandex SpeechKit -> SpeechKit returns a string result -> the server redirects the string to the dialogFlow API -> dialogFlow API returns the result to the server -> the server makes a Google Calendar API request -> the server receives the result of the add reminder operation. As a result, before reaching the result, a whole series of requests to third-party APIs occurs, because. the project is still working with one user, there are no performance problems, but if the user base is expanded, I am sure that large drawdowns will begin. Perhaps there are ways to shorten such a long chain of events, or there are certain design patterns for such applications. Who faced this problem, tell me please.
Answer the question
In order to leave comments, you need to log in
1. Why not use Google Actions? Or things like dialogflow.com?
2. Reducing latency is possible with a number of tricks, such as starting to send voice data directly to the service from the moment it starts to be spoken. Next is the caching layer for the results of intent extraction.
3. Hosting the entire speech recognition stack and intents.
4. Parallelization of the chain where possible.
For example
- Buy movie tickets for a good Tarantino movie
1. Распознавание
2. Параллельно:
= Поиск хороших фильмов Тарантино
= Поиск кинотеатров поблизости
= Получение данных вашего календаря
3. = Запрос расписаний из ближайших кинотеатров (можно делать параллельно, если нет общего API)
4. Поиск оптимального сеанса
5. Заказ билетов
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question