Skip to content

Commit

Permalink
Update env vars, debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Lin-Rexter committed Jan 5, 2025
1 parent cee8f1c commit 8dc51c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/components/Main/traffic/chat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { FaSmile, FaSearch, FaPaperclip } from 'react-icons/fa';
import { Button, Popover } from "flowbite-react";
import { IoMdClose } from "react-icons/io";
import { MdKeyboardVoice } from "react-icons/md";
//import { gemini_ask } from '@/lib/ai/gemini'
import { langchain_ask } from '@/lib/ai/langchain';
import { gemini_ask } from '@/lib/ai/gemini'
//import { langchain_ask } from '@/lib/ai/langchain';
import { Effect } from 'deck.gl';
import { marked } from 'marked';

Expand Down Expand Up @@ -98,11 +98,13 @@ const ChatBubble = () => {
if (isTyping) {
const Gemini_Output = async () => {
if (message) {
//let result = await gemini_ask(message)
let result = await langchain_ask(message)
let gemini_msg = message;

setMessage('');

let result = await gemini_ask(gemini_msg)
//let result = await langchain_ask(message)

if (result?.error) {
result.data = result?.error || '[系統錯誤] 次數過於頻繁,請稍後再次與AI互動!'
setGeminiMsg(result.data)
Expand Down
7 changes: 4 additions & 3 deletions src/components/Main/traffic/timeline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ const Timeline = () => {
// 初始化filterTimeList
setFilterTimeList([])

setMessage(null)

setIsShowFuture(!isShowFuture);

let new_timeMakers = timeMarkers.filter((item) => item.value > 0)
Expand All @@ -241,6 +239,9 @@ const Timeline = () => {
} else {
console.warn("暫時無未來之預測資料")
setMessage("暫時無未來之預測資料")
setTimeout(() => {
setMessage(null)
}, 1500)
}
}

Expand Down Expand Up @@ -344,7 +345,7 @@ const Timeline = () => {
icon_text={"系統訊息"}
title={"系統訊息"}
contents={message}
//showExit={false}
showExit={false}
//durations={1000}
/>
)
Expand Down

0 comments on commit 8dc51c0

Please sign in to comment.