mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 19:16:29 +08:00
feat(core): add reasoning icon button (#11941)
Close [AI-58](https://linear.app/affine-design/issue/AI-58). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a toggleable AI reasoning feature in the chat interface, allowing users to enable or disable advanced reasoning during AI chat interactions. - Added a new reasoning button to the chat input for quick access and control. - **Enhancements** - Improved chat configuration options to include reasoning settings, providing more flexibility for AI responses. - Streamlined network search and image upload interactions for a smoother user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// packages/frontend/core/src/blocksuite/ai/hooks/useChatPanelConfig.ts
|
||||
import { AINetworkSearchService } from '@affine/core/modules/ai-button/services/network-search';
|
||||
import { AIReasoningService } from '@affine/core/modules/ai-button/services/reasoning';
|
||||
import { CollectionService } from '@affine/core/modules/collection';
|
||||
import { DocsService } from '@affine/core/modules/doc';
|
||||
import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta';
|
||||
@@ -19,6 +20,7 @@ export function useAIChatConfig() {
|
||||
const framework = useFramework();
|
||||
|
||||
const searchService = framework.get(AINetworkSearchService);
|
||||
const reasoningService = framework.get(AIReasoningService);
|
||||
const docDisplayMetaService = framework.get(DocDisplayMetaService);
|
||||
const workspaceService = framework.get(WorkspaceService);
|
||||
const searchMenuService = framework.get(SearchMenuService);
|
||||
@@ -33,6 +35,11 @@ export function useAIChatConfig() {
|
||||
setEnabled: searchService.setEnabled,
|
||||
};
|
||||
|
||||
const reasoningConfig = {
|
||||
enabled: reasoningService.enabled,
|
||||
setEnabled: reasoningService.setEnabled,
|
||||
};
|
||||
|
||||
const docDisplayConfig = {
|
||||
getIcon: (docId: string) => {
|
||||
return docDisplayMetaService.icon$(docId, { type: 'lit' }).value;
|
||||
@@ -114,6 +121,7 @@ export function useAIChatConfig() {
|
||||
|
||||
return {
|
||||
networkSearchConfig,
|
||||
reasoningConfig,
|
||||
docDisplayConfig,
|
||||
searchMenuConfig,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user