Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict between appsettings and code #941

Closed
stephaneey opened this issue Apr 18, 2024 · 1 comment
Closed

Conflict between appsettings and code #941

stephaneey opened this issue Apr 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@stephaneey
Copy link

Describe the bug
In the apssettings, you refer to AzureFormRecognizer but in the code, precisely in the following method:

private void ConfigureImageOCR(IKernelMemoryBuilder builder)
{
    // Image OCR
    switch (this._memoryConfiguration.DataIngestion.ImageOcrType)
    {
        case string y when string.IsNullOrWhiteSpace(y):

        case string x when x.Equals("None", StringComparison.OrdinalIgnoreCase):
            break;        

        case string x when x.Equals("AzureAIDocIntel", StringComparison.OrdinalIgnoreCase):
            builder.Services.AddAzureAIDocIntel(this.GetServiceConfig<AzureAIDocIntelConfig>("AzureAIDocIntel"));
            break;

        default:
            // NOOP - allow custom implementations, via WithCustomImageOCR()
            break;
    }
}

You refer to AzureAIDocIntel, so configuring ImageOcrType to AzureFormRecognizer leads to an exception (non-configured ocr extraction). Appsettings should suggest:

  • to specify AzureAIDocIntel instead of AzureFormRecognizer for the ImageOcrType setting
  • to substitute AzureFormRecognizer section by AzureAIDocIntel

To Reproduce
Steps to reproduce the behavior:

  1. Configure ImageOcrType to AzureFormRecognizer
  2. Define APIKey and Endpoint in AzureFormRecognizer section
  3. Run it, upload a PNG in the chat and boom.
@glahaye glahaye self-assigned this Jun 13, 2024
@glahaye glahaye added the bug Something isn't working label Jun 13, 2024
@glahaye
Copy link
Contributor

glahaye commented Jun 13, 2024

Fixed with #1007

Thanks for bringing this up!

@glahaye glahaye closed this as completed Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants