Class AzureOpenAiBroker
- 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
Methods
GenerateInvoiceCategory(Invoice)
internal Task<InvoiceCategory> GenerateInvoiceCategory(Invoice invoice)
Parameters
invoice
Invoice
Returns
GenerateInvoiceDescription(Invoice)
internal Task<string> GenerateInvoiceDescription(Invoice invoice)
Parameters
invoice
Invoice
Returns
GenerateInvoiceName(Invoice)
internal Task<string> GenerateInvoiceName(Invoice invoice)
Parameters
invoice
Invoice
Returns
GenerateInvoiceRecipes(Invoice)
internal Task<ICollection<Recipe>> GenerateInvoiceRecipes(Invoice invoice)
Parameters
invoice
Invoice
Returns
GenerateMerchantCategory(Merchant)
internal Task<MerchantCategory> GenerateMerchantCategory(Merchant merchant)
Parameters
merchant
Merchant
Returns
GenerateMerchantDescription(Merchant)
internal Task<string> GenerateMerchantDescription(Merchant merchant)
Parameters
merchant
Merchant
Returns
GenerateProductAllergens(Product)
internal Task<IEnumerable<Allergen>> GenerateProductAllergens(Product product)
Parameters
product
Product
Returns
GenerateProductCategory(Product)
internal Task<ProductCategory> GenerateProductCategory(Product product)
Parameters
product
Product
Returns
PerformGptAnalysisOnSingleInvoice(Invoice, AnalysisOptions)
Sends a single invoice to analysis.
public ValueTask<Invoice> PerformGptAnalysisOnSingleInvoice(Invoice invoice, AnalysisOptions options)
Parameters
invoice
Invoiceoptions
AnalysisOptions