-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ChatMode - extract as store, to persist between top-levels
Not sure it belongs here, maybe should be part of a Chat Store instead.
- Loading branch information
Showing
4 changed files
with
69 additions
and
45 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import * as React from 'react'; | ||
import { create } from 'zustand'; | ||
|
||
|
||
export type ChatModeId = 'immediate' | 'immediate-follow-up' | 'write-user' | 'react' | 'draw-imagine'; | ||
|
||
/// Describe the chat modes | ||
export const ChatModeItems: { [key in ChatModeId]: { label: string; description: string | React.JSX.Element; experimental?: boolean } } = { | ||
'immediate': { | ||
label: 'Chat', | ||
description: 'Persona answers', | ||
}, | ||
'immediate-follow-up': { | ||
label: 'Augmented Chat', | ||
description: 'Chat with follow-up questions', | ||
experimental: true, | ||
}, | ||
'write-user': { | ||
label: 'Write', | ||
description: 'Just append a message', | ||
}, | ||
'react': { | ||
label: 'Reason+Act', | ||
description: 'Answer your questions with ReAct and search', | ||
}, | ||
'draw-imagine': { | ||
label: 'Draw', | ||
description: 'AI Image Generation', | ||
}, | ||
}; | ||
|
||
|
||
/// Store | ||
|
||
interface ChatModeData { | ||
|
||
chatModeId: ChatModeId; | ||
setChatModeId: (chatModeId: ChatModeId) => void; | ||
|
||
} | ||
|
||
export const useChatModeStore = create<ChatModeData>()( | ||
(set) => ({ | ||
|
||
chatModeId: 'immediate', | ||
setChatModeId: (chatModeId) => set({ chatModeId }), | ||
|
||
}), | ||
); |
6b51a9f
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.
Successfully deployed to the following URLs:
big-agi – ./
big-agi-git-main-enricoros.vercel.app
get.big-agi.com
big-agi-enricoros.vercel.app