Azure / azure-sdk-for-go

This repository is for active development of the Azure SDK for Go. For consumers of the SDK we recommend visiting our public developer docs at:
https://docs.microsoft.com/azure/developer/go/
MIT License
1.57k stars 805 forks source link

Support for Document Intelligence #23080

Open JavascriptMick opened 1 month ago

JavascriptMick commented 1 month ago

Feature Request

Any plans to support Azure Document Intelligence in the go sdk.. similar to the Typescript sdk?

    const client = new DocumentAnalysisClient(
      this.azureDocumentAnalysisEndpoint,
      new AzureKeyCredential(this.azureDocumentAnalysisKey)
    );

    const poller = await client.beginAnalyzeDocumentFromUrl(
      'prebuilt-xxx',
      imageUrl
    );

If not, any workarounds? community packages?

github-actions[bot] commented 1 month ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @anrothMSFT @ctstone.

jhendrixMSFT commented 1 month ago

CC @sandeep-sen

anrothMSFT commented 1 month ago

Hey! I've let the team, but I've flagged this for @vkurpad.

JavascriptMick commented 1 month ago

in the meantime, I have had some success using the rest api directly from go. I had to use the older formrecognizer endpoint for some reason

    requestURL := fmt.Sprintf("%s/formrecognizer/documentModels/%s:analyze?api-version=%s", endpoint, modelId, apiVersion)
    fmt.Println("Request URL:", requestURL)
    req, err := http.NewRequest("POST", requestURL, bytes.NewBuffer(requestBodyBytes))
    if err != nil {
        fmt.Println("Error creating HTTP request:", err)
        return "", err
    }
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Ocp-Apim-Subscription-Key", subscriptionKey)
    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Error sending HTTP request:", err)
        return "", err
    }
    defer resp.Body.Close()
Arvi89 commented 3 weeks ago

Yeah that would be great. Right now I use the REST API but I'd rather use a well integrated SDK ^^