@vegintech/langchain-react-agent 0.0.7 → 0.0.8
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/dist/index.d.mts +19 -2
- package/dist/index.mjs +14 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import * as react from "react";
|
|
2
|
-
import { ReactNode } from "react";
|
|
2
|
+
import { CSSProperties, ReactNode } from "react";
|
|
3
3
|
import { Components } from "streamdown";
|
|
4
4
|
import { BaseNode, InsertPosition, NodeRender, SenderProps, SkillType, SlotConfigType } from "@ant-design/x/es/sender/interface.ts";
|
|
5
5
|
|
|
6
6
|
//#region src/types.d.ts
|
|
7
|
+
/** ToolCard 各部件的样式配置 */
|
|
8
|
+
interface ToolCardStyles {
|
|
9
|
+
/** icon 容器的样式 */
|
|
10
|
+
icon?: CSSProperties;
|
|
11
|
+
/** prefix 文本的样式 */
|
|
12
|
+
prefix?: CSSProperties;
|
|
13
|
+
/** content 文本的样式 */
|
|
14
|
+
content?: CSSProperties;
|
|
15
|
+
}
|
|
7
16
|
/** ToolCard 组件 Props */
|
|
8
17
|
interface ToolCardProps {
|
|
9
18
|
/**
|
|
@@ -18,6 +27,14 @@ interface ToolCardProps {
|
|
|
18
27
|
* 左侧图标
|
|
19
28
|
*/
|
|
20
29
|
icon: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* 根节点样式
|
|
32
|
+
*/
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
/**
|
|
35
|
+
* 各部件的样式配置,可分别设置 icon、prefix、content 的样式
|
|
36
|
+
*/
|
|
37
|
+
styles?: ToolCardStyles;
|
|
21
38
|
}
|
|
22
39
|
/** Interrupt 事件数据结构 */
|
|
23
40
|
interface InterruptEvent {
|
|
@@ -247,4 +264,4 @@ declare const AgentChat: react.ForwardRefExoticComponent<AgentChatProps & react.
|
|
|
247
264
|
*/
|
|
248
265
|
declare const ToolCard: React.FC<ToolCardProps>;
|
|
249
266
|
//#endregion
|
|
250
|
-
export { AgentChat, type AgentChatInputRef, type AgentChatProps, type AgentChatRef, type BackendTool, type ChatMessage, type ContextItem, type EmptyStateConfig, type FrontendTool, type InputConfig, type InterruptConfig, type InterruptEvent, type InterruptManagerProps, type InterruptRenderProps, type MessageConfig, type MessageType, type SenderCustomizationProps, type SenderSlotConfig, type SenderSubmitParams, type ToolCallInput, ToolCard, type ToolCardProps, type ToolDefinition, type ToolExecutionRecord, type ToolExecutionStatus, type ToolParameterSchema, type ToolRenderProps };
|
|
267
|
+
export { AgentChat, type AgentChatInputRef, type AgentChatProps, type AgentChatRef, type BackendTool, type ChatMessage, type ContextItem, type EmptyStateConfig, type FrontendTool, type InputConfig, type InterruptConfig, type InterruptEvent, type InterruptManagerProps, type InterruptRenderProps, type MessageConfig, type MessageType, type SenderCustomizationProps, type SenderSlotConfig, type SenderSubmitParams, type ToolCallInput, ToolCard, type ToolCardProps, type ToolCardStyles, type ToolDefinition, type ToolExecutionRecord, type ToolExecutionStatus, type ToolParameterSchema, type ToolRenderProps };
|
package/dist/index.mjs
CHANGED
|
@@ -859,32 +859,39 @@ AgentChat.displayName = "AgentChat";
|
|
|
859
859
|
* ToolCard 组件 - 用于展示工具调用结果
|
|
860
860
|
* 样式:圆角矩形框,左侧 icon,label 分两行显示(prefix 小字体,content 默认字体)
|
|
861
861
|
*/
|
|
862
|
-
const ToolCard = ({ prefix, content, icon }) => {
|
|
862
|
+
const ToolCard = ({ prefix, content, icon, style, styles }) => {
|
|
863
863
|
return /* @__PURE__ */ jsxs("div", {
|
|
864
864
|
style: {
|
|
865
865
|
display: "inline-flex",
|
|
866
866
|
alignItems: "center",
|
|
867
867
|
gap: 8,
|
|
868
868
|
borderRadius: 8,
|
|
869
|
-
fontSize: 13
|
|
869
|
+
fontSize: 13,
|
|
870
|
+
...style
|
|
870
871
|
},
|
|
871
872
|
children: [/* @__PURE__ */ jsx("span", {
|
|
872
873
|
style: {
|
|
873
874
|
display: "flex",
|
|
874
|
-
alignItems: "center"
|
|
875
|
+
alignItems: "center",
|
|
876
|
+
...styles?.icon
|
|
875
877
|
},
|
|
876
878
|
children: icon
|
|
877
879
|
}), /* @__PURE__ */ jsxs("span", {
|
|
878
880
|
style: {
|
|
879
881
|
display: "flex",
|
|
880
882
|
alignItems: "center",
|
|
881
|
-
gap: 4
|
|
882
|
-
color: "rgba(0, 0, 0, 0.45)"
|
|
883
|
+
gap: 4
|
|
883
884
|
},
|
|
884
885
|
children: [/* @__PURE__ */ jsx("span", {
|
|
885
|
-
style: {
|
|
886
|
+
style: {
|
|
887
|
+
fontSize: 12,
|
|
888
|
+
...styles?.prefix
|
|
889
|
+
},
|
|
886
890
|
children: prefix
|
|
887
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
891
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
892
|
+
style: { ...styles?.content },
|
|
893
|
+
children: content
|
|
894
|
+
})]
|
|
888
895
|
})]
|
|
889
896
|
});
|
|
890
897
|
};
|