UNPKG

@ai-sdk/svelte

Version:

[Svelte](https://svelte.dev/) UI components for the [AI SDK](https://ai-sdk.dev/docs):

12 lines (11 loc) 597 B
import { KeyedChatStore, setChatContext } from './chat-context.svelte.js'; import { KeyedCompletionStore, setCompletionContext, } from './completion-context.svelte.js'; import { KeyedStructuredObjectStore, setStructuredObjectContext, } from './structured-object-context.svelte.js'; export function createAIContext() { const chatStore = new KeyedChatStore(); setChatContext(chatStore); const completionStore = new KeyedCompletionStore(); setCompletionContext(completionStore); const objectStore = new KeyedStructuredObjectStore(); setStructuredObjectContext(objectStore); }