@gendive/chatllm 0.17.1 → 0.17.2
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 +10 -12
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +10 -12
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -2353,7 +2353,8 @@ ${newConversation}
|
|
|
2353
2353
|
}, []);
|
|
2354
2354
|
const sendMessage = (0, import_react5.useCallback)(async (content, options2) => {
|
|
2355
2355
|
const messageContent = content || input;
|
|
2356
|
-
if (!messageContent.trim() || isLoading) return;
|
|
2356
|
+
if (!messageContent.trim() && attachments.length === 0 || isLoading) return;
|
|
2357
|
+
setIsLoading(true);
|
|
2357
2358
|
let sessionId = currentSessionId;
|
|
2358
2359
|
if (!sessionId) {
|
|
2359
2360
|
if (useExternalStorage && onCreateSessionRef.current) {
|
|
@@ -2528,7 +2529,6 @@ ${finalContent}`;
|
|
|
2528
2529
|
setIsLoading(false);
|
|
2529
2530
|
return;
|
|
2530
2531
|
}
|
|
2531
|
-
setIsLoading(true);
|
|
2532
2532
|
abortControllerRef.current = new AbortController();
|
|
2533
2533
|
try {
|
|
2534
2534
|
let messagesToSend = [...existingMessages, userMessage];
|
|
@@ -2608,8 +2608,8 @@ ${attachmentContext}
|
|
|
2608
2608
|
const modelConfig = models.find((m) => m.id === selectedModel);
|
|
2609
2609
|
const provider = modelConfig?.provider || "ollama";
|
|
2610
2610
|
let response;
|
|
2611
|
-
if (
|
|
2612
|
-
const result = await
|
|
2611
|
+
if (onSendMessageRef.current) {
|
|
2612
|
+
const result = await onSendMessageRef.current({
|
|
2613
2613
|
messages: messagesForApi,
|
|
2614
2614
|
model: selectedModel,
|
|
2615
2615
|
provider,
|
|
@@ -3034,14 +3034,12 @@ ${result.content}
|
|
|
3034
3034
|
keepRecentMessages,
|
|
3035
3035
|
buildSystemPrompt,
|
|
3036
3036
|
compressContext,
|
|
3037
|
-
onSendMessage,
|
|
3038
|
-
onError,
|
|
3039
|
-
generateTitleCallback,
|
|
3040
|
-
onTitleChange,
|
|
3041
3037
|
useExternalStorage,
|
|
3042
|
-
onSaveMessages,
|
|
3043
3038
|
handleSkillCall,
|
|
3044
|
-
resolvedSkills
|
|
3039
|
+
resolvedSkills,
|
|
3040
|
+
/** @Todo vibecode - attachments, continueAfterToolResult를 deps에 추가하여 stale closure 방지 */
|
|
3041
|
+
attachments,
|
|
3042
|
+
continueAfterToolResult
|
|
3045
3043
|
]);
|
|
3046
3044
|
const handlePollSubmit = (0, import_react5.useCallback)(
|
|
3047
3045
|
(messageId, responses) => {
|
|
@@ -3309,8 +3307,8 @@ ${currentSession.contextSummary}` },
|
|
|
3309
3307
|
const provider = modelConfig?.provider || "ollama";
|
|
3310
3308
|
let responseContent = "";
|
|
3311
3309
|
let responseSources;
|
|
3312
|
-
if (
|
|
3313
|
-
const result = await
|
|
3310
|
+
if (onSendMessageRef.current) {
|
|
3311
|
+
const result = await onSendMessageRef.current({
|
|
3314
3312
|
messages: messagesForApi,
|
|
3315
3313
|
model: targetModel,
|
|
3316
3314
|
provider,
|