Table of Contents

Class AzureOpenAiBroker

Namespace
arolariu.Backend.Domain.Invoices.Brokers.AnalysisBrokers.ClassifierBroker
Assembly
arolariu.Backend.Domain.Invoices.dll

The Azure OpenAI broker service. This concrete class will use the Azure OpenAI client to perform the invoice analysis.

public sealed class AzureOpenAiBroker : IOpenAiBroker
Inheritance
AzureOpenAiBroker
Implements
Inherited Members

Constructors

AzureOpenAiBroker(IOptionsMonitor<AzureOptions>)

Constructor.

public AzureOpenAiBroker(IOptionsMonitor<AzureOptions> options)

Parameters

options IOptionsMonitor<AzureOptions>

Fields

openAIClient

private readonly AzureOpenAIClient openAIClient

Field Value

AzureOpenAIClient

Methods

GenerateInvoiceCategory(Invoice)

internal Task<InvoiceCategory> GenerateInvoiceCategory(Invoice invoice)

Parameters

invoice Invoice

Returns

Task<InvoiceCategory>

GenerateInvoiceDescription(Invoice)

internal Task<string> GenerateInvoiceDescription(Invoice invoice)

Parameters

invoice Invoice

Returns

Task<string>

GenerateInvoiceName(Invoice)

internal Task<string> GenerateInvoiceName(Invoice invoice)

Parameters

invoice Invoice

Returns

Task<string>

GenerateInvoiceRecipes(Invoice)

internal Task<ICollection<Recipe>> GenerateInvoiceRecipes(Invoice invoice)

Parameters

invoice Invoice

Returns

Task<ICollection<Recipe>>

GenerateMerchantCategory(Merchant)

internal Task<MerchantCategory> GenerateMerchantCategory(Merchant merchant)

Parameters

merchant Merchant

Returns

Task<MerchantCategory>

GenerateMerchantDescription(Merchant)

internal Task<string> GenerateMerchantDescription(Merchant merchant)

Parameters

merchant Merchant

Returns

Task<string>

GenerateProductAllergens(Product)

internal Task<IEnumerable<Allergen>> GenerateProductAllergens(Product product)

Parameters

product Product

Returns

Task<IEnumerable<Allergen>>

GenerateProductCategory(Product)

internal Task<ProductCategory> GenerateProductCategory(Product product)

Parameters

product Product

Returns

Task<ProductCategory>

PerformGptAnalysisOnSingleInvoice(Invoice, AnalysisOptions)

Sends a single invoice to analysis.

public ValueTask<Invoice> PerformGptAnalysisOnSingleInvoice(Invoice invoice, AnalysisOptions options)

Parameters

invoice Invoice
options AnalysisOptions

Returns

ValueTask<Invoice>