We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When importing and using useCompletion in svelte, multiple Returns like setInput and handleInputChange are missing. TS says the following:
(alias) useCompletion({ api, id, initialCompletion, initialInput, credentials, headers, body, streamProtocol, onResponse, onFinish, onError, fetch, }?: UseCompletionOptions): UseCompletionHelpers import useCompletion
--> this makes the useCompletion hook somewhat unusable
<script lang="ts"> import { useCompletion } from '@ai-sdk/svelte'; const { completion, input, handleSubmit, handleInputChange } = useCompletion({ api: '/api/openai/completion' }); </script> <form on:submit={handleSubmit}> <input name="prompt" bind:value={$input} on:input={handleInputChange} id="input" /> <button type="submit">Submit</button> <div>{$completion}</div> </form>
@ai-sdk/svelte 1.0.1
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
When importing and using useCompletion in svelte, multiple Returns like setInput and handleInputChange are missing. TS says the following:
(alias) useCompletion({ api, id, initialCompletion, initialInput, credentials, headers, body, streamProtocol, onResponse, onFinish, onError, fetch, }?: UseCompletionOptions): UseCompletionHelpers
import useCompletion
--> this makes the useCompletion hook somewhat unusable
Code example
AI provider
@ai-sdk/svelte 1.0.1
Additional context
No response
The text was updated successfully, but these errors were encountered: