@vegintech/langchain-react-agent 0.0.3 → 0.0.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/dist/index.d.mts +20 -24
- package/dist/index.mjs +36 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as react from "react";
|
|
2
|
-
import { ReactNode } from "react";
|
|
2
|
+
import React, { 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
|
-
import { BaseMessage } from "@langchain/core/messages";
|
|
6
5
|
|
|
7
6
|
//#region src/types.d.ts
|
|
8
7
|
/** Context Item,用于传递上下文信息 */
|
|
@@ -178,28 +177,25 @@ interface AgentChatRef {
|
|
|
178
177
|
//#region src/AgentChat.d.ts
|
|
179
178
|
declare const AgentChat: react.ForwardRefExoticComponent<AgentChatProps & react.RefAttributes<AgentChatRef>>;
|
|
180
179
|
//#endregion
|
|
181
|
-
//#region src/
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
180
|
+
//#region src/ToolCard.d.ts
|
|
181
|
+
interface ToolCardProps {
|
|
182
|
+
/**
|
|
183
|
+
* 前缀文本(中文,使用小字体)
|
|
184
|
+
*/
|
|
185
|
+
prefix: string;
|
|
186
|
+
/**
|
|
187
|
+
* 正文内容(英文/文件名,保持默认大小)
|
|
188
|
+
*/
|
|
189
|
+
content?: string;
|
|
190
|
+
/**
|
|
191
|
+
* 左侧图标
|
|
192
|
+
*/
|
|
193
|
+
icon: React.ReactNode;
|
|
194
|
+
}
|
|
194
195
|
/**
|
|
195
|
-
*
|
|
196
|
+
* ToolCard 组件 - 用于展示工具调用结果
|
|
197
|
+
* 样式:圆角矩形框,左侧 icon,label 分两行显示(prefix 小字体,content 默认字体)
|
|
196
198
|
*/
|
|
197
|
-
declare
|
|
198
|
-
messages: ChatMessage[];
|
|
199
|
-
toolResults: Map<string, unknown>;
|
|
200
|
-
};
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region src/injectStyles.d.ts
|
|
203
|
-
declare function injectStyles(): void;
|
|
199
|
+
declare const ToolCard: React.FC<ToolCardProps>;
|
|
204
200
|
//#endregion
|
|
205
|
-
export { AgentChat, type AgentChatInputRef, type AgentChatProps, type AgentChatRef, type BackendTool, type ChatMessage, type ContextItem, type FrontendTool, type InputConfig, type MessageConfig, type MessageType, type SenderCustomizationProps, type SenderSlotConfig, type SenderSubmitParams, type ToolCallInput, type ToolDefinition, type ToolExecutionRecord, type ToolExecutionStatus, type ToolParameterSchema, type ToolRenderProps
|
|
201
|
+
export { AgentChat, type AgentChatInputRef, type AgentChatProps, type AgentChatRef, type BackendTool, type ChatMessage, type ContextItem, type FrontendTool, type InputConfig, 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 };
|
package/dist/index.mjs
CHANGED
|
@@ -821,4 +821,39 @@ const AgentChat = forwardRef(({ apiUrl, assistantId, headers, threadId: external
|
|
|
821
821
|
});
|
|
822
822
|
AgentChat.displayName = "AgentChat";
|
|
823
823
|
//#endregion
|
|
824
|
-
|
|
824
|
+
//#region src/ToolCard.tsx
|
|
825
|
+
/**
|
|
826
|
+
* ToolCard 组件 - 用于展示工具调用结果
|
|
827
|
+
* 样式:圆角矩形框,左侧 icon,label 分两行显示(prefix 小字体,content 默认字体)
|
|
828
|
+
*/
|
|
829
|
+
const ToolCard = ({ prefix, content, icon }) => {
|
|
830
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
831
|
+
style: {
|
|
832
|
+
display: "inline-flex",
|
|
833
|
+
alignItems: "center",
|
|
834
|
+
gap: 8,
|
|
835
|
+
borderRadius: 8,
|
|
836
|
+
fontSize: 13
|
|
837
|
+
},
|
|
838
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
839
|
+
style: {
|
|
840
|
+
display: "flex",
|
|
841
|
+
alignItems: "center"
|
|
842
|
+
},
|
|
843
|
+
children: icon
|
|
844
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
845
|
+
style: {
|
|
846
|
+
display: "flex",
|
|
847
|
+
alignItems: "center",
|
|
848
|
+
gap: 4,
|
|
849
|
+
color: "rgba(0, 0, 0, 0.45)"
|
|
850
|
+
},
|
|
851
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
852
|
+
style: { fontSize: 12 },
|
|
853
|
+
children: prefix
|
|
854
|
+
}), /* @__PURE__ */ jsx("span", { children: content })]
|
|
855
|
+
})]
|
|
856
|
+
});
|
|
857
|
+
};
|
|
858
|
+
//#endregion
|
|
859
|
+
export { AgentChat, ToolCard };
|