diff --git a/client/src/components/chatbot/ChatButtonGroups/OttButtonGroup.tsx b/client/src/components/chatbot/ChatButtonGroups/OttButtonGroup.tsx index 5a6f865..7b4284a 100644 --- a/client/src/components/chatbot/ChatButtonGroups/OttButtonGroup.tsx +++ b/client/src/components/chatbot/ChatButtonGroups/OttButtonGroup.tsx @@ -39,10 +39,6 @@ const OttButtonGroup = ({ // selectedData가 변경될 때마다 state 업데이트 useEffect(() => { if (selectedData?.isSelected && selectedData.selectedServices) { - console.log( - '🔄 Updating selectedServices from props:', - selectedData.selectedServices, - ); setSelectedServices(selectedData.selectedServices); } else { setSelectedServices([]); @@ -62,7 +58,6 @@ const OttButtonGroup = ({ return ( <> - {OTT_SERVICES.map((service) => ( { try { const session = getSession(sessionIdToLoad); - console.log('🔍 실제 로컬스토리지 세션 데이터:', session); if (!session) return { messages: [] }; const messages: Message[] = session.messages.map( @@ -161,17 +160,6 @@ export const useChatSocket = () => { setStoredUserProfile(userProfile); } if (!hasLoggedSession.current) { - console.log( - '📂 로컬스토리지에서 기존 채팅 히스토리를 불러왔습니다:', - localMessages.length, - '개', - ); - if (userProfile) { - console.log( - '👤 사용자 프로필도 복원되었습니다:', - userProfile.plan.name, - ); - } hasLoggedSession.current = true; } } else { @@ -180,7 +168,6 @@ export const useChatSocket = () => { setStoredUserProfile(userProfile); } if (!hasLoggedSession.current) { - console.log('📭 새로운 세션을 시작합니다'); hasLoggedSession.current = true; } } @@ -207,11 +194,6 @@ export const useChatSocket = () => { } const converted: Message[] = logs.map((msg) => { - // 로그 추가 (각 메시지별로) - if (msg.type) { - console.log('🔍 Processing message with type:', msg.type, msg.data); - } - // 캐러셀 선택 등 특별한 타입 처리 if ( msg.type === 'carousel_select' || @@ -468,7 +450,6 @@ export const useChatSocket = () => { }; const handleDone = () => { - console.log('✅ Stream completed'); setIsStreaming(false); followUpResponseRef.current = ''; // 역질문 완료 시 리셋 }; @@ -561,7 +542,6 @@ export const useChatSocket = () => { message: text.trim(), history: chatHistory, // 🔧 전체 대화 히스토리 추가 }; - console.log(payload); setMessages((prev) => [...prev, newUserMessage] as Message[]); setIsStreaming(true); responseRef.current = ''; @@ -574,11 +554,6 @@ export const useChatSocket = () => { // 로컬 상태에서만 선택 상태 업데이트 (서버에 보내지 않음) const updateCarouselSelection = useCallback( (messageIndex: number, selectedItem: CarouselItem) => { - console.log('🔄 로컬에서 캐러셀 선택 상태 업데이트:', { - messageIndex, - selectedItem, - }); - // 로컬 상태만 업데이트 setMessages((prev) => prev.map((msg, idx) => { @@ -598,11 +573,6 @@ export const useChatSocket = () => { // 로컬 상태에서만 OTT 선택 상태 업데이트 (서버에 보내지 않음) const updateOttSelection = useCallback( (messageIndex: number, selectedServices: string[]) => { - console.log('🎬 로컬에서 OTT 선택 상태 업데이트:', { - messageIndex, - selectedServices, - }); - // 로컬 상태만 업데이트 setMessages((prev) => prev.map((msg, idx) => { @@ -625,11 +595,6 @@ export const useChatSocket = () => { // 로컬 상태에서만 OX 선택 상태 업데이트 (서버에 보내지 않음) const updateOxSelection = useCallback( (messageIndex: number, selectedOption: string) => { - console.log('🔘 로컬에서 OX 선택 상태 업데이트:', { - messageIndex, - selectedOption, - }); - // 로컬 상태만 업데이트 setMessages((prev) => prev.map((msg, idx) => { @@ -646,14 +611,6 @@ export const useChatSocket = () => { [], ); - // storedUserProfile 상태 변화 디버깅 - useEffect(() => { - console.log( - '📊 storedUserProfile 상태 변화:', - storedUserProfile?.plan?.name || 'null', - ); - }, [storedUserProfile]); - // 메시지가 변경될 때마다 로컬스토리지에 저장 useEffect(() => { if (useLocalStorage && messages.length > 0) { @@ -675,7 +632,6 @@ export const useChatSocket = () => { // userProfile 설정 함수 (ChatbotPage에서 사용) const setUserProfile = useCallback((userProfile: UserProfile | null) => { - console.log('💾 setUserProfile 호출됨:', userProfile?.plan?.name || 'null'); setStoredUserProfile(userProfile); }, []); diff --git a/client/src/pages/ChatbotPage.tsx b/client/src/pages/ChatbotPage.tsx index 643ded7..6589523 100644 --- a/client/src/pages/ChatbotPage.tsx +++ b/client/src/pages/ChatbotPage.tsx @@ -233,9 +233,6 @@ const ChatbotPage = () => { ); }); - console.log('🔍 전체 messages 배열 길이:', messages.length); - console.log('🔍 전체 allMessages 배열 길이:', allMessages.length); - if (actualIndex !== -1) { updateCarouselSelection(actualIndex, selectedItem); } else { @@ -249,9 +246,7 @@ const ChatbotPage = () => { // 새로 추가: OTT 선택 처리 const handleOttSelect = useCallback( - (selectedServices: string[], displayIndex?: number) => { - console.log('🎬 OTT 선택:', { selectedServices, displayIndex }); - + (selectedServices: string[]) => { // 실제 function_call 메시지의 인덱스를 찾기 (messages 배열에서만) const actualIndex = messages.findIndex((msg) => { return ( @@ -271,9 +266,7 @@ const ChatbotPage = () => { // 새로 추가: OX 선택 처리 const handleOxSelect = useCallback( - (selectedOption: string, displayIndex?: number) => { - console.log('🔘 OX 선택:', { selectedOption, displayIndex }); - + (selectedOption: string) => { // 실제 function_call 메시지의 인덱스를 찾기 (messages 배열에서만) const actualIndex = messages.findIndex((msg) => { return ( @@ -352,7 +345,6 @@ const ChatbotPage = () => { // 컨테이너의 첫 번째 자식 (실제 메시지들이 들어있는 div) 관찰 const messageContainer = container.querySelector('div'); - console.log(messageContainer); if (messageContainer) { observer.observe(messageContainer); } diff --git a/client/src/utils/chatStorage.ts b/client/src/utils/chatStorage.ts index 685bfac..f6828ec 100644 --- a/client/src/utils/chatStorage.ts +++ b/client/src/utils/chatStorage.ts @@ -98,7 +98,6 @@ export const deleteSession = (sessionId: string): void => { const sessions = getAllSessions(); const filtered = sessions.filter((s) => s.sessionId !== sessionId); localStorage.setItem(STORAGE_KEY, JSON.stringify(filtered)); - console.log('✅ 세션 삭제 완료:', sessionId); } catch (error) { console.error('❌ 세션 삭제 실패:', error); } @@ -108,7 +107,6 @@ export const deleteSession = (sessionId: string): void => { export const clearAllSessions = (): void => { try { localStorage.removeItem(STORAGE_KEY); - console.log('✅ 모든 세션 삭제 완료'); } catch (error) { console.error('❌ 세션 삭제 실패:', error); } diff --git a/server/utils/promptBuilder.js b/server/utils/promptBuilder.js index df05d68..71a36aa 100644 --- a/server/utils/promptBuilder.js +++ b/server/utils/promptBuilder.js @@ -45,7 +45,7 @@ Function Calling - 고용량 데이터 요금제를 추천해주세요라는 질문이 오면, "**고용량 데이터 요금제를 찾으시는군요!** 고용량 요금제는 데이터 걱정없이 마음 껏 쓸 수 있는 요금제에요😀 \n \n요금제를 추천해 드리기 위해, 고객님의 한달 데이터 사용량은 얼마인가요?" → requestCarouselButtons(["50GB 이하", "120GB 이하", "200GB 이하", "무제한 필요", "모르겠음"]) - "어떤 통신 기술을 선호하시나요?" → requestCarouselButtons(["5G", "LTE", "상관없음"]) -- "월 예산은 어느 정도로 생각하고 계신가요?" → requestCarouselButtons(["3-5만원", "5-7만원", "7-10만원", "10-15만원", "15만원 이상", "예산 무관"]) +- "월 예산은 어느 정도로 생각하고 계신가요?" → requestCarouselButtons(["3-5만원", "5-7만원", "7-10만원", "10-15만원", "예산 무관"]) - 일반적으로 유저가 요금제를 추천해달라고하면, "한달에 데이터를 얼마나 사용하시나요?" → requestCarouselButtons(["5GB 이하", "15GB 이하", "50GB 이하", "무제한 필요", "모르겠음"]) 실행