Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions client/src/components/chatbot/BotBubbleFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const BotBubbleFrame = ({
/>
) : null;
case 'showPlanLists':
return args?.plans ? (
return args?.plans && args.plans.length > 0 ? (
<div className="space-y-3">
{args.plans.map((plan, index) => (
<ToggleCard
Expand All @@ -179,7 +179,11 @@ const BotBubbleFrame = ({
/>
))}
</div>
) : null;
) : (
<>
<BotBubble messageChunks={['해당하는 요금제가 없습니다.']} />
</>
);
case 'showFirstCardList':
return <FirstCardList onButtonClick={onButtonClick} />;
default:
Expand Down
52 changes: 4 additions & 48 deletions client/src/hooks/useChatSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,49 +544,13 @@ export const useChatSocket = () => {
const content = msg.messageChunks.join('');
// 빈 문자열인 메시지는 제외 (function call만 있는 메시지들)
if (content.trim() === '') {
const functionName = msg.functionCall?.name;
if (
functionName === 'showPlanLists' &&
msg.functionCall?.args?.plans
) {
const planNames = msg.functionCall.args.plans
.map((plan: { name: string }) => plan.name)
.join(', ');
return {
role: 'assistant',
content: `${planNames}를 추천받았다`,
};
}
if (
functionName === 'requestCarouselButtons' &&
msg.functionCall?.args?.items
) {
const itemLabels = msg.functionCall.args.items
.map((item: { label: string }) => item.label)
.join(', ');
return {
role: 'assistant',
content: `${itemLabels} 선택지를 제공했다`,
};
}
if (functionName === 'requestOXCarouselButtons') {
return {
role: 'assistant',
content: '예/아니오 선택지를 제공했다',
};
}
if (functionName === 'requestOTTServiceList') {
return {
role: 'assistant',
content: 'OTT 서비스 선택지를 제공했다',
};
}
// function call 정보를 간단히 포함 (환각 방지용 중립적 표현)
return {
role: 'assistant',
content: `${functionName}을 수행하였음`,
role: 'developer',
content: `사용자 ${msg.functionCall?.name} 기능을 실행했습니다.`,
};
}
return { role: 'assistant', content };
return { role: 'developer', content };
}
return null;
})
Expand All @@ -607,14 +571,6 @@ export const useChatSocket = () => {
[sessionId, messages], // 🔧 messages 의존성 추가
);

// 제거: 서버에 더 이상 선택 상태를 보내지 않음 (로컬스토리지 사용)
// const sendCarouselSelection = useCallback((carouselData, selectedItem, isSelected) => {
// if (!sessionId) return;
// const payload = { sessionId, carouselData, selectedItem, isSelected };
// console.log('📤 Sending carousel selection:', payload);
// socket.emit('carousel-selection', payload);
// }, [sessionId]);

// 로컬 상태에서만 선택 상태 업데이트 (서버에 보내지 않음)
const updateCarouselSelection = useCallback(
(messageIndex: number, selectedItem: CarouselItem) => {
Expand Down
288 changes: 0 additions & 288 deletions client/src/pages/ChatTestPage.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import cors from 'cors';
import dotenv from 'dotenv';
import express from 'express';
import mongoose from 'mongoose';
import { getInputExamples } from './controllers/chatController.js';
import {
getAffordablePlanList,
getBundlePlanList,
Expand Down Expand Up @@ -40,7 +39,6 @@ mongoose
const apiRouter = express.Router();
app.use('/api', apiRouter);

apiRouter.get('/chat/inputs', getInputExamples);
apiRouter.get('/metadata', getUrlMetadata);
apiRouter.get('/plans/:planId', getPlanDetail);
apiRouter.get('/unlimited-plans', getUnlimitedDataPlanList);
Expand Down
Loading
Loading