This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createOpenAICompatible } from '@ai-sdk/openai-compatible'; | |
| import { generateText, tool } from "ai"; | |
| import { z } from "zod"; | |
| const moonshot = createOpenAICompatible({ | |
| name: 'moonshot', | |
| apiKey: '???', | |
| baseURL: 'https://api.moonshot.ai/v1', | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { page } from '$app/state'; | |
| /** | |
| * Type-safe utility for accessing streaming promises from SvelteKit server load functions. | |
| * | |
| * Solves two key problems: | |
| * 1. **Prop drilling**: Components can access page.data.streaming directly without passing promises through parent components | |
| * 2. **Type safety**: Infers exact promise types instead of unions, avoiding type guards everywhere | |
| * | |
| * @example |
OlderNewer