GithubHelp home page GithubHelp logo

Sample broken... about azure-sdk-for-python HOT 4 OPEN

jainparakh avatar jainparakh commented on August 17, 2024
Sample broken...

from azure-sdk-for-python.

Comments (4)

jainparakh avatar jainparakh commented on August 17, 2024

Same issue as here - https://learn.microsoft.com/en-us/answers/questions/1639700/unable-to-use-new-api-for-document-intelligence

Please fix this

from azure-sdk-for-python.

xiangyan99 avatar xiangyan99 commented on August 17, 2024

Thanks for the feedback, we’ll investigate asap.

from azure-sdk-for-python.

YalinLi0312 avatar YalinLi0312 commented on August 17, 2024

Hi @jainparakh , I've tried the layout model sample in this doc(link) but didn't see any errors. Based on the error you got, I looks the issue is from using begin_analyze_document(). Can you provide the package name, package version and code snippet for how you're using begin_analyze_document()? These would help us to reproduce and investigate the issue.

In general, if you're analyzing a doc from local, you can pass it directly or wrap it to a AnalyzeDocumentRequest object.
e.g.

with open(path_to_sample_documents, "rb") as f:
    poller = document_intelligence_client.begin_analyze_document(
        "prebuilt-layout",
        analyze_request=f, # pass it directly
        content_type="application/octet-stream",
    )
result = poller.result()
with open(path_to_sample_documents, "rb") as f:
    poller = document_intelligence_client.begin_analyze_document(
        "prebuilt-layout",
        AnalyzeDocumentRequest(bytes_source=f.read()), # pass it to "AnalyzeDocumentRequest"
    )
result = poller.result()

Note: we've changed the parameter name in "AnalyzeDocumentRequest" from "base64_source" to "bytes_source" since azure-ai-documentintelligence package version 1.0.0b2 as we expect the input in bytes, not in base64 encoded.
If you're analyzing a doc from remote, you can pass the url in "AnalyzeDocumentRequest" like this:

poller = document_intelligence_client.begin_analyze_document(
    "prebuilt-layout", AnalyzeDocumentRequest(url_source=url)
)

from azure-sdk-for-python.

github-actions avatar github-actions commented on August 17, 2024

Hi @jainparakh. 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.

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.