mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 12:06:35 +08:00
feat(core): add ai model switch ui (#12266)
Close [AI-86](https://linear.app/affine-design/issue/AI-86)  <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced AI model switching in chat, allowing users to select from multiple AI models during conversations. - Added a floating menu for easy AI model selection within the chat interface. - Enabled visibility of the AI model switcher through a new experimental feature flag, configurable in workspace settings (canary builds only). - **Enhancements** - Improved session management in the chat panel for smoother model switching and state handling. - Updated localization to support the new AI model switch feature in settings. - **Bug Fixes** - None. - **Chores** - Registered new components and services to support AI model switching functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -47,6 +47,7 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
|
||||
searchMenuConfig,
|
||||
networkSearchConfig,
|
||||
reasoningConfig,
|
||||
modelSwitchConfig,
|
||||
} = useAIChatConfig();
|
||||
|
||||
useEffect(() => {
|
||||
@@ -73,6 +74,7 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
|
||||
chatPanelRef.current.searchMenuConfig = searchMenuConfig;
|
||||
chatPanelRef.current.networkSearchConfig = networkSearchConfig;
|
||||
chatPanelRef.current.reasoningConfig = reasoningConfig;
|
||||
chatPanelRef.current.modelSwitchConfig = modelSwitchConfig;
|
||||
chatPanelRef.current.extensions = editor.host.std
|
||||
.get(ViewExtensionManagerIdentifier)
|
||||
.get('preview-page');
|
||||
@@ -107,6 +109,7 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
|
||||
networkSearchConfig,
|
||||
searchMenuConfig,
|
||||
reasoningConfig,
|
||||
modelSwitchConfig,
|
||||
]);
|
||||
|
||||
return <div className={styles.root} ref={containerRef} />;
|
||||
|
||||
Reference in New Issue
Block a user