@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.
Files changed (233) hide show
  1. package/bin/starter_webui.zip +0 -0
  2. package/components/AgentScopeRuntimeWebUI/core/AgentScopeRuntime/Response/Builder.tsx +8 -4
  3. package/components/ImageGenerator/index.tsx +1 -1
  4. package/components/Markdown/Markdown.tsx +105 -0
  5. package/components/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.tsx +1 -1
  6. package/components/Markdown/core/components/Null.tsx +1 -0
  7. package/components/Markdown/core/components/Raw.tsx +18 -0
  8. package/components/Markdown/{Markdown → core}/hooks/useCitationsData.tsx +3 -7
  9. package/components/Markdown/core/hooks/useCursorContent.tsx +15 -0
  10. package/components/Markdown/{Markdown/hooks/useTyping.ts → core/hooks/useTyping.tsx} +4 -1
  11. package/components/Markdown/core/index.tsx +18 -0
  12. package/components/Markdown/{plugins → core/plugins}/citations/CitationComponent.tsx +5 -3
  13. package/components/Markdown/{plugins → core/plugins}/citations/index.tsx +3 -4
  14. package/components/Markdown/{plugins → core/plugins}/cursor/Underline.tsx +1 -1
  15. package/components/Markdown/{plugins → core/plugins}/cursor/index.tsx +8 -8
  16. package/components/Markdown/demo/cursor.tsx +2 -3
  17. package/components/Markdown/index.en-US.md +1 -2
  18. package/components/Markdown/index.tsx +6 -0
  19. package/components/Markdown/index.zh-CN.md +1 -2
  20. package/components/Markdown/{Markdown/style.ts → styles.ts} +12 -21
  21. package/components/Markdown/types.tsx +94 -0
  22. package/components/index.ts +1 -3
  23. package/lib/AgentScopeRuntimeWebUI/core/AgentScopeRuntime/Response/Builder.js +5 -3
  24. package/lib/ImageGenerator/index.js +1 -1
  25. package/lib/Markdown/Markdown.d.ts +4 -0
  26. package/lib/Markdown/Markdown.js +110 -0
  27. package/lib/Markdown/core/components/Null.d.ts +2 -0
  28. package/lib/Markdown/core/components/Null.js +3 -0
  29. package/lib/Markdown/core/components/Raw.d.ts +8 -0
  30. package/lib/Markdown/core/components/Raw.js +13 -0
  31. package/lib/Markdown/core/hooks/useCitationsData.d.ts +6 -0
  32. package/lib/Markdown/{Markdown → core}/hooks/useCitationsData.js +1 -1
  33. package/lib/Markdown/core/hooks/useCursorContent.d.ts +4 -0
  34. package/lib/Markdown/core/hooks/useCursorContent.js +14 -0
  35. package/lib/Markdown/core/hooks/useTyping.d.ts +5 -0
  36. package/lib/Markdown/{Markdown → core}/hooks/useTyping.js +3 -2
  37. package/lib/Markdown/core/index.d.ts +2 -0
  38. package/lib/Markdown/{Markdown/hooks/useAnimation.js → core/index.js} +23 -23
  39. package/lib/Markdown/{plugins → core/plugins}/citations/CitationComponent.js +5 -5
  40. package/lib/Markdown/{plugins → core/plugins}/citations/index.d.ts +1 -2
  41. package/lib/Markdown/{plugins → core/plugins}/citations/index.js +1 -1
  42. package/lib/Markdown/{plugins → core/plugins}/cursor/Dot.js +1 -1
  43. package/lib/Markdown/{plugins → core/plugins}/cursor/Underline.js +1 -1
  44. package/lib/Markdown/{plugins → core/plugins}/cursor/index.js +4 -4
  45. package/lib/Markdown/index.d.ts +2 -1
  46. package/lib/Markdown/styles.js +32 -0
  47. package/lib/Markdown/types.d.ts +78 -0
  48. package/lib/index.d.ts +0 -2
  49. package/lib/index.js +0 -2
  50. package/package.json +7 -31
  51. package/components/AGUI/components/HelpModal/icons.tsx +0 -68
  52. package/components/AGUI/components/HelpModal/index.tsx +0 -1
  53. package/components/AGUI/components/HelpModal/modal.tsx +0 -101
  54. package/components/AGUI/components/chat/Button.tsx +0 -18
  55. package/components/AGUI/components/chat/Chat.tsx +0 -780
  56. package/components/AGUI/components/chat/ChatContext.tsx +0 -248
  57. package/components/AGUI/components/chat/CodeBlock.tsx +0 -406
  58. package/components/AGUI/components/chat/Header.tsx +0 -22
  59. package/components/AGUI/components/chat/Icons.tsx +0 -237
  60. package/components/AGUI/components/chat/ImageUploadQueue.tsx +0 -77
  61. package/components/AGUI/components/chat/Input.tsx +0 -24
  62. package/components/AGUI/components/chat/Markdown.tsx +0 -134
  63. package/components/AGUI/components/chat/Messages.tsx +0 -259
  64. package/components/AGUI/components/chat/Modal.tsx +0 -133
  65. package/components/AGUI/components/chat/Popup.tsx +0 -57
  66. package/components/AGUI/components/chat/PoweredByTag.tsx +0 -29
  67. package/components/AGUI/components/chat/Sidebar.tsx +0 -74
  68. package/components/AGUI/components/chat/Suggestion.tsx +0 -132
  69. package/components/AGUI/components/chat/Suggestions.tsx +0 -20
  70. package/components/AGUI/components/chat/Textarea.tsx +0 -61
  71. package/components/AGUI/components/chat/Window.tsx +0 -152
  72. package/components/AGUI/components/chat/index.tsx +0 -11
  73. package/components/AGUI/components/chat/messages/AssistantMessage.tsx +0 -69
  74. package/components/AGUI/components/chat/messages/RenderActionExecutionMessage.tsx +0 -129
  75. package/components/AGUI/components/chat/messages/RenderAgentStateMessage.tsx +0 -116
  76. package/components/AGUI/components/chat/messages/RenderImageMessage.tsx +0 -64
  77. package/components/AGUI/components/chat/messages/RenderResultMessage.tsx +0 -26
  78. package/components/AGUI/components/chat/messages/RenderTextMessage.tsx +0 -51
  79. package/components/AGUI/components/chat/messages/UserMessage.tsx +0 -10
  80. package/components/AGUI/components/chat/props.ts +0 -186
  81. package/components/AGUI/components/index.ts +0 -1
  82. package/components/AGUI/context/index.ts +0 -1
  83. package/components/AGUI/hooks/index.ts +0 -1
  84. package/components/AGUI/hooks/use-copilot-chat-suggestions.tsx +0 -122
  85. package/components/AGUI/hooks/use-copy-to-clipboard.tsx +0 -29
  86. package/components/AGUI/hooks/use-dark-mode.ts +0 -10
  87. package/components/AGUI/hooks/use-push-to-talk.tsx +0 -166
  88. package/components/AGUI/index.tsx +0 -4
  89. package/components/AGUI/lib/utils.test.ts +0 -7
  90. package/components/AGUI/lib/utils.ts +0 -27
  91. package/components/AGUI/styles.css +0 -0
  92. package/components/AGUI/types/css.ts +0 -0
  93. package/components/AGUI/types/index.ts +0 -1
  94. package/components/AGUI/types/suggestions.ts +0 -6
  95. package/components/Markdown/Markdown/AnimationNode.tsx +0 -89
  96. package/components/Markdown/Markdown/Markdown.tsx +0 -61
  97. package/components/Markdown/Markdown/core/Parser.ts +0 -52
  98. package/components/Markdown/Markdown/core/Renderer.ts +0 -121
  99. package/components/Markdown/Markdown/core/index.ts +0 -4
  100. package/components/Markdown/Markdown/hooks/index.ts +0 -4
  101. package/components/Markdown/Markdown/hooks/useAnimation.tsx +0 -27
  102. package/components/Markdown/Markdown/hooks/useStreaming.ts +0 -503
  103. package/components/Markdown/Markdown/index.tsx +0 -198
  104. package/components/Markdown/Markdown/interface.ts +0 -217
  105. package/components/Markdown/demo/typing.tsx +0 -82
  106. package/components/Markdown/index.ts +0 -1
  107. package/components/Markdown/plugins/latex/index.ts +0 -109
  108. package/components/Markdown/plugins/type.ts +0 -71
  109. package/lib/AGUI/components/HelpModal/icons.d.ts +0 -5
  110. package/lib/AGUI/components/HelpModal/icons.js +0 -84
  111. package/lib/AGUI/components/HelpModal/index.d.ts +0 -1
  112. package/lib/AGUI/components/HelpModal/index.js +0 -1
  113. package/lib/AGUI/components/HelpModal/modal.d.ts +0 -1
  114. package/lib/AGUI/components/HelpModal/modal.js +0 -104
  115. package/lib/AGUI/components/chat/Button.d.ts +0 -2
  116. package/lib/AGUI/components/chat/Button.js +0 -27
  117. package/lib/AGUI/components/chat/Chat.d.ts +0 -242
  118. package/lib/AGUI/components/chat/Chat.js +0 -634
  119. package/lib/AGUI/components/chat/ChatContext.d.ts +0 -142
  120. package/lib/AGUI/components/chat/ChatContext.js +0 -75
  121. package/lib/AGUI/components/chat/CodeBlock.d.ts +0 -12
  122. package/lib/AGUI/components/chat/CodeBlock.js +0 -398
  123. package/lib/AGUI/components/chat/Header.d.ts +0 -2
  124. package/lib/AGUI/components/chat/Header.js +0 -28
  125. package/lib/AGUI/components/chat/Icons.d.ts +0 -16
  126. package/lib/AGUI/components/chat/Icons.js +0 -247
  127. package/lib/AGUI/components/chat/ImageUploadQueue.d.ts +0 -11
  128. package/lib/AGUI/components/chat/ImageUploadQueue.js +0 -65
  129. package/lib/AGUI/components/chat/Input.d.ts +0 -2
  130. package/lib/AGUI/components/chat/Input.js +0 -30
  131. package/lib/AGUI/components/chat/Markdown.d.ts +0 -7
  132. package/lib/AGUI/components/chat/Markdown.js +0 -187
  133. package/lib/AGUI/components/chat/Messages.d.ts +0 -7
  134. package/lib/AGUI/components/chat/Messages.js +0 -242
  135. package/lib/AGUI/components/chat/Modal.d.ts +0 -43
  136. package/lib/AGUI/components/chat/Modal.js +0 -113
  137. package/lib/AGUI/components/chat/Popup.d.ts +0 -49
  138. package/lib/AGUI/components/chat/Popup.js +0 -64
  139. package/lib/AGUI/components/chat/PoweredByTag.d.ts +0 -3
  140. package/lib/AGUI/components/chat/PoweredByTag.js +0 -27
  141. package/lib/AGUI/components/chat/Sidebar.d.ts +0 -2
  142. package/lib/AGUI/components/chat/Sidebar.js +0 -85
  143. package/lib/AGUI/components/chat/Suggestion.d.ts +0 -16
  144. package/lib/AGUI/components/chat/Suggestion.js +0 -146
  145. package/lib/AGUI/components/chat/Suggestions.d.ts +0 -2
  146. package/lib/AGUI/components/chat/Suggestions.js +0 -21
  147. package/lib/AGUI/components/chat/Textarea.d.ts +0 -11
  148. package/lib/AGUI/components/chat/Textarea.js +0 -60
  149. package/lib/AGUI/components/chat/Window.d.ts +0 -2
  150. package/lib/AGUI/components/chat/Window.js +0 -115
  151. package/lib/AGUI/components/chat/index.d.ts +0 -11
  152. package/lib/AGUI/components/chat/index.js +0 -11
  153. package/lib/AGUI/components/chat/messages/AssistantMessage.d.ts +0 -2
  154. package/lib/AGUI/components/chat/messages/AssistantMessage.js +0 -56
  155. package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.d.ts +0 -2
  156. package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.js +0 -114
  157. package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.d.ts +0 -2
  158. package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.js +0 -97
  159. package/lib/AGUI/components/chat/messages/RenderImageMessage.d.ts +0 -2
  160. package/lib/AGUI/components/chat/messages/RenderImageMessage.js +0 -61
  161. package/lib/AGUI/components/chat/messages/RenderResultMessage.d.ts +0 -2
  162. package/lib/AGUI/components/chat/messages/RenderResultMessage.js +0 -27
  163. package/lib/AGUI/components/chat/messages/RenderTextMessage.d.ts +0 -2
  164. package/lib/AGUI/components/chat/messages/RenderTextMessage.js +0 -47
  165. package/lib/AGUI/components/chat/messages/UserMessage.d.ts +0 -2
  166. package/lib/AGUI/components/chat/messages/UserMessage.js +0 -9
  167. package/lib/AGUI/components/chat/props.d.ts +0 -157
  168. package/lib/AGUI/components/index.d.ts +0 -1
  169. package/lib/AGUI/components/index.js +0 -1
  170. package/lib/AGUI/context/index.d.ts +0 -1
  171. package/lib/AGUI/context/index.js +0 -1
  172. package/lib/AGUI/hooks/index.d.ts +0 -1
  173. package/lib/AGUI/hooks/index.js +0 -1
  174. package/lib/AGUI/hooks/use-copilot-chat-suggestions.d.ts +0 -87
  175. package/lib/AGUI/hooks/use-copilot-chat-suggestions.js +0 -95
  176. package/lib/AGUI/hooks/use-copy-to-clipboard.d.ts +0 -7
  177. package/lib/AGUI/hooks/use-copy-to-clipboard.js +0 -34
  178. package/lib/AGUI/hooks/use-dark-mode.d.ts +0 -1
  179. package/lib/AGUI/hooks/use-dark-mode.js +0 -4
  180. package/lib/AGUI/hooks/use-push-to-talk.d.ts +0 -16
  181. package/lib/AGUI/hooks/use-push-to-talk.js +0 -260
  182. package/lib/AGUI/index.d.ts +0 -4
  183. package/lib/AGUI/index.js +0 -4
  184. package/lib/AGUI/lib/utils.d.ts +0 -2
  185. package/lib/AGUI/lib/utils.js +0 -52
  186. package/lib/AGUI/styles.css +0 -0
  187. package/lib/AGUI/types/css.d.ts +0 -0
  188. package/lib/AGUI/types/css.js +0 -0
  189. package/lib/AGUI/types/index.d.ts +0 -1
  190. package/lib/AGUI/types/index.js +0 -1
  191. package/lib/AGUI/types/suggestions.d.ts +0 -6
  192. package/lib/AGUI/types/suggestions.js +0 -1
  193. package/lib/Markdown/Markdown/AnimationNode.d.ts +0 -20
  194. package/lib/Markdown/Markdown/AnimationNode.js +0 -84
  195. package/lib/Markdown/Markdown/Markdown.d.ts +0 -4
  196. package/lib/Markdown/Markdown/Markdown.js +0 -58
  197. package/lib/Markdown/Markdown/core/Parser.d.ts +0 -16
  198. package/lib/Markdown/Markdown/core/Parser.js +0 -65
  199. package/lib/Markdown/Markdown/core/Renderer.d.ts +0 -24
  200. package/lib/Markdown/Markdown/core/Renderer.js +0 -137
  201. package/lib/Markdown/Markdown/core/index.d.ts +0 -3
  202. package/lib/Markdown/Markdown/core/index.js +0 -3
  203. package/lib/Markdown/Markdown/hooks/index.d.ts +0 -3
  204. package/lib/Markdown/Markdown/hooks/index.js +0 -3
  205. package/lib/Markdown/Markdown/hooks/useAnimation.d.ts +0 -4
  206. package/lib/Markdown/Markdown/hooks/useCitationsData.d.ts +0 -7
  207. package/lib/Markdown/Markdown/hooks/useStreaming.d.ts +0 -3
  208. package/lib/Markdown/Markdown/hooks/useStreaming.js +0 -521
  209. package/lib/Markdown/Markdown/hooks/useTyping.d.ts +0 -4
  210. package/lib/Markdown/Markdown/index.d.ts +0 -84
  211. package/lib/Markdown/Markdown/index.js +0 -161
  212. package/lib/Markdown/Markdown/interface.d.ts +0 -203
  213. package/lib/Markdown/Markdown/interface.js +0 -1
  214. package/lib/Markdown/Markdown/style.js +0 -32
  215. package/lib/Markdown/plugins/latex/index.d.ts +0 -9
  216. package/lib/Markdown/plugins/latex/index.js +0 -97
  217. package/lib/Markdown/plugins/type.d.ts +0 -60
  218. package/lib/Markdown/plugins/type.js +0 -1
  219. /package/components/Markdown/{Markdown/defaultComponents/DisabledImage.tsx → core/components/DisableImage.tsx} +0 -0
  220. /package/components/Markdown/{Markdown/defaultComponents → core/components}/Media.tsx +0 -0
  221. /package/components/Markdown/{plugins → core/plugins}/cursor/Dot.tsx +0 -0
  222. /package/lib/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.d.ts +0 -0
  223. /package/lib/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.js +0 -0
  224. /package/lib/Markdown/{Markdown/defaultComponents/DisabledImage.d.ts → core/components/DisableImage.d.ts} +0 -0
  225. /package/lib/Markdown/{Markdown/defaultComponents/DisabledImage.js → core/components/DisableImage.js} +0 -0
  226. /package/lib/Markdown/{Markdown/defaultComponents → core/components}/Media.d.ts +0 -0
  227. /package/lib/Markdown/{Markdown/defaultComponents → core/components}/Media.js +0 -0
  228. /package/lib/Markdown/{plugins → core/plugins}/citations/CitationComponent.d.ts +0 -0
  229. /package/lib/Markdown/{plugins → core/plugins}/cursor/Dot.d.ts +0 -0
  230. /package/lib/Markdown/{plugins → core/plugins}/cursor/Underline.d.ts +0 -0
  231. /package/lib/Markdown/{plugins → core/plugins}/cursor/index.d.ts +0 -0
  232. /package/lib/Markdown/{Markdown/style.d.ts → styles.d.ts} +0 -0
  233. /package/lib/{AGUI/components/chat/props.js → Markdown/types.js} +0 -0
@@ -1,2 +0,0 @@
1
- import { ButtonProps } from "./props";
2
- export declare const Button: ({}: ButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -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 {};