1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 07:39:41 +02:00

feat: OpenAI Ingredient Parsing (#3581)

This commit is contained in:
Michael Genson 2024-05-22 04:45:07 -05:00 committed by GitHub
parent 4c8bbdcde2
commit 5c57b3dd1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 789 additions and 274 deletions

View file

@ -1,6 +1,6 @@
import { Ref, useContext } from "@nuxtjs/composition-api";
import { useLocalStorage, useSessionStorage } from "@vueuse/core";
import { TimelineEventType } from "~/lib/api/types/recipe";
import { RegisteredParser, TimelineEventType } from "~/lib/api/types/recipe";
export interface UserPrintPreferences {
imagePosition: string;
@ -36,6 +36,10 @@ export interface UserTimelinePreferences {
types: TimelineEventType[];
}
export interface UserParsingPreferences {
parser: RegisteredParser;
}
export function useUserPrintPreferences(): Ref<UserPrintPreferences> {
const fromStorage = useLocalStorage(
"recipe-print-preferences",
@ -116,3 +120,17 @@ export function useTimelinePreferences(): Ref<UserTimelinePreferences> {
return fromStorage;
}
export function useParsingPreferences(): Ref<UserParsingPreferences> {
const fromStorage = useLocalStorage(
"parsing-preferences",
{
parser: "nlp",
},
{ mergeDefaults: true }
// we cast to a Ref because by default it will return an optional type ref
// but since we pass defaults we know all properties are set.
) as unknown as Ref<UserParsingPreferences>;
return fromStorage;
}