@gendive/chatllm 0.17.35 → 0.17.36

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.
@@ -3159,6 +3159,65 @@ ${result.content}
3159
3159
  abortControllerRef.current = null;
3160
3160
  return;
3161
3161
  }
3162
+ const skillResultType = result.metadata?.type;
3163
+ if (skillResultType === "image" || skillResultType === "file") {
3164
+ const imgFileParts = [];
3165
+ if (skillCleanContent.trim()) {
3166
+ imgFileParts.push({ type: "text", content: skillCleanContent });
3167
+ }
3168
+ imgFileParts.push({
3169
+ type: "tool_result",
3170
+ toolName: detectedSkill.name,
3171
+ label: result.metadata?.label || detectedSkill.name,
3172
+ icon: result.metadata?.icon,
3173
+ result: {
3174
+ type: skillResultType,
3175
+ content: result.content,
3176
+ metadata: result.metadata,
3177
+ sources: result.sources
3178
+ }
3179
+ });
3180
+ setSessions(
3181
+ (prev) => prev.map((s) => {
3182
+ if (s.id !== capturedSessionId) return s;
3183
+ return {
3184
+ ...s,
3185
+ messages: s.messages.map((m) => {
3186
+ if (m.id !== assistantMessageId) return m;
3187
+ return {
3188
+ ...m,
3189
+ contentParts: imgFileParts,
3190
+ skillExecution: {
3191
+ ...m.skillExecution,
3192
+ status: "done",
3193
+ result
3194
+ }
3195
+ };
3196
+ })
3197
+ };
3198
+ })
3199
+ );
3200
+ let shouldContinueImgFile = continueAfterToolResult;
3201
+ if (onSkillCompleteRef.current) {
3202
+ const decision = onSkillCompleteRef.current(detectedSkill.name, result);
3203
+ shouldContinueImgFile = decision === "continue";
3204
+ }
3205
+ if (!shouldContinueImgFile) {
3206
+ saveMessagesOnEarlyReturn();
3207
+ setIsLoading(false);
3208
+ abortControllerRef.current = null;
3209
+ return;
3210
+ }
3211
+ skipNextSkillParsingRef.current = true;
3212
+ saveMessagesOnEarlyReturn();
3213
+ const imgFilePrompt = skillResultType === "image" ? `"${detectedSkill.name}" \uC2A4\uD0AC\uB85C \uC774\uBBF8\uC9C0\uAC00 \uC0DD\uC131\uB418\uC5B4 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC774\uBBF8\uC9C0 URL\uC744 \uD14D\uC2A4\uD2B8\uC5D0 \uD3EC\uD568\uD558\uC9C0 \uB9D0\uACE0, \uC0DD\uC131\uB41C \uC774\uBBF8\uC9C0\uC5D0 \uB300\uD574 \uAC04\uB2E8\uD788 \uC548\uB0B4\uD574\uC8FC\uC138\uC694. skill_use \uD0DC\uADF8\uB294 \uC0AC\uC6A9\uD558\uC9C0 \uB9C8\uC138\uC694.` : `"${detectedSkill.name}" \uC2A4\uD0AC\uB85C \uD30C\uC77C\uC774 \uC0DD\uC131\uB418\uC5B4 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uD30C\uC77C URL\uC744 \uD14D\uC2A4\uD2B8\uC5D0 \uD3EC\uD568\uD558\uC9C0 \uB9D0\uACE0, \uACB0\uACFC\uC5D0 \uB300\uD574 \uAC04\uB2E8\uD788 \uC548\uB0B4\uD574\uC8FC\uC138\uC694. skill_use \uD0DC\uADF8\uB294 \uC0AC\uC6A9\uD558\uC9C0 \uB9C8\uC138\uC694.`;
3214
+ setTimeout(() => {
3215
+ sendMessage(imgFilePrompt, { hiddenUserMessage: true });
3216
+ }, 100);
3217
+ setIsLoading(false);
3218
+ abortControllerRef.current = null;
3219
+ return;
3220
+ }
3162
3221
  setSessions(
3163
3222
  (prev) => prev.map((s) => {
3164
3223
  if (s.id !== capturedSessionId) return s;