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:
parent
4c8bbdcde2
commit
5c57b3dd1a
28 changed files with 789 additions and 274 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue