@agentscope-ai/chat 1.1.39 → 1.1.41-beta.1764749089549
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/bin/starter_webui.zip +0 -0
- package/components/AgentScopeRuntimeWebUI/core/AgentScopeRuntime/Response/Builder.tsx +8 -4
- package/components/ImageGenerator/index.tsx +1 -1
- package/components/Markdown/Markdown.tsx +105 -0
- package/components/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.tsx +1 -1
- package/components/Markdown/core/components/Null.tsx +1 -0
- package/components/Markdown/core/components/Raw.tsx +18 -0
- package/components/Markdown/{Markdown → core}/hooks/useCitationsData.tsx +3 -7
- package/components/Markdown/core/hooks/useCursorContent.tsx +15 -0
- package/components/Markdown/{Markdown/hooks/useTyping.ts → core/hooks/useTyping.tsx} +4 -1
- package/components/Markdown/core/index.tsx +18 -0
- package/components/Markdown/{plugins → core/plugins}/citations/CitationComponent.tsx +5 -3
- package/components/Markdown/{plugins → core/plugins}/citations/index.tsx +3 -4
- package/components/Markdown/{plugins → core/plugins}/cursor/Underline.tsx +1 -1
- package/components/Markdown/{plugins → core/plugins}/cursor/index.tsx +8 -8
- package/components/Markdown/demo/cursor.tsx +2 -3
- package/components/Markdown/index.en-US.md +1 -2
- package/components/Markdown/index.tsx +6 -0
- package/components/Markdown/index.zh-CN.md +1 -2
- package/components/Markdown/{Markdown/style.ts → styles.ts} +12 -21
- package/components/Markdown/types.tsx +94 -0
- package/components/index.ts +1 -3
- package/lib/AgentScopeRuntimeWebUI/core/AgentScopeRuntime/Response/Builder.js +5 -3
- package/lib/ImageGenerator/index.js +1 -1
- package/lib/Markdown/Markdown.d.ts +4 -0
- package/lib/Markdown/Markdown.js +110 -0
- package/lib/Markdown/core/components/Null.d.ts +2 -0
- package/lib/Markdown/core/components/Null.js +3 -0
- package/lib/Markdown/core/components/Raw.d.ts +8 -0
- package/lib/Markdown/core/components/Raw.js +13 -0
- package/lib/Markdown/core/hooks/useCitationsData.d.ts +6 -0
- package/lib/Markdown/{Markdown → core}/hooks/useCitationsData.js +1 -1
- package/lib/Markdown/core/hooks/useCursorContent.d.ts +4 -0
- package/lib/Markdown/core/hooks/useCursorContent.js +14 -0
- package/lib/Markdown/core/hooks/useTyping.d.ts +5 -0
- package/lib/Markdown/{Markdown → core}/hooks/useTyping.js +3 -2
- package/lib/Markdown/core/index.d.ts +2 -0
- package/lib/Markdown/{Markdown/hooks/useAnimation.js → core/index.js} +23 -23
- package/lib/Markdown/{plugins → core/plugins}/citations/CitationComponent.js +5 -5
- package/lib/Markdown/{plugins → core/plugins}/citations/index.d.ts +1 -2
- package/lib/Markdown/{plugins → core/plugins}/citations/index.js +1 -1
- package/lib/Markdown/{plugins → core/plugins}/cursor/Dot.js +1 -1
- package/lib/Markdown/{plugins → core/plugins}/cursor/Underline.js +1 -1
- package/lib/Markdown/{plugins → core/plugins}/cursor/index.js +4 -4
- package/lib/Markdown/index.d.ts +2 -1
- package/lib/Markdown/styles.js +32 -0
- package/lib/Markdown/types.d.ts +78 -0
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/package.json +7 -31
- package/components/AGUI/components/HelpModal/icons.tsx +0 -68
- package/components/AGUI/components/HelpModal/index.tsx +0 -1
- package/components/AGUI/components/HelpModal/modal.tsx +0 -101
- package/components/AGUI/components/chat/Button.tsx +0 -18
- package/components/AGUI/components/chat/Chat.tsx +0 -780
- package/components/AGUI/components/chat/ChatContext.tsx +0 -248
- package/components/AGUI/components/chat/CodeBlock.tsx +0 -406
- package/components/AGUI/components/chat/Header.tsx +0 -22
- package/components/AGUI/components/chat/Icons.tsx +0 -237
- package/components/AGUI/components/chat/ImageUploadQueue.tsx +0 -77
- package/components/AGUI/components/chat/Input.tsx +0 -24
- package/components/AGUI/components/chat/Markdown.tsx +0 -134
- package/components/AGUI/components/chat/Messages.tsx +0 -259
- package/components/AGUI/components/chat/Modal.tsx +0 -133
- package/components/AGUI/components/chat/Popup.tsx +0 -57
- package/components/AGUI/components/chat/PoweredByTag.tsx +0 -29
- package/components/AGUI/components/chat/Sidebar.tsx +0 -74
- package/components/AGUI/components/chat/Suggestion.tsx +0 -132
- package/components/AGUI/components/chat/Suggestions.tsx +0 -20
- package/components/AGUI/components/chat/Textarea.tsx +0 -61
- package/components/AGUI/components/chat/Window.tsx +0 -152
- package/components/AGUI/components/chat/index.tsx +0 -11
- package/components/AGUI/components/chat/messages/AssistantMessage.tsx +0 -69
- package/components/AGUI/components/chat/messages/RenderActionExecutionMessage.tsx +0 -129
- package/components/AGUI/components/chat/messages/RenderAgentStateMessage.tsx +0 -116
- package/components/AGUI/components/chat/messages/RenderImageMessage.tsx +0 -64
- package/components/AGUI/components/chat/messages/RenderResultMessage.tsx +0 -26
- package/components/AGUI/components/chat/messages/RenderTextMessage.tsx +0 -51
- package/components/AGUI/components/chat/messages/UserMessage.tsx +0 -10
- package/components/AGUI/components/chat/props.ts +0 -186
- package/components/AGUI/components/index.ts +0 -1
- package/components/AGUI/context/index.ts +0 -1
- package/components/AGUI/hooks/index.ts +0 -1
- package/components/AGUI/hooks/use-copilot-chat-suggestions.tsx +0 -122
- package/components/AGUI/hooks/use-copy-to-clipboard.tsx +0 -29
- package/components/AGUI/hooks/use-dark-mode.ts +0 -10
- package/components/AGUI/hooks/use-push-to-talk.tsx +0 -166
- package/components/AGUI/index.tsx +0 -4
- package/components/AGUI/lib/utils.test.ts +0 -7
- package/components/AGUI/lib/utils.ts +0 -27
- package/components/AGUI/styles.css +0 -0
- package/components/AGUI/types/css.ts +0 -0
- package/components/AGUI/types/index.ts +0 -1
- package/components/AGUI/types/suggestions.ts +0 -6
- package/components/Markdown/Markdown/AnimationNode.tsx +0 -89
- package/components/Markdown/Markdown/Markdown.tsx +0 -61
- package/components/Markdown/Markdown/core/Parser.ts +0 -52
- package/components/Markdown/Markdown/core/Renderer.ts +0 -121
- package/components/Markdown/Markdown/core/index.ts +0 -4
- package/components/Markdown/Markdown/hooks/index.ts +0 -4
- package/components/Markdown/Markdown/hooks/useAnimation.tsx +0 -27
- package/components/Markdown/Markdown/hooks/useStreaming.ts +0 -503
- package/components/Markdown/Markdown/index.tsx +0 -198
- package/components/Markdown/Markdown/interface.ts +0 -217
- package/components/Markdown/demo/typing.tsx +0 -82
- package/components/Markdown/index.ts +0 -1
- package/components/Markdown/plugins/latex/index.ts +0 -109
- package/components/Markdown/plugins/type.ts +0 -71
- package/lib/AGUI/components/HelpModal/icons.d.ts +0 -5
- package/lib/AGUI/components/HelpModal/icons.js +0 -84
- package/lib/AGUI/components/HelpModal/index.d.ts +0 -1
- package/lib/AGUI/components/HelpModal/index.js +0 -1
- package/lib/AGUI/components/HelpModal/modal.d.ts +0 -1
- package/lib/AGUI/components/HelpModal/modal.js +0 -104
- package/lib/AGUI/components/chat/Button.d.ts +0 -2
- package/lib/AGUI/components/chat/Button.js +0 -27
- package/lib/AGUI/components/chat/Chat.d.ts +0 -242
- package/lib/AGUI/components/chat/Chat.js +0 -634
- package/lib/AGUI/components/chat/ChatContext.d.ts +0 -142
- package/lib/AGUI/components/chat/ChatContext.js +0 -75
- package/lib/AGUI/components/chat/CodeBlock.d.ts +0 -12
- package/lib/AGUI/components/chat/CodeBlock.js +0 -398
- package/lib/AGUI/components/chat/Header.d.ts +0 -2
- package/lib/AGUI/components/chat/Header.js +0 -28
- package/lib/AGUI/components/chat/Icons.d.ts +0 -16
- package/lib/AGUI/components/chat/Icons.js +0 -247
- package/lib/AGUI/components/chat/ImageUploadQueue.d.ts +0 -11
- package/lib/AGUI/components/chat/ImageUploadQueue.js +0 -65
- package/lib/AGUI/components/chat/Input.d.ts +0 -2
- package/lib/AGUI/components/chat/Input.js +0 -30
- package/lib/AGUI/components/chat/Markdown.d.ts +0 -7
- package/lib/AGUI/components/chat/Markdown.js +0 -187
- package/lib/AGUI/components/chat/Messages.d.ts +0 -7
- package/lib/AGUI/components/chat/Messages.js +0 -242
- package/lib/AGUI/components/chat/Modal.d.ts +0 -43
- package/lib/AGUI/components/chat/Modal.js +0 -113
- package/lib/AGUI/components/chat/Popup.d.ts +0 -49
- package/lib/AGUI/components/chat/Popup.js +0 -64
- package/lib/AGUI/components/chat/PoweredByTag.d.ts +0 -3
- package/lib/AGUI/components/chat/PoweredByTag.js +0 -27
- package/lib/AGUI/components/chat/Sidebar.d.ts +0 -2
- package/lib/AGUI/components/chat/Sidebar.js +0 -85
- package/lib/AGUI/components/chat/Suggestion.d.ts +0 -16
- package/lib/AGUI/components/chat/Suggestion.js +0 -146
- package/lib/AGUI/components/chat/Suggestions.d.ts +0 -2
- package/lib/AGUI/components/chat/Suggestions.js +0 -21
- package/lib/AGUI/components/chat/Textarea.d.ts +0 -11
- package/lib/AGUI/components/chat/Textarea.js +0 -60
- package/lib/AGUI/components/chat/Window.d.ts +0 -2
- package/lib/AGUI/components/chat/Window.js +0 -115
- package/lib/AGUI/components/chat/index.d.ts +0 -11
- package/lib/AGUI/components/chat/index.js +0 -11
- package/lib/AGUI/components/chat/messages/AssistantMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/AssistantMessage.js +0 -56
- package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.js +0 -114
- package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.js +0 -97
- package/lib/AGUI/components/chat/messages/RenderImageMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/RenderImageMessage.js +0 -61
- package/lib/AGUI/components/chat/messages/RenderResultMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/RenderResultMessage.js +0 -27
- package/lib/AGUI/components/chat/messages/RenderTextMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/RenderTextMessage.js +0 -47
- package/lib/AGUI/components/chat/messages/UserMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/UserMessage.js +0 -9
- package/lib/AGUI/components/chat/props.d.ts +0 -157
- package/lib/AGUI/components/index.d.ts +0 -1
- package/lib/AGUI/components/index.js +0 -1
- package/lib/AGUI/context/index.d.ts +0 -1
- package/lib/AGUI/context/index.js +0 -1
- package/lib/AGUI/hooks/index.d.ts +0 -1
- package/lib/AGUI/hooks/index.js +0 -1
- package/lib/AGUI/hooks/use-copilot-chat-suggestions.d.ts +0 -87
- package/lib/AGUI/hooks/use-copilot-chat-suggestions.js +0 -95
- package/lib/AGUI/hooks/use-copy-to-clipboard.d.ts +0 -7
- package/lib/AGUI/hooks/use-copy-to-clipboard.js +0 -34
- package/lib/AGUI/hooks/use-dark-mode.d.ts +0 -1
- package/lib/AGUI/hooks/use-dark-mode.js +0 -4
- package/lib/AGUI/hooks/use-push-to-talk.d.ts +0 -16
- package/lib/AGUI/hooks/use-push-to-talk.js +0 -260
- package/lib/AGUI/index.d.ts +0 -4
- package/lib/AGUI/index.js +0 -4
- package/lib/AGUI/lib/utils.d.ts +0 -2
- package/lib/AGUI/lib/utils.js +0 -52
- package/lib/AGUI/styles.css +0 -0
- package/lib/AGUI/types/css.d.ts +0 -0
- package/lib/AGUI/types/css.js +0 -0
- package/lib/AGUI/types/index.d.ts +0 -1
- package/lib/AGUI/types/index.js +0 -1
- package/lib/AGUI/types/suggestions.d.ts +0 -6
- package/lib/AGUI/types/suggestions.js +0 -1
- package/lib/Markdown/Markdown/AnimationNode.d.ts +0 -20
- package/lib/Markdown/Markdown/AnimationNode.js +0 -84
- package/lib/Markdown/Markdown/Markdown.d.ts +0 -4
- package/lib/Markdown/Markdown/Markdown.js +0 -58
- package/lib/Markdown/Markdown/core/Parser.d.ts +0 -16
- package/lib/Markdown/Markdown/core/Parser.js +0 -65
- package/lib/Markdown/Markdown/core/Renderer.d.ts +0 -24
- package/lib/Markdown/Markdown/core/Renderer.js +0 -137
- package/lib/Markdown/Markdown/core/index.d.ts +0 -3
- package/lib/Markdown/Markdown/core/index.js +0 -3
- package/lib/Markdown/Markdown/hooks/index.d.ts +0 -3
- package/lib/Markdown/Markdown/hooks/index.js +0 -3
- package/lib/Markdown/Markdown/hooks/useAnimation.d.ts +0 -4
- package/lib/Markdown/Markdown/hooks/useCitationsData.d.ts +0 -7
- package/lib/Markdown/Markdown/hooks/useStreaming.d.ts +0 -3
- package/lib/Markdown/Markdown/hooks/useStreaming.js +0 -521
- package/lib/Markdown/Markdown/hooks/useTyping.d.ts +0 -4
- package/lib/Markdown/Markdown/index.d.ts +0 -84
- package/lib/Markdown/Markdown/index.js +0 -161
- package/lib/Markdown/Markdown/interface.d.ts +0 -203
- package/lib/Markdown/Markdown/interface.js +0 -1
- package/lib/Markdown/Markdown/style.js +0 -32
- package/lib/Markdown/plugins/latex/index.d.ts +0 -9
- package/lib/Markdown/plugins/latex/index.js +0 -97
- package/lib/Markdown/plugins/type.d.ts +0 -60
- package/lib/Markdown/plugins/type.js +0 -1
- /package/components/Markdown/{Markdown/defaultComponents/DisabledImage.tsx → core/components/DisableImage.tsx} +0 -0
- /package/components/Markdown/{Markdown/defaultComponents → core/components}/Media.tsx +0 -0
- /package/components/Markdown/{plugins → core/plugins}/cursor/Dot.tsx +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.d.ts +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.js +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents/DisabledImage.d.ts → core/components/DisableImage.d.ts} +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents/DisabledImage.js → core/components/DisableImage.js} +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents → core/components}/Media.d.ts +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents → core/components}/Media.js +0 -0
- /package/lib/Markdown/{plugins → core/plugins}/citations/CitationComponent.d.ts +0 -0
- /package/lib/Markdown/{plugins → core/plugins}/cursor/Dot.d.ts +0 -0
- /package/lib/Markdown/{plugins → core/plugins}/cursor/Underline.d.ts +0 -0
- /package/lib/Markdown/{plugins → core/plugins}/cursor/index.d.ts +0 -0
- /package/lib/Markdown/{Markdown/style.d.ts → styles.d.ts} +0 -0
- /package/lib/{AGUI/components/chat/props.js → Markdown/types.js} +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
2
|
-
import { useChatContext } from "./ChatContext";
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
export var Button = function Button(_ref) {
|
|
6
|
-
_objectDestructuringEmpty(_ref);
|
|
7
|
-
var _useChatContext = useChatContext(),
|
|
8
|
-
open = _useChatContext.open,
|
|
9
|
-
setOpen = _useChatContext.setOpen,
|
|
10
|
-
icons = _useChatContext.icons;
|
|
11
|
-
return /*#__PURE__*/_jsx("div", {
|
|
12
|
-
onClick: function onClick() {
|
|
13
|
-
return setOpen(!open);
|
|
14
|
-
},
|
|
15
|
-
children: /*#__PURE__*/_jsxs("button", {
|
|
16
|
-
className: "copilotKitButton ".concat(open ? "open" : ""),
|
|
17
|
-
"aria-label": open ? "Close Chat" : "Open Chat",
|
|
18
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
19
|
-
className: "copilotKitButtonIcon copilotKitButtonIconOpen",
|
|
20
|
-
children: icons.openIcon
|
|
21
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
22
|
-
className: "copilotKitButtonIcon copilotKitButtonIconClose",
|
|
23
|
-
children: icons.closeIcon
|
|
24
|
-
})]
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
};
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* <br/>
|
|
3
|
-
* <img src="/images/CopilotChat.gif" width="500" />
|
|
4
|
-
*
|
|
5
|
-
* A chatbot panel component for the CopilotKit framework. The component allows for a high degree
|
|
6
|
-
* of customization through various props and custom CSS.
|
|
7
|
-
*
|
|
8
|
-
* ## Install Dependencies
|
|
9
|
-
*
|
|
10
|
-
* This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.
|
|
11
|
-
*
|
|
12
|
-
* ```shell npm2yarn \"@copilotkit/react-ui"\
|
|
13
|
-
* npm install @copilotkit/react-core @copilotkit/react-ui
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* ## Usage
|
|
17
|
-
*
|
|
18
|
-
* ```tsx
|
|
19
|
-
* import { CopilotChat } from "@copilotkit/react-ui";
|
|
20
|
-
* import "@copilotkit/react-ui/styles.css";
|
|
21
|
-
*
|
|
22
|
-
* <CopilotChat
|
|
23
|
-
* labels={{
|
|
24
|
-
* title: "Your Assistant",
|
|
25
|
-
* initial: "Hi! 👋 How can I assist you today?",
|
|
26
|
-
* }}
|
|
27
|
-
* />
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* ### Look & Feel
|
|
31
|
-
*
|
|
32
|
-
* By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:
|
|
33
|
-
* ```tsx title="YourRootComponent.tsx"
|
|
34
|
-
* ...
|
|
35
|
-
* import "@copilotkit/react-ui/styles.css"; // [!code highlight]
|
|
36
|
-
*
|
|
37
|
-
* export function YourRootComponent() {
|
|
38
|
-
* return (
|
|
39
|
-
* <CopilotKit>
|
|
40
|
-
* ...
|
|
41
|
-
* </CopilotKit>
|
|
42
|
-
* );
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
* For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.
|
|
46
|
-
*/
|
|
47
|
-
import { CopilotChatIcons, CopilotChatLabels } from "./ChatContext";
|
|
48
|
-
import React from "react";
|
|
49
|
-
import { SystemMessageFunction } from "@copilotkit/react-core";
|
|
50
|
-
import { CopilotChatSuggestion } from "../../types/suggestions";
|
|
51
|
-
import { Message, TextMessage } from "@copilotkit/runtime-client-gql";
|
|
52
|
-
import { AssistantMessageProps, ComponentsMap, InputProps, MessagesProps, RenderMessageProps, RenderSuggestionsListProps, UserMessageProps } from "./props";
|
|
53
|
-
import { HintFunction } from "@copilotkit/react-core";
|
|
54
|
-
/**
|
|
55
|
-
* Props for CopilotChat component.
|
|
56
|
-
*/
|
|
57
|
-
export interface CopilotChatProps {
|
|
58
|
-
/**
|
|
59
|
-
* Custom instructions to be added to the system message. Use this property to
|
|
60
|
-
* provide additional context or guidance to the language model, influencing
|
|
61
|
-
* its responses. These instructions can include specific directions,
|
|
62
|
-
* preferences, or criteria that the model should consider when generating
|
|
63
|
-
* its output, thereby tailoring the conversation more precisely to the
|
|
64
|
-
* user's needs or the application's requirements.
|
|
65
|
-
*/
|
|
66
|
-
instructions?: string;
|
|
67
|
-
/**
|
|
68
|
-
* A callback that gets called when the in progress state changes.
|
|
69
|
-
*/
|
|
70
|
-
onInProgress?: (inProgress: boolean) => void;
|
|
71
|
-
/**
|
|
72
|
-
* A callback that gets called when a new message it submitted.
|
|
73
|
-
*/
|
|
74
|
-
onSubmitMessage?: (message: string) => void | Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* A custom stop generation function.
|
|
77
|
-
*/
|
|
78
|
-
onStopGeneration?: OnStopGeneration;
|
|
79
|
-
/**
|
|
80
|
-
* A custom reload messages function.
|
|
81
|
-
*/
|
|
82
|
-
onReloadMessages?: OnReloadMessages;
|
|
83
|
-
/**
|
|
84
|
-
* A callback function to regenerate the assistant's response
|
|
85
|
-
*/
|
|
86
|
-
onRegenerate?: (messageId: string) => void;
|
|
87
|
-
/**
|
|
88
|
-
* A callback function when the message is copied
|
|
89
|
-
*/
|
|
90
|
-
onCopy?: (message: string) => void;
|
|
91
|
-
/**
|
|
92
|
-
* A callback function for thumbs up feedback
|
|
93
|
-
*/
|
|
94
|
-
onThumbsUp?: (message: TextMessage) => void;
|
|
95
|
-
/**
|
|
96
|
-
* A callback function for thumbs down feedback
|
|
97
|
-
*/
|
|
98
|
-
onThumbsDown?: (message: TextMessage) => void;
|
|
99
|
-
/**
|
|
100
|
-
* A list of markdown components to render in assistant message.
|
|
101
|
-
* Useful when you want to render custom elements in the message (e.g a reference tag element)
|
|
102
|
-
*/
|
|
103
|
-
markdownTagRenderers?: ComponentsMap;
|
|
104
|
-
/**
|
|
105
|
-
* Icons can be used to set custom icons for the chat window.
|
|
106
|
-
*/
|
|
107
|
-
icons?: CopilotChatIcons;
|
|
108
|
-
/**
|
|
109
|
-
* Labels can be used to set custom labels for the chat window.
|
|
110
|
-
*/
|
|
111
|
-
labels?: CopilotChatLabels;
|
|
112
|
-
/**
|
|
113
|
-
* Enable image upload button (image inputs only supported on some models)
|
|
114
|
-
*/
|
|
115
|
-
imageUploadsEnabled?: boolean;
|
|
116
|
-
/**
|
|
117
|
-
* The 'accept' attribute for the file input used for image uploads.
|
|
118
|
-
* Defaults to "image/*".
|
|
119
|
-
*/
|
|
120
|
-
inputFileAccept?: string;
|
|
121
|
-
/**
|
|
122
|
-
* A function that takes in context string and instructions and returns
|
|
123
|
-
* the system message to include in the chat request.
|
|
124
|
-
* Use this to completely override the system message, when providing
|
|
125
|
-
* instructions is not enough.
|
|
126
|
-
*/
|
|
127
|
-
makeSystemMessage?: SystemMessageFunction;
|
|
128
|
-
/**
|
|
129
|
-
* A custom assistant message component to use instead of the default.
|
|
130
|
-
*/
|
|
131
|
-
AssistantMessage?: React.ComponentType<AssistantMessageProps>;
|
|
132
|
-
/**
|
|
133
|
-
* A custom user message component to use instead of the default.
|
|
134
|
-
*/
|
|
135
|
-
UserMessage?: React.ComponentType<UserMessageProps>;
|
|
136
|
-
/**
|
|
137
|
-
* A custom Messages component to use instead of the default.
|
|
138
|
-
*/
|
|
139
|
-
Messages?: React.ComponentType<MessagesProps>;
|
|
140
|
-
/**
|
|
141
|
-
* A custom RenderTextMessage component to use instead of the default.
|
|
142
|
-
*/
|
|
143
|
-
RenderTextMessage?: React.ComponentType<RenderMessageProps>;
|
|
144
|
-
/**
|
|
145
|
-
* A custom RenderActionExecutionMessage component to use instead of the default.
|
|
146
|
-
*/
|
|
147
|
-
RenderActionExecutionMessage?: React.ComponentType<RenderMessageProps>;
|
|
148
|
-
/**
|
|
149
|
-
* A custom RenderAgentStateMessage component to use instead of the default.
|
|
150
|
-
*/
|
|
151
|
-
RenderAgentStateMessage?: React.ComponentType<RenderMessageProps>;
|
|
152
|
-
/**
|
|
153
|
-
* A custom RenderResultMessage component to use instead of the default.
|
|
154
|
-
*/
|
|
155
|
-
RenderResultMessage?: React.ComponentType<RenderMessageProps>;
|
|
156
|
-
/**
|
|
157
|
-
* A custom RenderImageMessage component to use instead of the default.
|
|
158
|
-
*/
|
|
159
|
-
RenderImageMessage?: React.ComponentType<RenderMessageProps>;
|
|
160
|
-
/**
|
|
161
|
-
* A custom suggestions list component to use instead of the default.
|
|
162
|
-
*/
|
|
163
|
-
RenderSuggestionsList?: React.ComponentType<RenderSuggestionsListProps>;
|
|
164
|
-
/**
|
|
165
|
-
* A custom Input component to use instead of the default.
|
|
166
|
-
*/
|
|
167
|
-
Input?: React.ComponentType<InputProps>;
|
|
168
|
-
/**
|
|
169
|
-
* A class name to apply to the root element.
|
|
170
|
-
*/
|
|
171
|
-
className?: string;
|
|
172
|
-
/**
|
|
173
|
-
* Children to render.
|
|
174
|
-
*/
|
|
175
|
-
children?: React.ReactNode;
|
|
176
|
-
hideStopButton?: boolean;
|
|
177
|
-
}
|
|
178
|
-
interface OnStopGenerationArguments {
|
|
179
|
-
/**
|
|
180
|
-
* The name of the currently executing agent.
|
|
181
|
-
*/
|
|
182
|
-
currentAgentName: string | undefined;
|
|
183
|
-
/**
|
|
184
|
-
* The messages in the chat.
|
|
185
|
-
*/
|
|
186
|
-
messages: Message[];
|
|
187
|
-
/**
|
|
188
|
-
* Set the messages in the chat.
|
|
189
|
-
*/
|
|
190
|
-
setMessages: (messages: Message[]) => void;
|
|
191
|
-
/**
|
|
192
|
-
* Stop chat generation.
|
|
193
|
-
*/
|
|
194
|
-
stopGeneration: () => void;
|
|
195
|
-
/**
|
|
196
|
-
* Restart the currently executing agent.
|
|
197
|
-
*/
|
|
198
|
-
restartCurrentAgent: () => void;
|
|
199
|
-
/**
|
|
200
|
-
* Stop the currently executing agent.
|
|
201
|
-
*/
|
|
202
|
-
stopCurrentAgent: () => void;
|
|
203
|
-
/**
|
|
204
|
-
* Run the currently executing agent.
|
|
205
|
-
*/
|
|
206
|
-
runCurrentAgent: (hint?: HintFunction) => Promise<void>;
|
|
207
|
-
/**
|
|
208
|
-
* Set the state of the currently executing agent.
|
|
209
|
-
*/
|
|
210
|
-
setCurrentAgentState: (state: any) => void;
|
|
211
|
-
}
|
|
212
|
-
export type OnReloadMessagesArguments = OnStopGenerationArguments & {
|
|
213
|
-
/**
|
|
214
|
-
* The message on which "regenerate" was pressed
|
|
215
|
-
*/
|
|
216
|
-
messageId: string;
|
|
217
|
-
};
|
|
218
|
-
export type OnStopGeneration = (args: OnStopGenerationArguments) => void;
|
|
219
|
-
export type OnReloadMessages = (args: OnReloadMessagesArguments) => void;
|
|
220
|
-
export type ImageUpload = {
|
|
221
|
-
contentType: string;
|
|
222
|
-
bytes: string;
|
|
223
|
-
};
|
|
224
|
-
export declare function CopilotChat({ instructions, onSubmitMessage, makeSystemMessage, onInProgress, onStopGeneration, onReloadMessages, onRegenerate, onCopy, onThumbsUp, onThumbsDown, markdownTagRenderers, Messages, RenderTextMessage, RenderActionExecutionMessage, RenderAgentStateMessage, RenderResultMessage, RenderImageMessage, RenderSuggestionsList, Input, className, icons, labels, AssistantMessage, UserMessage, imageUploadsEnabled, inputFileAccept, hideStopButton, }: CopilotChatProps): import("react/jsx-runtime").JSX.Element;
|
|
225
|
-
export declare function WrappedCopilotChat({ children, icons, labels, className, }: {
|
|
226
|
-
children: React.ReactNode;
|
|
227
|
-
icons?: CopilotChatIcons;
|
|
228
|
-
labels?: CopilotChatLabels;
|
|
229
|
-
className?: string;
|
|
230
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
231
|
-
export declare const useCopilotChatLogic: (makeSystemMessage?: SystemMessageFunction, onInProgress?: (isLoading: boolean) => void, onSubmitMessage?: (messageContent: string) => Promise<void> | void, onStopGeneration?: OnStopGeneration, onReloadMessages?: OnReloadMessages) => {
|
|
232
|
-
visibleMessages: Message[];
|
|
233
|
-
isLoading: boolean;
|
|
234
|
-
currentSuggestions: CopilotChatSuggestion[];
|
|
235
|
-
sendMessage: (messageContent: string, imagesToUse?: Array<{
|
|
236
|
-
contentType: string;
|
|
237
|
-
bytes: string;
|
|
238
|
-
}>) => Promise<Message>;
|
|
239
|
-
stopGeneration: () => void;
|
|
240
|
-
reloadMessages: (messageId: string) => void;
|
|
241
|
-
};
|
|
242
|
-
export {};
|