04b1fc3024
Test Suite / test (24.15.0) (push) Has been cancelled
- Added a new API path for rematching recipe ingredients in `api_paths.dart`. - Implemented a manual product creation dialog in `inventory_screen.dart` to allow users to create new products directly. - Integrated the rematch functionality in `recipe_repository.dart` to handle rematching of recipe ingredients. - Updated the recipe detail screen to include a button for triggering the rematch process. - Introduced a new `RecipeMatchingService` in the backend to handle ingredient matching logic. - Added database migration to include `aiEngineEnabled` column in the User table. Co-authored-by: Copilot <copilot@github.com>
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { FlatCategory } from '../categories/categories.service';
|
|
export declare const AI_CATEGORIZATION_MODEL = "mistral-tiny";
|
|
export type CategorySuggestion = {
|
|
categoryId: number;
|
|
categoryName: string;
|
|
path: string;
|
|
confidence: 'high' | 'medium' | 'low';
|
|
usedFallback: boolean;
|
|
};
|
|
export type AiIngredientMatchSuggestion = {
|
|
productId: number;
|
|
reason?: string;
|
|
confidence: 'high' | 'medium' | 'low';
|
|
};
|
|
export type AiSubstitutionSuggestion = {
|
|
productId: number;
|
|
reason?: string;
|
|
confidence: 'high' | 'medium' | 'low';
|
|
};
|
|
export declare class AiService {
|
|
private readonly logger;
|
|
suggestIngredientMatches(rawIngredient: string, candidates: Array<{
|
|
id: number;
|
|
name: string;
|
|
canonicalName?: string | null;
|
|
}>): Promise<AiIngredientMatchSuggestion[]>;
|
|
suggestSubstitutions(rawIngredient: string, availableProducts: Array<{
|
|
id: number;
|
|
name: string;
|
|
canonicalName?: string | null;
|
|
}>): Promise<AiSubstitutionSuggestion[]>;
|
|
suggestCategory(productName: string, categories: FlatCategory[]): Promise<CategorySuggestion>;
|
|
private fallbackToOvrigt;
|
|
}
|