GithubHelp home page GithubHelp logo

Comments (6)

github-actions avatar github-actions commented on July 18, 2024

Thank you for your feedback. Tagging and routing to the team member best able to assist.

from azure-sdk-for-python.

YalinLi0312 avatar YalinLi0312 commented on July 18, 2024

Hi @sakshi1989 , can you try with passing parameter content_type?

print(type(f))

poller = document_intelligence_client.begin_analyze_document(model_id="prebuilt-layout",
                                                             analyze_request=f,
                                                             output_content_format="markdown",
                                                             content_type="application/octet-stream",)

Or passing in a AnalyzeDocumentRequest:

print(type(f))

poller = document_intelligence_client.begin_analyze_document(model_id="prebuilt-layout",
                                                             AnalyzeDocumentRequest(bytes_source=f.read()),
                                                             output_content_format="markdown",)

Thanks

from azure-sdk-for-python.

sakshi1989 avatar sakshi1989 commented on July 18, 2024

Thanks @YalinLi0312 for your reply. Your first suggestion works, but not the second one. With the second one I am receiving below error -
TypeError: cannot pickle '_io.BufferedReader' object

Also, I would like to point out that in documentation there is nowhere mentioned to have the parameter content_type="application/octet-stream", it would be good to mention the same in the documentation so that users don't run into the same error. in the example, yes this parameter is mentioned but not in the documentation.

from azure-sdk-for-python.

github-actions avatar github-actions commented on July 18, 2024

Hi @sakshi1989. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

from azure-sdk-for-python.

YalinLi0312 avatar YalinLi0312 commented on July 18, 2024

Hi @sakshi1989, thanks for the feedback! We'll mention the type in our documentation.
For the second one, it should pass f.read() instead. I updated in the previous comment, please try it again.

from azure-sdk-for-python.

sakshi1989 avatar sakshi1989 commented on July 18, 2024
model_id="prebuilt-layout",
                                                             AnalyzeDocumentRequest(bytes_source=f.read()),
                                                             output_content_format="markdown",

Hi @YalinLi0312 , thank you for your quick response on the issue. Yes, now both the options are working.

from azure-sdk-for-python.

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.