@gendive/chatllm 0.17.45 → 0.17.46
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/react/index.mjs
CHANGED
|
@@ -2630,13 +2630,14 @@ ${finalContent}`;
|
|
|
2630
2630
|
try {
|
|
2631
2631
|
const filesToPass = skillConfig.autoConvertBase64 ? await convertAttachmentsToBase64(matchedFiles) : matchedFiles;
|
|
2632
2632
|
const result = await skillConfig.execute({ files: filesToPass, userMessage: finalContent });
|
|
2633
|
+
const attachResultType = result.metadata?.type || result.metadata?.resultType || "text";
|
|
2633
2634
|
const toolResultPart = {
|
|
2634
2635
|
type: "tool_result",
|
|
2635
2636
|
toolName: skillName,
|
|
2636
2637
|
label: skillConfig.label,
|
|
2637
2638
|
icon: skillConfig.icon,
|
|
2638
2639
|
result: {
|
|
2639
|
-
type:
|
|
2640
|
+
type: attachResultType,
|
|
2640
2641
|
content: result.content,
|
|
2641
2642
|
metadata: result.metadata,
|
|
2642
2643
|
sources: result.sources
|
|
@@ -8878,6 +8879,7 @@ var ContentPartRenderer = ({
|
|
|
8878
8879
|
);
|
|
8879
8880
|
case "tool_result": {
|
|
8880
8881
|
const { result } = part;
|
|
8882
|
+
const effectiveType = result.type !== "text" ? result.type : result.metadata?.type || result.metadata?.resultType || result.type;
|
|
8881
8883
|
return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
|
|
8882
8884
|
/* @__PURE__ */ jsx14(
|
|
8883
8885
|
ToolStatusCard,
|
|
@@ -8885,18 +8887,18 @@ var ContentPartRenderer = ({
|
|
|
8885
8887
|
toolName: part.toolName,
|
|
8886
8888
|
label: part.label,
|
|
8887
8889
|
icon: part.icon,
|
|
8888
|
-
status:
|
|
8890
|
+
status: effectiveType === "error" ? "error" : "done",
|
|
8889
8891
|
sources: result.sources,
|
|
8890
|
-
errorMessage:
|
|
8892
|
+
errorMessage: effectiveType === "error" ? result.content : void 0
|
|
8891
8893
|
}
|
|
8892
8894
|
),
|
|
8893
|
-
|
|
8895
|
+
effectiveType === "image" && /* @__PURE__ */ jsx14(
|
|
8894
8896
|
ImageContentCard,
|
|
8895
8897
|
{
|
|
8896
8898
|
part: { type: "image", url: result.content, alt: result.metadata?.alt }
|
|
8897
8899
|
}
|
|
8898
8900
|
),
|
|
8899
|
-
|
|
8901
|
+
effectiveType === "file" && /* @__PURE__ */ jsx14(
|
|
8900
8902
|
FileContentCard,
|
|
8901
8903
|
{
|
|
8902
8904
|
part: {
|