云人才解决方案Node CompletionClient示例

时间:2019-06-02 20:48:52

标签: google-cloud-talent-solution

我正在使用Google Talent Solution v4beta1尝试Node JS示例,并收到以下错误。您能帮我找出问题所在吗?

我尝试调试,但无济于事。我已经设置了必需的身份验证密钥和环境变量。

function getAutocomplete(searchValue) {

        const googleAuth = new auth.GoogleAuth();
        googleAuth.fromJSON(key);
        const talentclient = new talent.CompletionClient({auth: googleAuth});
        const request = {
            parent: 'XYZ',
            query: searchValue,
            pageSize: 10,
            languageCode: ['en_GB']
        };

        talentclient.completeQuery(request)
            .then(response => {
                return response.completionResults;
            })
            .catch(err => {
                console.error(err);
            });
    }

我收到以下错误:

Error: Following fields are missing or invalid (Possible reasons: non-numeric for double field
    at Http2CallStream.call.on (/Users/venkatesh/Projects/jobsite/nerdzu-jobs-read-server/node_modules/@grpc/grpc-js/build/src/client.js:102:45)
    at Http2CallStream.emit (events.js:187:15)
    at Http2CallStream.endCall (/Users/venkatesh/Projects/jobsite/nerdzu-jobs-read-server/node_modules/@grpc/grpc-js/build/src/call-stream.js:74:18)
    at handlingTrailers (/Users/venkatesh/Projects/jobsite/nerdzu-jobs-read-server/node_modules/@grpc/grpc-js/build/src/call-stream.js:163:18)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  code: 3,
  details:
   'Following fields are missing or invalid (Possible reasons: non-numeric for double field',
  metadata: Metadata { internalRepr: Map {} },
  note:
   'Exception occurred in retry method that was not classified as transient'

我希望收到来自Google Talent Solution API的职位自动完成答复。

0 个答案:

没有答案