-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
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
useCompletion refactoring. #808
Conversation
const newVariable = await readBody(event); | ||
console.log('nw', newVariable); | ||
const { prompt } = newVariable as { | ||
prompt: string; | ||
}; | ||
const { prompt } = await readBody(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor cleanup.
}), | ||
credentials, | ||
headers: { | ||
'Content-Type': 'application/json', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight change: this is now the default for all frameworks.
onFinish, | ||
onError, | ||
onData: data => { | ||
mutateStreamData(() => [...existingData, ...(data ?? [])]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch from streamData.value =
to `mutateStreamData
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Summary
callApi
tocallChatApi
callCompletionApi
useCompletion
implementations to usecallCompletionApi