@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.js
CHANGED
|
@@ -2699,13 +2699,14 @@ ${finalContent}`;
|
|
|
2699
2699
|
try {
|
|
2700
2700
|
const filesToPass = skillConfig.autoConvertBase64 ? await convertAttachmentsToBase64(matchedFiles) : matchedFiles;
|
|
2701
2701
|
const result = await skillConfig.execute({ files: filesToPass, userMessage: finalContent });
|
|
2702
|
+
const attachResultType = result.metadata?.type || result.metadata?.resultType || "text";
|
|
2702
2703
|
const toolResultPart = {
|
|
2703
2704
|
type: "tool_result",
|
|
2704
2705
|
toolName: skillName,
|
|
2705
2706
|
label: skillConfig.label,
|
|
2706
2707
|
icon: skillConfig.icon,
|
|
2707
2708
|
result: {
|
|
2708
|
-
type:
|
|
2709
|
+
type: attachResultType,
|
|
2709
2710
|
content: result.content,
|
|
2710
2711
|
metadata: result.metadata,
|
|
2711
2712
|
sources: result.sources
|
|
@@ -8947,6 +8948,7 @@ var ContentPartRenderer = ({
|
|
|
8947
8948
|
);
|
|
8948
8949
|
case "tool_result": {
|
|
8949
8950
|
const { result } = part;
|
|
8951
|
+
const effectiveType = result.type !== "text" ? result.type : result.metadata?.type || result.metadata?.resultType || result.type;
|
|
8950
8952
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
|
|
8951
8953
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8952
8954
|
ToolStatusCard,
|
|
@@ -8954,18 +8956,18 @@ var ContentPartRenderer = ({
|
|
|
8954
8956
|
toolName: part.toolName,
|
|
8955
8957
|
label: part.label,
|
|
8956
8958
|
icon: part.icon,
|
|
8957
|
-
status:
|
|
8959
|
+
status: effectiveType === "error" ? "error" : "done",
|
|
8958
8960
|
sources: result.sources,
|
|
8959
|
-
errorMessage:
|
|
8961
|
+
errorMessage: effectiveType === "error" ? result.content : void 0
|
|
8960
8962
|
}
|
|
8961
8963
|
),
|
|
8962
|
-
|
|
8964
|
+
effectiveType === "image" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8963
8965
|
ImageContentCard,
|
|
8964
8966
|
{
|
|
8965
8967
|
part: { type: "image", url: result.content, alt: result.metadata?.alt }
|
|
8966
8968
|
}
|
|
8967
8969
|
),
|
|
8968
|
-
|
|
8970
|
+
effectiveType === "file" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8969
8971
|
FileContentCard,
|
|
8970
8972
|
{
|
|
8971
8973
|
part: {
|