Cloud Speech grcp service name to url

216 views
Skip to first unread message

Ronald Ruijs

unread,
Sep 30, 2018, 11:05:57 AM9/30/18
to Google Cloud Developers
Herllo,

Trying to access the speech api (from Windows, using Delphi with nghttp2 library) using grcp, I do not know how to interpret the documentation.

I want to execute a gRCP Recognize.

To which URL should I send my http/2 POST request?

I tried:

and

In both cases, I get the same response. Status 200 is returned, with response headers:

:status: 200
content-type: application/grpc
grpc-status: 14
grpc-message: 400:Bad Request
content-length: 0
date: Sun, 30 Sep 2018 14:57:07 GMT
alt-svc: quic=":443"; ma=2592000; v="44,43,39,35"

Which seems to indicate that both URL's are OK, and that the binary data I send is not OK.

My questions: is my conclusion correct or not, and if the url is OK, how to interpret the return headers?

Any ideas are highly appreciated.

Regards, Ronald

George (Cloud Platform Support)

unread,
Sep 30, 2018, 1:36:28 PM9/30/18
to Google Cloud Developers
Hello Ronald, 

You are right about the address, it is indeed https://speech.googleapis.com/v1/speech:recognize . It is highly recommendable to rather use Client Libraries to make API calls. Libraries are provided for C#, Go, Java, node.js, PHP, Python, Ruby, unfortunately not for Object Pascal, if this is the language you use in Delphi. You may check the "Quickstart: Using Client Libraries" online document for details. 

You seem to receive a "HTTP Mapping: 400 Bad Request" message, indicating INVALID_ARGUMENT. This indicates arguments that are problematic regardless of the state of the system (e.g., a malformed file name). You may gather more detail from the "Package google.rpc" online document

Ronald Ruijs

unread,
Oct 2, 2018, 3:10:36 PM10/2/18
to Google Cloud Developers
Hi George,

Thanks for your reply. 

Regarding the URL, are you sure?, from this documentation, , the URL you mentioned looks like the REST endpoint, not the gRPC endpoint.

Unfortunately, for Delphi no client library is available.

I can use the speech API from REST, but not using gRPC.

Can you recommend debugging tools or any other way to get the speech API to work from Delphi (win32)?

Best regards, 

Ronald

George (Cloud Platform Support)

unread,
Oct 2, 2018, 5:19:41 PM10/2/18
to Google Cloud Developers
Hi Ronald, 

You are right, for RPC the Service name speech.googleapis.com is needed to create RPC client stubs. You may gather more detail from the "Cloud Speech API" page, dedicated to gRPC. 

Indeed, there is no official documentation page on making API calls from Delphi, but you might easily find relevant resources on the Internet; as an example, "Using Google Cloud Platform APIs".  

Ronald Ruijs

unread,
Oct 7, 2018, 3:22:20 AM10/7/18
to Google Cloud Developers
Hi George,

You are right, for RPC the Service name speech.googleapis.com is needed to create RPC client stubs. 

I know, that is in the docs. Wat I do not know, is how that Service Name must be translated to a http/2 URL call, necessary for me because I cannot use the Client libraries.

You may gather more detail from the "Cloud Speech API" page, dedicated to gRPC. 

Unfortunately, that page is dedicated to using the client libraries.

but you might easily find relevant resources on the Internet; as an example, "Using Google Cloud Platform APIs".  

That page contains REST information only.

So my question still stands: To which URL should I send my http/2 POST request?

Best regards, Ronald

Op zondag 30 september 2018 17:05:57 UTC+2 schreef Ronald Ruijs:

George (Cloud Platform Support)

unread,
Oct 7, 2018, 4:10:32 PM10/7/18
to Google Cloud Developers
Hi Ronald, 

You define your gRPC service configuration in a configuration file called api_config.yaml. The line of interest, with the URL you are looking for, is: name: xyz.<MY_PROJECT_ID>.cloud.goog. You may gather more detail on the Configuring a gRPC Service documentation page

As you mention, C is not supported and there is no Client Library for it. You may check relevant information for your Delphi library, on the "nghttp2 - HTTP/2 C Library" page, and related documents. 

Ronald Ruijs

unread,
Oct 9, 2018, 3:39:56 AM10/9/18
to Google Cloud Developers
Hi George,

I do not understand your answer. Which yaml file are you referring to? 

Should a  Google Speech gRPC Client use such a file?

Regards, Ronald 


Op zondag 30 september 2018 17:05:57 UTC+2 schreef Ronald Ruijs:
Herllo,

George (Cloud Platform Support)

unread,
Oct 9, 2018, 1:11:45 PM10/9/18
to Google Cloud Developers
We should keep in mind that your C language project is special, being not really supported. The closest would be C++: to generate gRPC source code for Google APIs using C++, you first need to install both Protocol Buffers and gRPC on your local machine, then you can run make LANGUAGE=xxx all to generate the source code. You need to integrated the generated source code into your application build system. You may find more detail on the "Google APIs" page, as well as "To start using gRPC C++" document, and generally in the "Sample Applications" online document

This discussion group is oriented more towards general opinions, trends and issues of general nature touching the app engine. For coding and programming architecture, you may be better served in a forum such as stackoverflow, where experienced programmers are within reach and ready to help. 
Reply all
Reply to author
Forward
0 new messages