@gooddata/sdk-ui-gen-ai 11.55.0-alpha.2 → 11.55.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +9 -9
- package/esm/components/ConfigContext.d.ts +1 -0
- package/esm/components/ConfigContext.d.ts.map +1 -1
- package/esm/components/CustomizationContext.d.ts +36 -0
- package/esm/components/CustomizationContext.d.ts.map +1 -0
- package/esm/components/CustomizationContext.js +18 -0
- package/esm/components/CustomizationProvider.d.ts +3 -12
- package/esm/components/CustomizationProvider.d.ts.map +1 -1
- package/esm/components/CustomizationProvider.js +109 -13
- package/esm/components/GenAIChatAgentDropdown.d.ts +2 -2
- package/esm/components/GenAIChatAgentDropdown.d.ts.map +1 -1
- package/esm/components/GenAIChatAgentDropdown.js +11 -7
- package/esm/components/GenAIChatContextIndicator.d.ts +2 -2
- package/esm/components/GenAIChatContextIndicator.d.ts.map +1 -1
- package/esm/components/GenAIChatContextIndicator.js +81 -13
- package/esm/components/GenAIChatWrapper.js +1 -1
- package/esm/components/GenAIStandaloneInput.d.ts +5 -0
- package/esm/components/GenAIStandaloneInput.d.ts.map +1 -1
- package/esm/components/GenAIStandaloneInput.js +3 -2
- package/esm/components/GenAiChatAgentSwitching.d.ts.map +1 -1
- package/esm/components/GenAiChatAgentSwitching.js +9 -3
- package/esm/components/GenAiChatContextChooser.d.ts.map +1 -1
- package/esm/components/GenAiChatContextChooser.js +4 -3
- package/esm/components/GenAiChatContextChooserBody.d.ts +3 -1
- package/esm/components/GenAiChatContextChooserBody.d.ts.map +1 -1
- package/esm/components/GenAiChatContextChooserBody.js +7 -4
- package/esm/components/GenAiConversations.d.ts +5 -0
- package/esm/components/GenAiConversations.d.ts.map +1 -1
- package/esm/components/GenAiConversations.js +2 -2
- package/esm/components/Input.js +1 -1
- package/esm/components/Messages.d.ts.map +1 -1
- package/esm/components/Messages.js +4 -5
- package/esm/components/customized/AgentChooser.d.ts +8 -0
- package/esm/components/customized/AgentChooser.d.ts.map +1 -0
- package/esm/components/customized/AgentChooser.js +11 -0
- package/esm/components/customized/AgentItem.d.ts +1 -1
- package/esm/components/customized/AgentItem.js +1 -1
- package/esm/components/customized/AssistantMessage.d.ts +8 -0
- package/esm/components/customized/AssistantMessage.d.ts.map +1 -0
- package/esm/components/customized/AssistantMessage.js +11 -0
- package/esm/components/customized/Disclaimer.d.ts +3 -1
- package/esm/components/customized/Disclaimer.d.ts.map +1 -1
- package/esm/components/customized/Disclaimer.js +3 -1
- package/esm/components/customized/Feedback.d.ts +8 -0
- package/esm/components/customized/Feedback.d.ts.map +1 -0
- package/esm/components/customized/Feedback.js +11 -0
- package/esm/components/customized/FollowUpButtons.d.ts +8 -0
- package/esm/components/customized/FollowUpButtons.d.ts.map +1 -0
- package/esm/components/customized/FollowUpButtons.js +11 -0
- package/esm/components/customized/FollowUpQuestion.d.ts +8 -0
- package/esm/components/customized/FollowUpQuestion.d.ts.map +1 -0
- package/esm/components/customized/FollowUpQuestion.js +11 -0
- package/esm/components/customized/LandingContainer.d.ts +6 -2
- package/esm/components/customized/LandingContainer.d.ts.map +1 -1
- package/esm/components/customized/LandingContainer.js +6 -2
- package/esm/components/customized/LandingQuestion.d.ts +6 -2
- package/esm/components/customized/LandingQuestion.d.ts.map +1 -1
- package/esm/components/customized/LandingQuestion.js +3 -1
- package/esm/components/customized/LandingScreen.d.ts +4 -2
- package/esm/components/customized/LandingScreen.d.ts.map +1 -1
- package/esm/components/customized/LandingScreen.js +3 -1
- package/esm/components/customized/LandingTitle.d.ts +7 -3
- package/esm/components/customized/LandingTitle.d.ts.map +1 -1
- package/esm/components/customized/LandingTitle.js +6 -2
- package/esm/components/customized/MessageErrorContent.d.ts +8 -0
- package/esm/components/customized/MessageErrorContent.d.ts.map +1 -0
- package/esm/components/customized/MessageErrorContent.js +11 -0
- package/esm/components/customized/MessageMultipartContent.d.ts +8 -0
- package/esm/components/customized/MessageMultipartContent.d.ts.map +1 -0
- package/esm/components/customized/MessageMultipartContent.js +11 -0
- package/esm/components/customized/MessageReasoningContent.d.ts +8 -0
- package/esm/components/customized/MessageReasoningContent.d.ts.map +1 -0
- package/esm/components/customized/MessageReasoningContent.js +11 -0
- package/esm/components/customized/MessageTextContent.d.ts +8 -0
- package/esm/components/customized/MessageTextContent.d.ts.map +1 -0
- package/esm/components/customized/MessageTextContent.js +11 -0
- package/esm/components/customized/UserMessage.d.ts +8 -0
- package/esm/components/customized/UserMessage.d.ts.map +1 -0
- package/esm/components/customized/UserMessage.js +11 -0
- package/esm/components/customized/types.d.ts +260 -1
- package/esm/components/customized/types.d.ts.map +1 -1
- package/esm/components/hooks/useContextChangeAnnouncement.d.ts +2 -2
- package/esm/components/hooks/useContextChangeAnnouncement.d.ts.map +1 -1
- package/esm/components/hooks/useContextChangeAnnouncement.js +9 -4
- package/esm/components/hooks/useContextItems.d.ts +9 -3
- package/esm/components/hooks/useContextItems.d.ts.map +1 -1
- package/esm/components/hooks/useContextItems.js +51 -8
- package/esm/components/hooks/useSettingsClick.d.ts.map +1 -1
- package/esm/components/hooks/useSettingsClick.js +2 -0
- package/esm/components/messages/AssistantItem.d.ts.map +1 -1
- package/esm/components/messages/AssistantItem.js +3 -3
- package/esm/components/messages/AssistantItemFeedback.d.ts +3 -6
- package/esm/components/messages/AssistantItemFeedback.d.ts.map +1 -1
- package/esm/components/messages/AssistantItemFeedback.js +3 -9
- package/esm/components/messages/AssistantItemFollowUpButtons.d.ts +14 -0
- package/esm/components/messages/AssistantItemFollowUpButtons.d.ts.map +1 -0
- package/esm/components/messages/AssistantItemFollowUpButtons.js +23 -0
- package/esm/components/messages/AssistantItemFollowUpQuestion.d.ts +14 -0
- package/esm/components/messages/AssistantItemFollowUpQuestion.d.ts.map +1 -0
- package/esm/components/messages/AssistantItemFollowUpQuestion.js +8 -0
- package/esm/components/messages/AssistantItemSuggestions.d.ts +3 -3
- package/esm/components/messages/AssistantItemSuggestions.d.ts.map +1 -1
- package/esm/components/messages/AssistantItemSuggestions.js +7 -15
- package/esm/components/messages/ConversationItemContents.d.ts.map +1 -1
- package/esm/components/messages/ConversationItemContents.js +7 -43
- package/esm/components/messages/components/SemanticSearchTreeView.d.ts.map +1 -1
- package/esm/components/messages/components/SemanticSearchTreeView.js +2 -0
- package/esm/components/messages/contents/CustomHyperlink.d.ts.map +1 -1
- package/esm/components/messages/contents/CustomHyperlink.js +1 -0
- package/esm/components/messages/contents/VisualizationContents.d.ts.map +1 -1
- package/esm/components/messages/contents/VisualizationContents.js +2 -0
- package/esm/components/messages/conversationContents/ConversationDashboardContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationDashboardContent.js +1 -0
- package/esm/components/messages/conversationContents/ConversationMultipartContent.d.ts +8 -0
- package/esm/components/messages/conversationContents/ConversationMultipartContent.d.ts.map +1 -0
- package/esm/components/messages/conversationContents/ConversationMultipartContent.js +40 -0
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.js +2 -0
- package/esm/components/utils/groupUtility.d.ts +3 -0
- package/esm/components/utils/groupUtility.d.ts.map +1 -1
- package/esm/context/addContextReference.d.ts +0 -2
- package/esm/context/addContextReference.d.ts.map +1 -1
- package/esm/context/addContextReference.js +12 -35
- package/esm/context/collectContextReferences.d.ts +2 -2
- package/esm/context/collectContextReferences.d.ts.map +1 -1
- package/esm/context/collectContextReferences.js +22 -20
- package/esm/context/removeContextReference.d.ts +2 -16
- package/esm/context/removeContextReference.d.ts.map +1 -1
- package/esm/context/removeContextReference.js +7 -70
- package/esm/context/selectContextReferences.d.ts +5 -0
- package/esm/context/selectContextReferences.d.ts.map +1 -0
- package/esm/context/selectContextReferences.js +68 -0
- package/esm/index.d.ts +12 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +10 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +8 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.js +8 -0
- package/esm/localization/bundles/zh-HK.localization-bundle.js +9 -9
- package/esm/sdk-ui-gen-ai.d.ts +378 -11
- package/esm/store/chatWindow/chatWindowSelectors.d.ts +2 -1
- package/esm/store/chatWindow/chatWindowSelectors.d.ts.map +1 -1
- package/esm/store/chatWindow/chatWindowSelectors.js +1 -0
- package/esm/store/chatWindow/chatWindowSlice.d.ts +2 -2
- package/esm/store/chatWindow/chatWindowSlice.d.ts.map +1 -1
- package/esm/store/chatWindow/chatWindowSlice.js +11 -6
- package/esm/store/sideEffects/onVisualizationSuccessSave.d.ts.map +1 -1
- package/esm/store/sideEffects/onVisualizationSuccessSave.js +2 -0
- package/esm/types.d.ts +22 -0
- package/esm/types.d.ts.map +1 -1
- package/esm/whatIf/whatIfMapping.d.ts +2 -2
- package/esm/whatIf/whatIfMapping.d.ts.map +1 -1
- package/esm/whatIf/whatIfMapping.js +3 -3
- package/package.json +21 -22
- package/styles/css/main.css +4 -0
- package/styles/css/main.css.map +1 -1
- package/styles/scss/main.scss +5 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2024-2026 GoodData Corporation
|
|
3
|
+
import { ConversationErrorContent } from "../messages/conversationContents/ConversationErrorContent.js";
|
|
4
|
+
/**
|
|
5
|
+
* Default implementation of the MessageErrorContent slot.
|
|
6
|
+
*
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
9
|
+
export function DefaultMessageErrorContent(props) {
|
|
10
|
+
return _jsx(ConversationErrorContent, { ...props });
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type IGenAIAssistantMessageMultipartContentProps } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Default implementation of the MessageMultipartContent slot.
|
|
4
|
+
*
|
|
5
|
+
* @alpha
|
|
6
|
+
*/
|
|
7
|
+
export declare function DefaultMessageMultipartContent(props: IGenAIAssistantMessageMultipartContentProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=MessageMultipartContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageMultipartContent.d.ts","sourceRoot":"","sources":["../../../src/components/customized/MessageMultipartContent.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,2CAA2C,EAAE,MAAM,YAAY,CAAC;AAE9E;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,2CAA2C,2CAEhG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2024-2026 GoodData Corporation
|
|
3
|
+
import { ConversationMultipartContent } from "../messages/conversationContents/ConversationMultipartContent.js";
|
|
4
|
+
/**
|
|
5
|
+
* Default implementation of the MessageMultipartContent slot.
|
|
6
|
+
*
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
9
|
+
export function DefaultMessageMultipartContent(props) {
|
|
10
|
+
return _jsx(ConversationMultipartContent, { ...props });
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type IGenAIAssistantMessageReasoningContentProps } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Default implementation of the MessageReasoningContent slot.
|
|
4
|
+
*
|
|
5
|
+
* @alpha
|
|
6
|
+
*/
|
|
7
|
+
export declare function DefaultMessageReasoningContent(props: IGenAIAssistantMessageReasoningContentProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=MessageReasoningContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageReasoningContent.d.ts","sourceRoot":"","sources":["../../../src/components/customized/MessageReasoningContent.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,2CAA2C,EAAE,MAAM,YAAY,CAAC;AAE9E;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,2CAA2C,2CAEhG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2024-2026 GoodData Corporation
|
|
3
|
+
import { ConversationReasoningContent } from "../messages/conversationContents/ConversationReasoningContent.js";
|
|
4
|
+
/**
|
|
5
|
+
* Default implementation of the MessageReasoningContent slot.
|
|
6
|
+
*
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
9
|
+
export function DefaultMessageReasoningContent(props) {
|
|
10
|
+
return _jsx(ConversationReasoningContent, { ...props });
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type IGenAIAssistantMessageTextContentProps } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Default implementation of the MessageTextContent slot.
|
|
4
|
+
*
|
|
5
|
+
* @alpha
|
|
6
|
+
*/
|
|
7
|
+
export declare function DefaultMessageTextContent(props: IGenAIAssistantMessageTextContentProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=MessageTextContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageTextContent.d.ts","sourceRoot":"","sources":["../../../src/components/customized/MessageTextContent.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,sCAAsC,EAAE,MAAM,YAAY,CAAC;AAEzE;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,sCAAsC,2CAEtF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2024-2026 GoodData Corporation
|
|
3
|
+
import { ConversationTextContent } from "../messages/conversationContents/ConversationTextContent.js";
|
|
4
|
+
/**
|
|
5
|
+
* Default implementation of the MessageTextContent slot.
|
|
6
|
+
*
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
9
|
+
export function DefaultMessageTextContent(props) {
|
|
10
|
+
return _jsx(ConversationTextContent, { ...props });
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type IGenAIAssistantUserMessageProps } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Default implementation of the UserMessage slot.
|
|
4
|
+
*
|
|
5
|
+
* @alpha
|
|
6
|
+
*/
|
|
7
|
+
export declare function DefaultUserMessage(props: IGenAIAssistantUserMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=UserMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserMessage.d.ts","sourceRoot":"","sources":["../../../src/components/customized/UserMessage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,+BAA+B,2CAExE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2024-2026 GoodData Corporation
|
|
3
|
+
import { UserItemComponent } from "../messages/UserItem.js";
|
|
4
|
+
/**
|
|
5
|
+
* Default implementation of the UserMessage slot.
|
|
6
|
+
*
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
9
|
+
export function DefaultUserMessage(props) {
|
|
10
|
+
return _jsx(UserItemComponent, { ...props });
|
|
11
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type ComponentType } from "react";
|
|
2
|
+
import { type IChatSuggestion } from "@gooddata/sdk-backend-spi";
|
|
3
|
+
import { type GenAIChatEffort } from "@gooddata/sdk-model";
|
|
2
4
|
import { type ISlotProps, type IUiMenuInteractiveItemProps, type IUiMenuInteractiveItemWrapperProps } from "@gooddata/sdk-ui-kit";
|
|
3
|
-
import { type GenAIAgent } from "../../model.js";
|
|
5
|
+
import { type GenAIAgent, type IChatConversationErrorContent, type IChatConversationLocal, type IChatConversationLocalItem, type IChatConversationMultipartLocalPart, type TextContentObject } from "../../model.js";
|
|
6
|
+
import { type IChatMessagesGroup } from "../utils/groupUtility.js";
|
|
4
7
|
/**
|
|
5
8
|
* Properties for the LandingScreen slot.
|
|
6
9
|
* @public
|
|
@@ -46,6 +49,212 @@ export type IGenAIAssistantAgentItemProps = {
|
|
|
46
49
|
*/
|
|
47
50
|
Content?: ComponentType<IUiMenuInteractiveItemProps>;
|
|
48
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* Properties for the UserMessage slot.
|
|
54
|
+
* @alpha
|
|
55
|
+
*/
|
|
56
|
+
export type IGenAIAssistantUserMessageProps = {
|
|
57
|
+
/**
|
|
58
|
+
* The message to render.
|
|
59
|
+
*/
|
|
60
|
+
message: IChatConversationLocalItem;
|
|
61
|
+
/**
|
|
62
|
+
* The groups of messages in the conversation.
|
|
63
|
+
*/
|
|
64
|
+
groups: IChatMessagesGroup[];
|
|
65
|
+
/**
|
|
66
|
+
* Whether the message is the last one in the conversation.
|
|
67
|
+
*/
|
|
68
|
+
isLast?: boolean;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Properties for the AssistantMessage slot.
|
|
72
|
+
* @alpha
|
|
73
|
+
*/
|
|
74
|
+
export type IGenAIAssistantAssistantMessageProps = {
|
|
75
|
+
/**
|
|
76
|
+
* The message to render.
|
|
77
|
+
*/
|
|
78
|
+
message: IChatConversationLocalItem;
|
|
79
|
+
/**
|
|
80
|
+
* The groups of messages in the conversation.
|
|
81
|
+
*/
|
|
82
|
+
groups: IChatMessagesGroup[];
|
|
83
|
+
/**
|
|
84
|
+
* Whether the message is the last one in the conversation.
|
|
85
|
+
*/
|
|
86
|
+
isLast?: boolean;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Properties for the MessageTextContent slot.
|
|
90
|
+
* @alpha
|
|
91
|
+
*/
|
|
92
|
+
export type IGenAIAssistantMessageTextContentProps = {
|
|
93
|
+
/**
|
|
94
|
+
* The text to render.
|
|
95
|
+
*/
|
|
96
|
+
text: string;
|
|
97
|
+
/**
|
|
98
|
+
* The objects to render as links in the text.
|
|
99
|
+
*/
|
|
100
|
+
objects: TextContentObject[];
|
|
101
|
+
/**
|
|
102
|
+
* Whether the message is still loading.
|
|
103
|
+
*/
|
|
104
|
+
isLoading?: boolean;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Properties for the MessageErrorContent slot.
|
|
108
|
+
* @alpha
|
|
109
|
+
*/
|
|
110
|
+
export type IGenAIAssistantMessageErrorContentProps = IChatConversationErrorContent & {
|
|
111
|
+
/**
|
|
112
|
+
* Whether the message is still loading.
|
|
113
|
+
*/
|
|
114
|
+
isLoading?: boolean;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Properties for the MessageReasoningContent slot.
|
|
118
|
+
* @alpha
|
|
119
|
+
*/
|
|
120
|
+
export type IGenAIAssistantMessageReasoningContentProps = {
|
|
121
|
+
/**
|
|
122
|
+
* The summary of the reasoning.
|
|
123
|
+
*/
|
|
124
|
+
summary: string;
|
|
125
|
+
/**
|
|
126
|
+
* The objects to render as links in the reasoning.
|
|
127
|
+
*/
|
|
128
|
+
objects: TextContentObject[];
|
|
129
|
+
/**
|
|
130
|
+
* Whether the message is still loading.
|
|
131
|
+
*/
|
|
132
|
+
isLoading?: boolean;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Properties for the MessageMultipartContent slot.
|
|
136
|
+
* @alpha
|
|
137
|
+
*/
|
|
138
|
+
export type IGenAIAssistantMessageMultipartContentProps = {
|
|
139
|
+
/**
|
|
140
|
+
* The message containing the multipart content.
|
|
141
|
+
*/
|
|
142
|
+
message: IChatConversationLocalItem;
|
|
143
|
+
/**
|
|
144
|
+
* The parts of the multipart content.
|
|
145
|
+
*/
|
|
146
|
+
parts: IChatConversationMultipartLocalPart[];
|
|
147
|
+
/**
|
|
148
|
+
* The references to metadata objects.
|
|
149
|
+
*/
|
|
150
|
+
references: TextContentObject[];
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Properties for the FollowUpButtons slot.
|
|
154
|
+
* @alpha
|
|
155
|
+
*/
|
|
156
|
+
export type IGenAIAssistantFollowUpButtonsProps = {
|
|
157
|
+
/**
|
|
158
|
+
* The message to render follow up buttons for.
|
|
159
|
+
*/
|
|
160
|
+
message: IChatConversationLocalItem;
|
|
161
|
+
/**
|
|
162
|
+
* The suggestions for follow up questions.
|
|
163
|
+
*/
|
|
164
|
+
suggestions: IChatSuggestion[];
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Properties for the FollowUpQuestion slot.
|
|
168
|
+
* @alpha
|
|
169
|
+
*/
|
|
170
|
+
export type IGenAIAssistantFollowUpQuestionProps = {
|
|
171
|
+
/**
|
|
172
|
+
* The message to render follow up question for.
|
|
173
|
+
*/
|
|
174
|
+
message: IChatConversationLocalItem;
|
|
175
|
+
/**
|
|
176
|
+
* The follow up question text.
|
|
177
|
+
*/
|
|
178
|
+
question: string;
|
|
179
|
+
/**
|
|
180
|
+
* The references to metadata objects.
|
|
181
|
+
*/
|
|
182
|
+
references: TextContentObject[];
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Properties for the Feedback slot.
|
|
186
|
+
* @alpha
|
|
187
|
+
*/
|
|
188
|
+
export type IGenAIAssistantFeedbackProps = {
|
|
189
|
+
/**
|
|
190
|
+
* The message to render feedback buttons for.
|
|
191
|
+
*/
|
|
192
|
+
message: IChatConversationLocalItem;
|
|
193
|
+
/**
|
|
194
|
+
* The groups of messages in the conversation.
|
|
195
|
+
*/
|
|
196
|
+
group: IChatMessagesGroup;
|
|
197
|
+
/**
|
|
198
|
+
* Whether the message is the last one in the conversation.
|
|
199
|
+
*/
|
|
200
|
+
isLast?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Whether the feedback is hidden.
|
|
203
|
+
*/
|
|
204
|
+
isHidden?: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Whether the related message is complete.
|
|
207
|
+
*/
|
|
208
|
+
isComplete?: boolean;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Properties for the AgentChooser slot.
|
|
212
|
+
* @alpha
|
|
213
|
+
*/
|
|
214
|
+
export type IGenAIAssistantAgentChooserProps = {
|
|
215
|
+
/**
|
|
216
|
+
* The available agents to choose from.
|
|
217
|
+
*/
|
|
218
|
+
agents: GenAIAgent[];
|
|
219
|
+
/**
|
|
220
|
+
* The conversations in the chat history.
|
|
221
|
+
*/
|
|
222
|
+
conversations?: IChatConversationLocal[];
|
|
223
|
+
/**
|
|
224
|
+
* The agent id associated with the current conversation.
|
|
225
|
+
*/
|
|
226
|
+
conversationAgentId?: string;
|
|
227
|
+
/**
|
|
228
|
+
* The currently selected agent id.
|
|
229
|
+
*/
|
|
230
|
+
selectedAgentId?: string;
|
|
231
|
+
/**
|
|
232
|
+
* The effective selected agent id, taking into account the current conversation and available agents.
|
|
233
|
+
*/
|
|
234
|
+
effectiveSelectedAgentId?: string;
|
|
235
|
+
/**
|
|
236
|
+
* Callback when an agent is selected.
|
|
237
|
+
*/
|
|
238
|
+
onSelectAgent: (agentId: string | undefined, options?: {
|
|
239
|
+
showChangeEvent?: boolean;
|
|
240
|
+
}) => void;
|
|
241
|
+
/**
|
|
242
|
+
* The currently selected reasoning effort.
|
|
243
|
+
*/
|
|
244
|
+
selectedEffort?: GenAIChatEffort;
|
|
245
|
+
/**
|
|
246
|
+
* Callback when a reasoning effort is selected.
|
|
247
|
+
*/
|
|
248
|
+
onSelectEffort?: (effort: GenAIChatEffort) => void;
|
|
249
|
+
/**
|
|
250
|
+
* Whether the agent chooser is disabled.
|
|
251
|
+
*/
|
|
252
|
+
isDisabled?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Whether the agent chooser is loading.
|
|
255
|
+
*/
|
|
256
|
+
isLoading?: boolean;
|
|
257
|
+
};
|
|
49
258
|
/**
|
|
50
259
|
* Customizations for the Gen AI assistant.
|
|
51
260
|
* @public
|
|
@@ -64,5 +273,55 @@ export interface IGenAIAssistantSlots {
|
|
|
64
273
|
* Custom React component rendered for each agent in the agent chooser dropdown.
|
|
65
274
|
*/
|
|
66
275
|
AgentItem?: ComponentType<ISlotProps<IGenAIAssistantAgentItemProps>>;
|
|
276
|
+
/**
|
|
277
|
+
* @alpha
|
|
278
|
+
* Custom React component rendered for each user message.
|
|
279
|
+
*/
|
|
280
|
+
UserMessage?: ComponentType<ISlotProps<IGenAIAssistantUserMessageProps>>;
|
|
281
|
+
/**
|
|
282
|
+
* @alpha
|
|
283
|
+
* Custom React component rendered for each assistant message.
|
|
284
|
+
*/
|
|
285
|
+
AssistantMessage?: ComponentType<ISlotProps<IGenAIAssistantAssistantMessageProps>>;
|
|
286
|
+
/**
|
|
287
|
+
* @alpha
|
|
288
|
+
* Custom React component rendered for text content of a message.
|
|
289
|
+
*/
|
|
290
|
+
MessageTextContent?: ComponentType<ISlotProps<IGenAIAssistantMessageTextContentProps>>;
|
|
291
|
+
/**
|
|
292
|
+
* @alpha
|
|
293
|
+
* Custom React component rendered for error content of a message.
|
|
294
|
+
*/
|
|
295
|
+
MessageErrorContent?: ComponentType<ISlotProps<IGenAIAssistantMessageErrorContentProps>>;
|
|
296
|
+
/**
|
|
297
|
+
* @alpha
|
|
298
|
+
* Custom React component rendered for reasoning content of a message.
|
|
299
|
+
*/
|
|
300
|
+
MessageReasoningContent?: ComponentType<ISlotProps<IGenAIAssistantMessageReasoningContentProps>>;
|
|
301
|
+
/**
|
|
302
|
+
* @alpha
|
|
303
|
+
* Custom React component rendered for multipart content of a message.
|
|
304
|
+
*/
|
|
305
|
+
MessageMultipartContent?: ComponentType<ISlotProps<IGenAIAssistantMessageMultipartContentProps>>;
|
|
306
|
+
/**
|
|
307
|
+
* @alpha
|
|
308
|
+
* Custom React component rendered for follow up buttons of a message.
|
|
309
|
+
*/
|
|
310
|
+
FollowUpButtons?: ComponentType<ISlotProps<IGenAIAssistantFollowUpButtonsProps>>;
|
|
311
|
+
/**
|
|
312
|
+
* @alpha
|
|
313
|
+
* Custom React component rendered for feedback buttons of a message.
|
|
314
|
+
*/
|
|
315
|
+
Feedback?: ComponentType<ISlotProps<IGenAIAssistantFeedbackProps>>;
|
|
316
|
+
/**
|
|
317
|
+
* @alpha
|
|
318
|
+
* Custom React component rendered for follow up question of a message.
|
|
319
|
+
*/
|
|
320
|
+
FollowUpQuestion?: ComponentType<ISlotProps<IGenAIAssistantFollowUpQuestionProps>>;
|
|
321
|
+
/**
|
|
322
|
+
* @alpha
|
|
323
|
+
* Custom React component rendered for the agent chooser.
|
|
324
|
+
*/
|
|
325
|
+
AgentChooser?: ComponentType<ISlotProps<IGenAIAssistantAgentChooserProps>>;
|
|
67
326
|
}
|
|
68
327
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/customized/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EACH,KAAK,UAAU,EACf,KAAK,2BAA2B,EAChC,KAAK,kCAAkC,EAC1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/customized/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACH,KAAK,UAAU,EACf,KAAK,2BAA2B,EAChC,KAAK,kCAAkC,EAC1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,KAAK,UAAU,EACf,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EACxC,KAAK,iBAAiB,EACzB,MAAM,gBAAgB,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aAAa,CAAC,UAAU,CAAC,uCAAuC,CAAC,CAAC,CAAC;IAEzF;;;OAGG;IACH,uBAAuB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,2CAA2C,CAAC,CAAC,CAAC;IAEjG;;;OAGG;IACH,uBAAuB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,2CAA2C,CAAC,CAAC,CAAC;IAEjG;;;OAGG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,mCAAmC,CAAC,CAAC,CAAC;IAEjF;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAEnE;;;OAGG;IACH,gBAAgB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,oCAAoC,CAAC,CAAC,CAAC;IAEnF;;;OAGG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC,CAAC;CAC9E"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type IGenAIContextObject } from "../../types.js";
|
|
1
|
+
import { type IGenAIContextObject, type SelectedContext } from "../../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Turns each change of the assistant context into one spoken sentence: what was added, what was
|
|
4
4
|
* removed, that the whole context was swapped (the user navigated to another dashboard), or that
|
|
5
5
|
* nothing is left.
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
export declare function useContextChangeAnnouncement(references: IGenAIContextObject[]): string;
|
|
8
|
+
export declare function useContextChangeAnnouncement(selected: SelectedContext | undefined, references: IGenAIContextObject[]): string;
|
|
9
9
|
//# sourceMappingURL=useContextChangeAnnouncement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContextChangeAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useContextChangeAnnouncement.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"useContextChangeAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useContextChangeAnnouncement.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAmBhF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CACxC,QAAQ,EAAE,eAAe,GAAG,SAAS,EACrC,UAAU,EAAE,mBAAmB,EAAE,GAClC,MAAM,CA6BR"}
|
|
@@ -22,24 +22,29 @@ const ANNOUNCEMENT_DELAY = 250;
|
|
|
22
22
|
* nothing is left.
|
|
23
23
|
* @internal
|
|
24
24
|
*/
|
|
25
|
-
export function useContextChangeAnnouncement(references) {
|
|
25
|
+
export function useContextChangeAnnouncement(selected, references) {
|
|
26
26
|
const intl = useIntl();
|
|
27
27
|
const [announcement, setAnnouncement] = useState("");
|
|
28
28
|
const previousReferences = useRef(null);
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
const previous = previousReferences.current;
|
|
31
|
-
|
|
31
|
+
const all = [
|
|
32
|
+
...(selected?.activated && selected.dashboard ? [selected.dashboard] : []),
|
|
33
|
+
...(selected?.activated && selected.visualization ? [selected.visualization] : []),
|
|
34
|
+
...references,
|
|
35
|
+
];
|
|
36
|
+
previousReferences.current = all;
|
|
32
37
|
if (previous === null) {
|
|
33
38
|
return undefined;
|
|
34
39
|
}
|
|
35
|
-
const message = getAnnouncement(previous,
|
|
40
|
+
const message = getAnnouncement(previous, all, intl);
|
|
36
41
|
if (!message) {
|
|
37
42
|
return undefined;
|
|
38
43
|
}
|
|
39
44
|
setAnnouncement("");
|
|
40
45
|
const timeout = setTimeout(() => setAnnouncement(message), ANNOUNCEMENT_DELAY);
|
|
41
46
|
return () => clearTimeout(timeout);
|
|
42
|
-
}, [references, intl]);
|
|
47
|
+
}, [references, intl, selected]);
|
|
43
48
|
return announcement;
|
|
44
49
|
}
|
|
45
50
|
function getAnnouncement(previous, current, intl) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type IGenAIUserContext } from "@gooddata/sdk-model";
|
|
2
|
-
import { type IGenAIContextObject } from "../../types.js";
|
|
3
|
-
export declare function
|
|
1
|
+
import { type IGenAIUserContext, type ObjRef } from "@gooddata/sdk-model";
|
|
2
|
+
import { type IGenAIContextObject, type SelectedContext } from "../../types.js";
|
|
3
|
+
export declare function useUserContextItems(ambientContext: IGenAIUserContext | undefined, selectedContext: SelectedContext | undefined, activeContext: IGenAIUserContext | undefined): {
|
|
4
4
|
items: IGenAIContextObject[];
|
|
5
5
|
search: string;
|
|
6
6
|
setSearch: (value: string) => void;
|
|
@@ -8,4 +8,10 @@ export declare function useContextItems(ambient: IGenAIUserContext | undefined,
|
|
|
8
8
|
hasNextPage: boolean;
|
|
9
9
|
loadNextPage: () => void;
|
|
10
10
|
};
|
|
11
|
+
export declare function useAmbientContextItems(ambientContext: IGenAIUserContext | undefined): {
|
|
12
|
+
items: IGenAIContextObject[];
|
|
13
|
+
search: string;
|
|
14
|
+
setSearch: (value: string) => void;
|
|
15
|
+
selectedIds: ObjRef[];
|
|
16
|
+
};
|
|
11
17
|
//# sourceMappingURL=useContextItems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContextItems.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useContextItems.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,iBAAiB,EAAmB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useContextItems.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useContextItems.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,MAAM,EAAmB,MAAM,qBAAqB,CAAC;AAe3F,OAAO,EAIH,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACvB,MAAM,gBAAgB,CAAC;AAExB,wBAAgB,mBAAmB,CAC/B,cAAc,EAAE,iBAAiB,GAAG,SAAS,EAC7C,eAAe,EAAE,eAAe,GAAG,SAAS,EAC5C,aAAa,EAAE,iBAAiB,GAAG,SAAS;;;;;;;EA8E/C;AAED,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,iBAAiB,GAAG,SAAS;;;;;EA0CnF"}
|
|
@@ -4,9 +4,9 @@ import { useIntl } from "react-intl";
|
|
|
4
4
|
import { useDispatch, useSelector } from "react-redux";
|
|
5
5
|
import { serializeObjRef } from "@gooddata/sdk-model";
|
|
6
6
|
import { collectAvailableReferences, collectContextReferences, } from "../../context/collectContextReferences.js";
|
|
7
|
-
import { contextObjectsSearchSelector, contextObjectsSelector, } from "../../store/chatWindow/chatWindowSelectors.js";
|
|
7
|
+
import { contextObjectsSearchSelector, contextObjectsSelector, selectedContextSelector, } from "../../store/chatWindow/chatWindowSelectors.js";
|
|
8
8
|
import { loadContextObjectsNextPageAction, setContextObjectsSearchAction, } from "../../store/chatWindow/chatWindowSlice.js";
|
|
9
|
-
export function
|
|
9
|
+
export function useUserContextItems(ambientContext, selectedContext, activeContext) {
|
|
10
10
|
const intl = useIntl();
|
|
11
11
|
const dispatch = useDispatch();
|
|
12
12
|
const emptyReferenceLabel = intl.formatMessage({ id: "gd.gen-ai.context.untitled" });
|
|
@@ -16,10 +16,9 @@ export function useContextItems(ambient, active) {
|
|
|
16
16
|
const visualizations = contextObjects.visualization;
|
|
17
17
|
const items = useMemo(() => {
|
|
18
18
|
const matchesSearch = titleMatcher(search);
|
|
19
|
-
const
|
|
20
|
-
const selectedReferences = collectContextReferences(active, emptyReferenceLabel);
|
|
19
|
+
const selectedReferences = collectContextReferences(activeContext, selectedContext, emptyReferenceLabel);
|
|
21
20
|
const offered = new Set();
|
|
22
|
-
collectAvailableReferences(
|
|
21
|
+
collectAvailableReferences(ambientContext, emptyReferenceLabel).forEach((reference) => {
|
|
23
22
|
offered.add(serializeObjRef(reference.ref));
|
|
24
23
|
if (reference.insightRef) {
|
|
25
24
|
offered.add(serializeObjRef(reference.insightRef));
|
|
@@ -29,8 +28,16 @@ export function useContextItems(ambient, active) {
|
|
|
29
28
|
...searchable(dashboards, "dashboard", emptyReferenceLabel, matchesSearch),
|
|
30
29
|
...searchable(visualizations, "visualization", emptyReferenceLabel, matchesSearch),
|
|
31
30
|
].filter((reference) => !offered.has(serializeObjRef(reference.ref)));
|
|
32
|
-
return
|
|
33
|
-
}, [
|
|
31
|
+
return workspaceReferences.filter((reference) => !selectedReferences.some((selectedReference) => isSameObject(selectedReference, reference)));
|
|
32
|
+
}, [
|
|
33
|
+
search,
|
|
34
|
+
ambientContext,
|
|
35
|
+
emptyReferenceLabel,
|
|
36
|
+
activeContext,
|
|
37
|
+
selectedContext,
|
|
38
|
+
dashboards,
|
|
39
|
+
visualizations,
|
|
40
|
+
]);
|
|
34
41
|
const setSearch = useCallback((value) => {
|
|
35
42
|
if (value === search) {
|
|
36
43
|
return;
|
|
@@ -57,8 +64,44 @@ export function useContextItems(ambient, active) {
|
|
|
57
64
|
loadNextPage,
|
|
58
65
|
};
|
|
59
66
|
}
|
|
67
|
+
export function useAmbientContextItems(ambientContext) {
|
|
68
|
+
const intl = useIntl();
|
|
69
|
+
const dispatch = useDispatch();
|
|
70
|
+
const emptyReferenceLabel = intl.formatMessage({ id: "gd.gen-ai.context.untitled" });
|
|
71
|
+
const thisDashboardLabel = intl.formatMessage({ id: "gd.gen-ai.context.this" });
|
|
72
|
+
const search = useSelector(contextObjectsSearchSelector);
|
|
73
|
+
const selected = useSelector(selectedContextSelector);
|
|
74
|
+
const items = useMemo(() => {
|
|
75
|
+
const matchesSearch = titleMatcher(search);
|
|
76
|
+
return collectAvailableReferences(ambientContext, emptyReferenceLabel)
|
|
77
|
+
.map((item) => {
|
|
78
|
+
if (item.type === "dashboard") {
|
|
79
|
+
return {
|
|
80
|
+
...item,
|
|
81
|
+
title: thisDashboardLabel,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return item;
|
|
85
|
+
})
|
|
86
|
+
.filter(matchesSearch);
|
|
87
|
+
}, [search, ambientContext, emptyReferenceLabel, thisDashboardLabel]);
|
|
88
|
+
const setSearch = useCallback((value) => {
|
|
89
|
+
if (value === search) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
dispatch(setContextObjectsSearchAction({ search: value }));
|
|
93
|
+
}, [dispatch, search]);
|
|
94
|
+
return {
|
|
95
|
+
items,
|
|
96
|
+
search,
|
|
97
|
+
setSearch,
|
|
98
|
+
selectedIds: [
|
|
99
|
+
selected?.visualization?.ref ? selected?.visualization?.ref : selected?.dashboard?.ref,
|
|
100
|
+
].filter(Boolean),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
60
103
|
function titleMatcher(search) {
|
|
61
|
-
const normalized = search.trim().toLowerCase();
|
|
104
|
+
const normalized = (search || "").trim().toLowerCase();
|
|
62
105
|
return normalized ? (reference) => reference.title.toLowerCase().includes(normalized) : () => true;
|
|
63
106
|
}
|
|
64
107
|
function searchable(list, type, emptyReferenceLabel, matchesSearch) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSettingsClick.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useSettingsClick.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAmBrD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"useSettingsClick.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useSettingsClick.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAmBrD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,gGA0E/D"}
|
|
@@ -27,6 +27,7 @@ export function useSettingsClick(settings) {
|
|
|
27
27
|
id: CHANGE_LLM_MODEL_ACTION,
|
|
28
28
|
workspaceId,
|
|
29
29
|
type: "setting",
|
|
30
|
+
action: "open",
|
|
30
31
|
newTab: e.metaKey,
|
|
31
32
|
section: GEN_AI_SECTION,
|
|
32
33
|
preventDefault: e.preventDefault.bind(e),
|
|
@@ -47,6 +48,7 @@ export function useSettingsClick(settings) {
|
|
|
47
48
|
linkHandler?.({
|
|
48
49
|
id: CREATE_LLM_PROVIDER_ACTION,
|
|
49
50
|
workspaceId,
|
|
51
|
+
action: "open",
|
|
50
52
|
type: "setting",
|
|
51
53
|
newTab: e.metaKey,
|
|
52
54
|
section: GEN_AI_SECTION,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantItem.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItem.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantItem.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItem.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAOjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAOnE,KAAK,kBAAkB,GAAG;IACtB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,kBAAkB,kDAqFrF"}
|
|
@@ -6,10 +6,10 @@ import { useIntl } from "react-intl";
|
|
|
6
6
|
import { useSelector } from "react-redux";
|
|
7
7
|
import { interactionIntelligenceEnabledSelector } from "../../store/chatWindow/chatWindowSelectors.js";
|
|
8
8
|
import { useToolsReferences } from "../completion/useToolsReferences.js";
|
|
9
|
+
import { useCustomization } from "../CustomizationContext.js";
|
|
9
10
|
import { useInteractionIntelligenceTotals } from "../intelligence/data/useInteractionIntelligenceTotals.js";
|
|
10
11
|
import { GenAiInteractionIntelligence } from "../intelligence/GenAiInteractionIntelligence.js";
|
|
11
12
|
import { InteractionIntelligenceTrigger } from "../intelligence/InteractionIntelligenceTrigger.js";
|
|
12
|
-
import { AssistantItemFeedback } from "./AssistantItemFeedback.js";
|
|
13
13
|
import { AssistantItemSuggestions } from "./AssistantItemSuggestions.js";
|
|
14
14
|
import { ReasoningIcon } from "./contents/ReasoningIcon.js";
|
|
15
15
|
import { ConversationItemContents } from "./ConversationItemContents.js";
|
|
@@ -19,6 +19,7 @@ export function AssistantItemComponent({ message, groups, isLast }) {
|
|
|
19
19
|
const group = groups[groups.length - 1];
|
|
20
20
|
const messageState = getItemState(message);
|
|
21
21
|
const references = useToolsReferences(groups);
|
|
22
|
+
const { FeedbackComponent } = useCustomization();
|
|
22
23
|
const [isInteractionIntelligenceOpen, setIsInteractionIntelligenceOpen] = useState(false);
|
|
23
24
|
const interactionIntelligenceEnabled = useSelector(interactionIntelligenceEnabledSelector);
|
|
24
25
|
const showInteractionIntelligence = interactionIntelligenceEnabled && !!message.responseId && message.content.type !== "reasoning";
|
|
@@ -36,7 +37,6 @@ export function AssistantItemComponent({ message, groups, isLast }) {
|
|
|
36
37
|
return null;
|
|
37
38
|
}
|
|
38
39
|
return (_jsxs("div", { className: classNames, "data-state": messageState, "data-testid": "gen-ai-conversation-assistant-message", children: [
|
|
39
|
-
_jsx("span", { className: "gd-gen-ai-chat__visually__hidden", children: intl.formatMessage({ id: "gd.gen-ai.message.label.assistant" }) }), _jsx(ReasoningIcon, { content: message.content }), _jsx(ConversationItemContents, { role: "assistant", message: message, references: references, isLoading: messageState === "loading", isLast: isLast }), _jsx(AssistantItemSuggestions, { type: "followUp",
|
|
40
|
-
_jsx(AssistantItemFeedback, { group: group, message: message, isLast: isLast, hasInteractionIntelligenceTrigger: hasInteractionIntelligenceTrigger }), showInteractionIntelligence ? (_jsx(InteractionIntelligenceTrigger, { totals: interactionIntelligenceTotals, isOpen: isInteractionIntelligenceOpen, onToggle: () => setIsInteractionIntelligenceOpen((current) => !current) })) : null] }), showInteractionIntelligence && isInteractionIntelligenceOpen ? (_jsx(GenAiInteractionIntelligence, { responseId: message.responseId, onClose: () => setIsInteractionIntelligenceOpen(false) })) : null, _jsx(AssistantItemSuggestions, { type: "actions", content: message.content, showSuggestions: isLast })
|
|
40
|
+
_jsx("span", { className: "gd-gen-ai-chat__visually__hidden", children: intl.formatMessage({ id: "gd.gen-ai.message.label.assistant" }) }), _jsx(ReasoningIcon, { content: message.content }), _jsx(ConversationItemContents, { role: "assistant", message: message, references: references, isLoading: messageState === "loading", isLast: isLast }), _jsx(AssistantItemSuggestions, { type: "followUp", message: message, showSuggestions: true, references: references }), _jsxs("div", { className: "gd-gen-ai-chat__conversation__item__actions", children: [group.type === "assistant" && message.content.type !== "reasoning" ? (_jsx(FeedbackComponent, { group: group, message: message, isLast: Boolean(isLast), isComplete: Boolean(message.complete), isHidden: Boolean(hasInteractionIntelligenceTrigger && !isLast) })) : null, showInteractionIntelligence ? (_jsx(InteractionIntelligenceTrigger, { totals: interactionIntelligenceTotals, isOpen: isInteractionIntelligenceOpen, onToggle: () => setIsInteractionIntelligenceOpen((current) => !current) })) : null] }), showInteractionIntelligence && isInteractionIntelligenceOpen ? (_jsx(GenAiInteractionIntelligence, { responseId: message.responseId, onClose: () => setIsInteractionIntelligenceOpen(false) })) : null, _jsx(AssistantItemSuggestions, { type: "actions", message: message, showSuggestions: isLast })
|
|
41
41
|
] }));
|
|
42
42
|
}
|