Giter Site home page Giter Site logo

Comments (2)

dazuma avatar dazuma commented on August 31, 2024

Hi @nshganesh,

I'm not sure where the first screenshot comes from, but it's not on the https://cloud.google.com/document-ai/docs/process-documents-client-libraries page. The use of JSON and base64 is specific to an older endpoint for documentai, and does not apply to the code in https://cloud.google.com/document-ai/docs/process-documents-client-libraries. (If the documentation on https://cloud.google.com/document-ai/docs/process-documents-client-libraries links directly to that screenshot somewhere and implies that it is related, then that's misleading and it should be corrected; if you could point us to where that link is, that would help, because I wasn't able to locate it.)

If you're using the client libraries in https://cloud.google.com/document-ai/docs/process-documents-client-libraries then you should not be doing any base64 encoding. The error you're getting without base64 encoding suggests to me that the request actually did succeed. The error is actually happening when trying to pretty-print the response. It looks like there's a field somewhere in the response message that is a binary string but is being incorrectly marked as utf-8, which if true might indicate a bug in the protobuf library. As a workaround, I suggest, instead of printing or inspecting the response, just get the fields you're interested in.

from google-cloud-ruby.

nshganesh avatar nshganesh commented on August 31, 2024

HI @dazuma

Thank you so much for taking time to go through my issue. I actually went ahead with a nodejs client library. It works perfectly with base64 encoding and according to the documentation.

Sharing little more details about the problem however when I used ruby.

The screenshot I have shared is part of an authenticated page where we can create custom processors. Something like this https://console.cloud.google.com/ai/document-ai/locations/us/processors/[processorid].

I am not inspecting or printing from my part as such, even though the error message somehow suggests that. I also believe that there is some bug in the protobuf library just as you pointed it out.

from google-cloud-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.