-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add Vercel AI SDK, create API route, implement in ChatUI
#340
Merged
Conversation
This file contains 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
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
This was referenced May 9, 2024
Closed
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @AVGVSTVS96 and the rest of your teammates on |
This was referenced May 9, 2024
ChatUI
6055564
to
cbdbc65
Compare
This was referenced May 11, 2024
Merge activity
|
Use `createOpenAI` to create provider with api key, small updated to optimize `ChatUI.tsx`
- Move model selection logic to `Chat()` component, pass `selectedModel` and `onModelChange` to `GptSelect` as props. - Use post request to send model name to server with a `useEffect` hook in `Chat()`. - Update `chatRoute.ts` to accept model name, add `Message` type interface
Import and use `CoreMessage` type for messages Correctly import type for `APIContenxt` Remove unused prompt properties
Import and use `UseChatOptions` and `UseChatHelpers` types in `ChatUI.tsx`. Move api path setting to separate `chatOptions` where the type is assigned Create type interface for `ModelSelector`
…messages div Improves readability and reliability of the code Preserves whitespace in chat messages while allowing text to wrap
cbdbc65
to
38ca154
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Vercel AI SDK dependencies
Update
ChatUI.tsx
, add adduseChat
hookCreate basic
chatRoute.ts
file in/pages/api/
Use
createOpenAI
to create provider with api key, small updated to optimizeChatUI.tsx
Send modelName to server to dynamically select model
Move model selection logic to
Chat()
component, passselectedModel
andonModelChange
toGptSelect
as props.Use post request to send model name to server with a
useEffect
hook inChat()
.Update
chatRoute.ts
to accept model name, addMessage
type interface